Hi gotsanity
This is my first script and could use a good proof-reading from you all. Constructive criticism welcome.
Let's do that then ;)
[code language=playonlinux]
TITLE="Install OCTGN"
[/code]
That will have to match the script name in the repository, so just "OCTGN" is better.
POL_SetupWindow_Init
POL_Debug_Init
[code language=playonlinux]
# Get user input on prefix name
POL_SetupWindow_textbox "Please select a simple name for the winebottle? (octgn is fine)" "$TITLE"
PREFIX=$APP_ANSWER
[/code]
I see no point in having the user choose the prefix name, if "octgn" is fine, just use that. It's also strange to ask questions even before script presentation.
[code language=playonlinux]
POL_SetupWindow_InstallMethod "LOCAL"
[/code]
Either add support for automated download, or drop this statement: asking the user to choose between one option will feel a bit silly...
[code language=playonlinux]
POL_SetupWindow_browse "Please select the installation file to run." "$TITLE"
[/code]
All user-oriented messages should have support for localization, see
http://www.playonlinux.com/en/dev-documentation-10.html for the explanation of eval_gettext usage.
[code language=playonlinux]
POL_SetupWindow_wait "Installation in progress." "$TITLE"
POL_Wine start /unix "$APP_ANSWER"
POL_Wine_WaitExit "$TITLE"
[/code]
You can use POL_Wine_WaitBefore "$TITLE" instead of this POL_SetupWindow_wait call, it will display the standard waiting message.
"start /unix" is usually not required (needs testing, but true 95% of the time).
POL_Wine_WaitBefore and POL_Wine_WaitExit shouldn't be both necessary around a single instruction, as one is useful if the instruction is blocking and the other if it is asynchronous. I suspect that after removing "start /unix" the installation will become blocking, and that POL_Wine_WaitBefore will be sufficient.
[code language=playonlinux]
# Have user modify settings.json to turn hardware acceleration off.
POL_SetupWindow_message "IMPORTANT! On the next screen notepad will open with a config file. You MUST edit UseHardwareAcceleration to false in order for Octgn to function without crashing. When finished just save and exit and the script will finish processing." "$TITLE"
POL_Wine start "notepad.exe c:/users/$USER/My Documents/OCTGN/Config/settings.json"
POL_Wine_WaitExit "$TITLE"
[/code]
That's what computers are for, it must be possible to automate that using sed, perl or even awk.
Some more informations about the file format would help.
Regards,
Pierre.
Editiert von: petch