Archive: Problem with CreateShortCut pointing to Internet pages


Problem with CreateShortCut pointing to Internet pages
I have a problem with the following snippet:

CreateShortCut "$SMPROGRAMS\QuantLib\QuantLib Home Page.lnk" \
"http://quantlib.org/index.html"

When I use the startup menu entry "QuantLib Home Page" I get the followig error:
"The file or folder 'quantlib.org/index.html' that this shortcut refers to cannot be found"

I get the same error with the NSIS installer itself, as it adds a shortcut to the NSIS Home Page that results in:
"The file or folder 'nsis/' that this shortcut refers to cannot be found"
That shortcut is generated by the following snippet in makensis.nsi:

CreateShortCut "$SMPROGRAMS\NSIS\NSIS Home Page.lnk" \
"http://www.nullsoft.com/free/nsis/"

thank you in advance for your help

ciao -- Nando


how very curious.. this works under win2k, but not '98. The easiest solution I could find was to change the likn to `start internet_address`.. BUT, then you dont get the nice icon, and you get a console pop up, which I hate. So you could include .url files in the installer.

.url files take the format..

[InternetShortcut]
URL=url_goes_here

e.g.
[InternetShortcut]
URL=http://www.incomplete.co.uk/nsis.htm

However, a more desirable solution is to generate these files at run time. Please feel free to use the below script, and please say if you find it useful..

The delete part is so that an existing link is removed as WriteINIStr concentates enntries/.. while this is not a problem in itself, the user doesn't want to end up with a potential infinitely sized file after an infinite number of installs..

; file name of URL (_MUST_ be full path otherwise it will be created int he windows directory).
strcpy $0 "C:\programs\nsisdll\examples\test.url"

Delete $0
WriteINIStr $0 \
"InternetShortcut" "URL" \
"http://www.incomplete.co.uk/nsis.htm"


This works in Win98 and WinME, it might just be your computer. Everything works. And the .url thing will work, but so will the .lnk files. What version of Win32 are you using, and it might be done with/without simple fixes.

-DJ


It doesn't work on my Win98 computer, but I know how to create these files with NSIS on the fly:

WriteINIStr "$SMPROGRAMS\Freenet\FN Homepage.url" "InternetShortcut" "URL" "http://www.freenetproject.org"

Should do the trick...


It doesn't work on my Win98 either.. spaetz.. errm, of course you know how to do it, I just posted that method earlier.


oops, I though you had just described the file format and didn't read the post thoroughly enough, my bad. Sorry :-)


Well, I will tell you, it does work for my Win98 and WinME computers. It may just be your guys' computers.

-DJ


"It may just be your guys' computers." - Win98 comes in several builds, especially once you get installing different internet explorers. It is not my computer, as under win2k pro build 2195 rc3 (final), it works fine.


Problem solved
Thanks to all who replied.

I solved the problem thanks to your suggestions. Now the QuantLib open source project ships with the Null Soft Installer (http://quantlib.org). Here's a snippet from the .nsi file:

#it doesn't work
# CreateShortCut "$SMPROGRAMS\QuantLib\QuantLib Home Page.lnk" \
# "http://quantlib.org/index.html"
#this works
WriteINIStr "$SMPROGRAMS\QuantLib\QuantLib Home Page.url" \
"InternetShortcut" "URL" "http://quantlib.org/"

I'm using this on WinNT4 patch 6a.

Since the problem was also with NSIS itself anybody knows how to report this problem to the NSIS developer(s)?

I would also like to add QuantLib to the list of NSIS users at http://www.nullsoft.com/free/nsis/users.html, but I don't know any email address I could use to this effect.

I haven't understood what pwj62 wrote:
> The delete part is so that an existing link is removed as
> WriteINIStr concentates enntries/.. while this is not a problem in
> itself, the user doesn't want to end up with a potential infinitely
> sized file after an infinite number of installs..
>
>; file name of URL (_MUST_ be full path otherwise it will be
> created int he windows directory).
> strcpy $0 "C:\programs\nsisdll\examples\test.url"
> Delete $0
> WriteINIStr $0 \
> "InternetShortcut" "URL" \
> "http://www.incomplete.co.uk/nsis.htm"

what's about the delete part? Sorry if this is a naive question.


forgot to say I was using NSIS 1.44

Now updating to 1.55

ciao -- Nando


Re: Problem solved

Originally posted by ametrano
.................

I would also like to add QuantLib to the list of NSIS users at http://www.nullsoft.com/free/nsis/users.html, but I don't know any email address I could use to this effect.
email justin (he's at Nullsoft)