Old 10th November 2006, 00:42   #1
nowvox
Junior Member
 
Join Date: Nov 2006
Posts: 2
CreateShortCut Compile Error when using User Variables

I'm having an issue when trying to create a short cut. I'm using this function to split the contents of HKCR "HTTP\DefaultIcon". The output is then being used in the CreateShortCut function. My code is below:

code:

ReadRegStr $0 HKCR "HTTP\DefaultIcon" ""
Push ","
Push $0
Call SplitFirstStrPart
Pop $R0 ; Contains path to default browser
Pop $R1 ; Contains icon index

CreateShortCut "$SMPROGRAMS\MyApp\My Link.lnk" "http://localhost/" "" $R0 $R1



Used in this way, NSIS throws an error when it gets to this line. However, if I take out $R1 and replace it with a number then the compile is successful. Ex.

This works:
code:

CreateShortCut "$SMPROGRAMS\MyApp\My Link.lnk" "http://localhost/" "" $R0 1



Just to check that $R1 does in fact contain the icon index I put the output in a message box and it was correct. I'm stumped on this one. I've tried everything I can think of. I'd just leave it hardcoded to 1 if I could but the icon index for IE is 0 and for FireFox it is 1. I don't know what it is for Opera, etc. and that's why I chose to use the DefaultIcon string from the registry.

Any help with this would be extremely appreciated.

Thanks,
-Chris
nowvox is offline   Reply With Quote
Old 10th November 2006, 05:44   #2
bholliger
Senior Member
 
Join Date: Jul 2004
Location: Switzerland
Posts: 223
Hi Chris!

Due to the fact that you're about to create an internet shortcut I suggest creating an url-file. As far as I know the result of the shortcut-creation-process in the Windows Explorer is an url-file as well.

Have a look:

http://nsis.sourceforge.net/CreateIn...o_%26_function

Have a nice day!

Cheers

Bruno
bholliger is offline   Reply With Quote
Old 13th November 2006, 18:20   #3
nowvox
Junior Member
 
Join Date: Nov 2006
Posts: 2
Thanks Bruno!

Your suggestion worked. I still think this may be a bug in the compiler and I'll put some data together and post it in the bugs db on sourceforge.

Thanks again,
-Chris
nowvox is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump