Archive: Some questions (reboot, shortcut, exec)


Some questions (reboot, shortcut, exec)
Hi,

Im creating an installer using nsis and ive got a few questions.
- After installing everything I want to reboot the computer. I show a messagebox with 'reboot ok Y/N'. If i reboot at the end, the uninstall.exe will not be created because the installer wasn't completed. How can i change this?

- Im also creating some lnk's in $smstartup/$smprograms. But they dont working right. The 'target' is good $INSTDIR\app\app.exe but 'start in' is the $INSTDIR instead of $INSTDIR\app. So its missing the shortcut. Do i give the wrong parameters or something?

- BTW is it possible to execute the follow command: php -q filename.php? im using a .bat file now.

regards,

Darktrain


Re: Some questions (reboot, shortcut, exec)

Originally posted by Darktrain
Hi,

Im creating an installer using nsis and ive got a few questions.
- After installing everything I want to reboot the computer. I show a messagebox with 'reboot ok Y/N'. If i reboot at the end, the uninstall.exe will not be created because the installer wasn't completed. How can i change this?

just use
Function .onInstSuccess

MessageBox MB_YESNO "Reboot?" IDNO NoReBoot
Reboot
NoReBoot:
FunctionEnd

works in 1.90

- Im also creating some lnk's in $smstartup/$smprograms. But they dont working right. The 'target' is good $INSTDIR\app\app.exe but 'start in' is the $INSTDIR instead of $INSTDIR\app. So its missing the shortcut. Do i give the wrong parameters or something?

fore sure
:)

post the code ...

- BTW is it possible to execute the follow command: php -q filename.php? im using a .bat file now.

just use

open ".."

regards,

Darktrain

Hi crish,

Here is the code im using:
CreateDirectory "$SMPROGRAMS\Mysoft"
CreateShortCut "$SMPROGRAMS\Mysoft\Myapp.lnk"
"$INSTDIR\Myapp\Myapp.exe" "" "$INSTDIR\Myapp\Myapp.exe" 0

When i look to the properties of this lnk;
The 'target' is good $INSTDIR\myapp\myapp.exe but 'start in' is the $INSTDIR instead of $INSTDIR\app. So its missing the shortcut.

It needs some information from a ini file($INSTDIR\myapp\file.ini). For some app the code is working correct (are also need some information from a ini file).
I hope you can help me.

Regards,


To change the Directory at start in you have to use the following

SetOutPath $INSTDIR\App
CreateShortCut "$SMPROGRAMS\Mysoft\Myapp.lnk" "$INSTDIR\Myapp\Myapp.exe" "" "$INSTDIR\Myapp\Myapp.exe" 0

Because SetOutPath determinate the working directory for Shortcuts

If you need to Read from an ini file use the following

ReadIniStr $0 filename section entry

the value is stored in variable $0
when nothing is found the string is empty (taken from makensis.htm)

i hope it helps a bit


It helped. Thanks!
//Darktrain