Archive: startup


startup
Hi,

Just started using NSIS, and it's really great. I learned 90% of what I needed in 10 minutes. Now I spend days to tweak everything "just right" including icons in the correct number of bits etc.

I have a question about using $SMSTARTUP, my script results in "Error creating shortcut: C:\Document and Settings......".

I have written that part of the script as:

CreateShortCut "$SMSTARTUP\myapp.lnk /nw" "$INSTDIR\myapp.exe" "" "$INSTDIR\myapp.exe" 0

What is wrong?


/nw args is not allowed in the shortcut math !
Use it as the trirg argument of the function (as long as i could remember... this is the 3rd) ;)


Actually, even if I make it simpler by writing

CreateShortCut "$SMSTARTUP\myapp.lnk" "$INSTDIR\myapp.exe"

it still doesn't work. Same error, and won't show up in startup. Weird.


Put a message box before the CreateShortcut line that will show you the $SMSTARTUP variable, and post here what it showed.


In fact, now when I rewrite it as
CreateShortCut "$SMSTARTUP\myapp.lnk" "$INSTDIR\myapp.exe" "/nw"
it works fine, even though the manual says
>>>start_options should be one of:SW_SHOWNORMAL,SW_SHOWMAXIMIZED,SW_SHOWMINIMIZED, or an empty string.

Why is there a 2nd repetition of the target file in example2.nsi?
CreateShortCut "$SMPROGRAMS\Example2\Example2 (notepad).lnk" "$INSTDIR\notepad.exe" "" "$INSTDIR\notepad.exe" 0

Seems to correspond to where the icon file should go, but the icon is correct also w/o it.


start_options is the 6th parameter. Your "/nw" is the parameters, command line arguments. In example2.nsi the second notepad.exe is just there to show how to set the icon. You can set it to something else too, myicon.ico for example.