Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   MUI_FINISHPAGE_RUN help (http://forums.winamp.com/showthread.php?t=226068)

meganoob 15th September 2005 12:22

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 12:39

Maybe exe file need to run with parameters. Could you post properties of shortcut from Main menu?

meganoob 15th September 2005 13:39

I have already checked for that :) No parameters are present...

Afrow UK 15th September 2005 14:01

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 17:51

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 18:03

Sorry, missed this note in the readme:
"define MUI_FINISHPAGE_RUN without parameters"

-Stu

meganoob 16th September 2005 16:10

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 16:29

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 16th September 2005 23:30

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 08:09

That's just the target of the desktop link. What's the "Start in" directory it uses?

meganoob 17th September 2005 09:25

Ok, here it is:

"C:\Program Files\Sierra\SWAT 4\Content\System"

kichik 17th September 2005 09:29

There is your problem. You need to use SetOutPath $INSTDIR\Content\System instead of just SetOutPath $INSTDIR.

meganoob 18th September 2005 03:26

It is working now!!! Thanks a lot Afrow UK and kichik!!! You guys are the best :)


All times are GMT. The time now is 04:26.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.