View Single Post
Old 1st October 2010, 21:14   #15
gpicazo
Junior Member
 
Join Date: Oct 2010
Posts: 1
Please help

---------
EDIT:
Sorry, I figure it out. I must be having a slow day to not realize the last 2 lines in the example where explaining how to check if the command was successful.

Thank you anyway.
---------





Hi,

I am still relatively new to NSIS, so I am not sure I understand how to use plugins.

I downloaded the ShellLink Plug In from: http://nsis.sourceforge.net/ShellLink_plug-in

I unzipped it and copied the ShellLink.dll file to Program Files\NSIS\Plugins.

Trying to follow the example on the plugin page, I then modified a part of my script from:

...
CreateDirectory "$STARTMENU\Programs\${PRODUCT_PUBLISHER}"
CreateShortCut "$STARTMENU\Programs\${PRODUCT_PUBLISHER}\${PRODUCT_NAME}.lnk" "$INSTDIR\${PRODUCT_NAME}.exe"
...

to

...
CreateDirectory "$STARTMENU\Programs\${PRODUCT_PUBLISHER}"
CreateShortCut "$STARTMENU\Programs\${PRODUCT_PUBLISHER}\${PRODUCT_NAME}.lnk" "$INSTDIR\${PRODUCT_NAME}.exe"

ShellLink::SetRunAsAdministrator "$STARTMENU\Programs\${PRODUCT_PUBLISHER}\${PRODUCT_NAME}.lnk"
Pop $0

$0=0 -no errors
$0=-1 -error
...

That causes the following error when I try to compile my script:


Plugin Command: SetRunAsAdministrator $STARTMENU\Programs\Sharp Software\Auto Sales Manager WPF Server.lnk
Pop: $0
Invalid command: $0=0
Error in script "C:\Sharp Software\Auto Sales Manager\trunk\build\scripts\Auto Sales Manager WPF Server.nsi" on line 82 -- aborting creation process


Any help getting this to work would be greatly appreciated.

Last edited by gpicazo; 1st October 2010 at 21:18. Reason: Solved it
gpicazo is offline   Reply With Quote