- NSIS Discussion
- MUI_FINISHPAGE_RUN help
Archive: MUI_FINISHPAGE_RUN help
meganoob
15th September 2005 13:22 UTC
MUI_FINISHPAGE_RUN help
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
glory_man
15th September 2005 13:39 UTC
Maybe exe file need to run with parameters. Could you post properties of shortcut from Main menu?
meganoob
15th September 2005 14:39 UTC
I have already checked for that :) No parameters are present...
Afrow UK
15th September 2005 15:01 UTC
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
meganoob
15th September 2005 18:51 UTC
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?
Afrow UK
15th September 2005 19:03 UTC
Sorry, missed this note in the readme:
"define MUI_FINISHPAGE_RUN without parameters"
-Stu
meganoob
16th September 2005 17:10 UTC
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...
kichik
16th September 2005 17:29 UTC
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.
meganoob
17th September 2005 00:30 UTC
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...
kichik
17th September 2005 09:09 UTC
That's just the target of the desktop link. What's the "Start in" directory it uses?
meganoob
17th September 2005 10:25 UTC
Ok, here it is:
"C:\Program Files\Sierra\SWAT 4\Content\System"
kichik
17th September 2005 10:29 UTC
There is your problem. You need to use SetOutPath $INSTDIR\Content\System instead of just SetOutPath $INSTDIR.
meganoob
18th September 2005 04:26 UTC
It is working now!!! Thanks a lot Afrow UK and kichik!!! You guys are the best :)