Archive: ExecShell in PageLeave result in application error


ExecShell in PageLeave result in application error
  Hi All,

I'm using InstallOptions with a link button to open a browser window using ShellExec call.

For some reason, if I make that call, when I close the installtion I get an Application Error:

The instruction as "0x..." referenced memory at "0x00000000"/ The memory could not be "read".
Does anyone have an idea why it happens?

Thanks,
Shlomi

None of my installers which use ExecShell "open" to open webpages have that problem.

It would be easier to help if you showed the code that does not seem to work properly and also said which version of NSIS you are using.


I use Venis IX 2.2.5, and MakeNSISW 2.3

The relevant code:


PageLeave


!insertmacro MUI_INSTALLOPTIONS_READ $R0 "Welcome.ini" "Settings" "State"
${Select} $R0
${Case} 0
StrCpy $PAGETOKEEP "none"
${Case} 1
StrCpy $PAGETOKEEP "advanced"
${Case} 3
ExecShell open "notepad.exe"
MessageBox MB_OK "License"
Abort
${Default}
Abort
${EndSelect}

>FunctionEnd
>
And in Welcome.ini:

***93;

>Type=Link
Text
=user license Agreement
Left=185
Right=300
Top=130
Bottom=140
Flags=NOTIFY
>
The error occurs when I click on the close button of the installer, only if I clicked the link button and called ExecShell.

 ExecShell open "notepad.exe"
If you want to run notepad.exe then ExecShell is not the correct command; Exec or ExecWait can be used to start notepad.exe

If you read the manual you will find some examples of how to use ExecShell (http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.1.3). In these examples the action is always enclosed in quotes, e.g.
ExecShell "open" "http://nsis.sf.net/"
ExecShell "open" "$INSTDIR\readme.txt"
The first example will use the default browser to display a webpage. The second will display a text file using the default application for this type of file.

I tested it on another machine, and it seems like a local problem. I will let you know when I find the source.

Thanks,
Shlomi.