Archive: CreateShortcut problem with slashes


CreateShortcut problem with slashes
My .nsi file has a fairly long CreateShortcut command that looks like this:

CreateShortCut "$SMPROGRAMS\${METRO_SHORTCUT_FOLDER}\SAPR 2002\${EXTRACTION_SHORTCUT}.lnk" 'Apps\Microsoft Office\Office10\MSACCESS.EXE" "C:\APPS\Metro\SAPRPgm02\SAPRPgm02.mdb" /wrkgrp "\\corp.metro.ca\apps\data\MSP_NPM\SAPR\SAPRSec.mdw' '/cmd EXTRACTION' "$INSTDIR\SAPRPgm02_extract.ico" 0

After installation, my shortcut ends up having following TARGET:

"C:\Apps\Microsoft Office\Office10\MSACCESS.EXE" "C:\APPS\Metro\SAPRPgm02\SAPRPgm02.mdb" \wrkgrp "\corp.metro.ca\apps\data\MSP_NPM\SAPR\SAPRSec.mdw" /cmd EXTRACTION

Notice there are two problems:
1) It's supposed to have /wrkgrp but after installation, it gets \wrkgrp. In my script I have a forward slash, yet a backward slash gets copied.

2) Immediately after that, the shortcut ends up copying \corp.metro.ca, but in my script I clearly wrote \\corp.metro.ca. There's a missing slash.

Am I writing my script wrong?

Thanks in advance,

Ray


First off, CreateShortCut just calls the windows shortcut api without touching the strings, so if there is a problem, you either formated the parameters wrong or windows itself is changing things!

I don't like that relative path you have there, but the problem is probably that you put the command and parameters in the same string, try CreateShortCut "$SMPROGRAMS\${METRO_SHORTCUT_FOLDER}\SAPR 2002\${EXTRACTION_SHORTCUT}.lnk" '"Apps\Microsoft Office\Office10\MSACCESS.EXE"' '"C:\APPS\Metro\SAPRPgm02\SAPRPgm02.mdb" /wrkgrp "\\corp.metro.ca\apps\data\MSP_NPM\SAPR\SAPRSec.mdw" /cmd EXTRACTION' "$INSTDIR\SAPRPgm02_extract.ico" 0

And if you can, you really should specify the full path to MSACCESS.EXE


Thanks Anders,

That did the trick. I did not realize I was placing the command and the parameters in the same string. I learned something.

Thanks !