Skip to content
⌘ NSIS Forum Archive

WriteINIStr for URL link

7 posts

Mark Beckwith#

WriteINIStr for URL link

First of all, let me say how overjoyed I am now that I am
using NSIS. I did more with NSIS in 2 days than I was able
to do in months with InstallShield. And the installation is
1/2 the size! I keep thinking I forgot to add something.

Anyway, there is obviously something I'm conceptually
missing. I took the makensis.nsi script and hacked away on
it until I had it working with our much simpler
installation. Everything works fine but:

I have this in my nsi script:

SetOutPath $INSTDIR

WriteINIStr "$SMPROGRAMS\Intrig Insight\Intrig Online.url" \
"InternetShortcut" "URL" "http://www.intrig.com/"

That is, I want to add a link to my company's home page.
After installing, I click on the shortcut, and I get a
windows error:

"The address at 0x32452434 cannot be written" (or something
like that). And then the explorer bar goes away and I have
to logout and log back in to get it to work again. Not
exactly an ideal user experience!

Could you tell me what I'm missing. Looks like a newbie
error to me. If you need more info please don't hesitate to ask.

Thanks,

Mark
Joel#
I don't know maybe: "http://www.intrig.com" (without the "/")
I don't see way isn't work, the script is fine.
maybe the "\" in your script....
Mark Beckwith#
Sure. I made a .url file on the desktop and it works fine.

Now, when I did a search on "Intrig Online", it turned up nothing. So I guess the url file is not being created. Do I have to create the INI file somewhere in my script?
ramon18#
Try this simple script and tell us the result,
this script just generate one url on your desktop

Name TestURL
OutFile TestURL.exe


Section XDummy

SetShellVarContext all
WriteIniStr "$DESKTOP\TestURL.url" "InternetShortcut" "URL" "http://nsis.sourceforge.net/"

SectionEnd
Btw: this seams to be a shell problem of your box, you can use notepad and open the "TestURL.url" and see if the contents is valid, for me is:


[InternetShortcut]
URL=http://nsis.sourceforge.net/


Cyas
Mark Beckwith#
The above script works fine. The problem occurs when I try to writeINIStr to the shortcut in the start menu. The url file gets created in the current user, but I get the "Cannot read address 0x00000000" error when I click on it. And I noticed that if I click on the Start>Programs>NSIS>NSIS Development Site, I get the same error. So it looks like there is something wrong with my machine setup.