I need some help on finishpage run (MUI)... Maybe it is specific to Securom games... If I try to run Swat 4 game from NSIS installer after finishing some custom files installation, the game crashes and gives me a message error, but if I launch the game from Main menu or desktop link, it runs without trouble. Here is the code (the installer works fine).
!define MUI_FINISHPAGE_RUN_NOTCHECKED
!define MUI_FINISHPAGE_RUN "$INSTDIR\Content\System\Swat4.exe"
!insertmacro MUI_PAGE_FINISH
MUI_FINISHPAGE_RUN help
13 posts
Maybe exe file need to run with parameters. Could you post properties of shortcut from Main menu?
I have already checked for that 🙂 No parameters are present...
Perhaps you need to set the working directory first.
The working directory is set in the "Start in" text-box on the shortcut properties. Use the SetOutPath instruction to set the working directory before executing swat4 with Exec:
!define MUI_FINISHPAGE_RUN_NOTCHECKED
!define MUI_FINISHPAGE_RUN_FUNCTION RunSwat4
!insertmacro MUI_PAGE_FINISH
Function RunSwat4
SetOutPath $INSTDIR
Exec "$INSTDIR\Content\System\Swat4.exe"
FunctionEnd
-Stu
The working directory is set in the "Start in" text-box on the shortcut properties. Use the SetOutPath instruction to set the working directory before executing swat4 with Exec:
!define MUI_FINISHPAGE_RUN_NOTCHECKED
!define MUI_FINISHPAGE_RUN_FUNCTION RunSwat4
!insertmacro MUI_PAGE_FINISH
Function RunSwat4
SetOutPath $INSTDIR
Exec "$INSTDIR\Content\System\Swat4.exe"
FunctionEnd
-Stu
What is going wrong? It is giving me this error:
1 warning:
install function "RunSwat4" not referenced - zeroing code (565-568) out
Here is the code:
...
!define MUI_FINISHPAGE_RUN_NOTCHECKED
!define MUI_FINISHPAGE_RUN_FUNCTION RunSwat4
!define MUI_FINISHPAGE_RUN_TEXT "Run Game"
!insertmacro MUI_PAGE_FINISH
...
...
Function RunSwat4
SetOutPath "$INSTDIR"
Exec "$INSTDIR\Content\System\Swat4.exe"
FunctionEnd
...
Is it a bug?
1 warning:
install function "RunSwat4" not referenced - zeroing code (565-568) out
Here is the code:
...
!define MUI_FINISHPAGE_RUN_NOTCHECKED
!define MUI_FINISHPAGE_RUN_FUNCTION RunSwat4
!define MUI_FINISHPAGE_RUN_TEXT "Run Game"
!insertmacro MUI_PAGE_FINISH
...
...
Function RunSwat4
SetOutPath "$INSTDIR"
Exec "$INSTDIR\Content\System\Swat4.exe"
FunctionEnd
...
Is it a bug?
Sorry, missed this note in the readme:
"define MUI_FINISHPAGE_RUN without parameters"
-Stu
"define MUI_FINISHPAGE_RUN without parameters"
-Stu
No luck at all 🙁
The game keeps giving me this message if launched from installer:
Missing startup.ini file
UNKNOWN: appInit
But no errors if launched from desktop link or Start Menu...
The game keeps giving me this message if launched from installer:
Missing startup.ini file
UNKNOWN: appInit
But no errors if launched from desktop link or Start Menu...
What is the working directory of the shortcut that does work? Maybe $INSTDIR is not the working directory you need. Maybe the game expects to start at $INSTDIR\Content\System.
Here is the desktop link:
"C:\Program Files\Sierra\SWAT 4\Content\System\Swat4.exe"
I suppose that maybe this is an issue with securom games...
"C:\Program Files\Sierra\SWAT 4\Content\System\Swat4.exe"
I suppose that maybe this is an issue with securom games...
That's just the target of the desktop link. What's the "Start in" directory it uses?
Ok, here it is:
"C:\Program Files\Sierra\SWAT 4\Content\System"
"C:\Program Files\Sierra\SWAT 4\Content\System"
There is your problem. You need to use SetOutPath $INSTDIR\Content\System instead of just SetOutPath $INSTDIR.
It is working now!!! Thanks a lot Afrow UK and kichik!!! You guys are the best 🙂