Skip to content
⌘ NSIS Forum Archive

MUI_FINISHPAGE_RUN help

13 posts

Guest#

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#
Maybe exe file need to run with parameters. Could you post properties of shortcut from Main menu?
Afrow UK#
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
Guest#
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#
Sorry, missed this note in the readme:
"define MUI_FINISHPAGE_RUN without parameters"

-Stu
Guest#
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#
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.
Guest#
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#
There is your problem. You need to use SetOutPath $INSTDIR\Content\System instead of just SetOutPath $INSTDIR.