I have a windows application and i am using WineHQ on my mac to run this app. The application is a specific numerical solver for physics. Everytime a physics problem is to be solved, certain initial conditions are to be given.
The idea is to develop a bash script that can INSTALL or RUN this numerical solver for the initial condition.
INSTALL: When this app was developed the developer forgot to embed certain files into the app. The app hence requires certain CUSTOM FILES which are to be copy-pasted once the application is installed. [Its not a CRACK].
RUN: Now that the app is installed, everytime i run the solver, i have to specify an initial condition. The initial condition is in INIT_FOLDER. I intend to copy this folder to /APP and then run the APP.exe.
I am writing a bash script for the same.
#! /bin/bash
if [ $1 = "INSTALL" ]; then
wine [APP MAC PATH] APP.exe
cp [CUSTOM FILES PATH]/ ~/.wine.../APP
cd ~/.wine.../APP
else
if [ $1="RUN" ]; then
cp $2 ~/.wine.../APP
cd ~/.wine.../APP
wine APP.exe
fi
fi
The end goal is to run the following commands,
>>./scriptname INSTALL
>>./scriptname RUN INIT_FOLDER_PATH
INSTALL: Of course when i run the command to install the application, i do not come accross any problems. HOWEVER, I want to improve the following script (to educate myself). Suppose the application does not install I.E.
wine [APP MAC PATH] APP.exe
"fails". How to prevent the subsequent operation from being executed?
Also, I dont want to type the wine folder location. Is their some way to make this easier, like representing the "wine app path" as an equivalent word (say FOO)
RUN: I would like to get some validation on this. If i type,
>>./scriptname RUN INIT_FOLDER_PATH/
Am I write to assume $2 is INIT_FOLDER_PATH. Also is the following command the write way,
cp $2 ~/.wine.../APPFOLDERNAME