Old 2nd May 2011, 05:55   #1
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
ARP registry - quotes or no quotes

This has bothered me for some time now. In the wiki: http://nsis.sourceforge.net/Add_unin...emove_Programs
Some guy says that "you should always quote the path to make sure spaces in the path will not disrupt Windows to find the uninstaller." So the wiki example ends up with this:
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\ImageMaker" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""

As far as I can judge this is just plain wrong. I never quote the path, and it works just fine. Is there some legacy reason why one would add quotes to the regstring? Because if not, I'm going to delete this erroneous info from the wiki.
MSG is offline   Reply With Quote
Old 2nd May 2011, 08:51   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You should add quotes in case the path contains spaces. ExecWait in the docs explains why.

Stu
Afrow UK is offline   Reply With Quote
Old 2nd May 2011, 09:57   #3
Smurge
Junior Member
 
Join Date: Apr 2008
Posts: 21
Windows itself does not need any "" on path or any value in the registry, as far as i know.

I have tested an installation without "" after the "InstallPath" and used ()+´á# and space in the install path. It deinstalled without error.
Maybe it depends on the app itself if "" is needed or not. e.g. for switches or functions of the .exe!?

ExecWait starts an application outside the installer. This have nothing to do with the Registry entry.
I guess it need quotesin this case, because it calls the .exe similar as cmd.exe does...

bye
Smurge is offline   Reply With Quote
Old 2nd May 2011, 10:27   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
Quote:
Originally Posted by Smurge View Post
Windows itself does not need any "" on path or any value in the registry, as far as i know.
You know this is not true, but lets stick to uninstall in this thread...

Quote:
Originally Posted by Smurge View Post
I have tested ...
But did you test on Win95 and NT4? I'm sure it tells you to use quotes for a reason.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 2nd May 2011, 10:35   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Add/remove programs handles the path fine on newer OSs with or without quotes probably because it has to deal with the people who have not used them. But one issue goes to your own installer which may want to read the registry value to uninstall a previously installed version. If you've missed quotes from the path and then add /S, it could fail.

Quote:
ExecWait starts an application outside the installer. This have nothing to do with the Registry entry.
Well of course, but ExecWait uses the CreateProcess API which recommends you should use quotes:
Quote:
If you are using a long file name that contains a space, use quoted strings to indicate where the file name ends and the arguments begin; otherwise, the file name is ambiguous. For example, consider the string "c:\program files\sub dir\program name". This string can be interpreted in a number of ways. The system tries to interpret the possibilities in the following order:

c:\program.exe files\sub dir\program name
c:\program files\sub.exe dir\program name
c:\program files\sub dir\program.exe name
c:\program files\sub dir\program name.exe
Stu
Afrow UK is offline   Reply With Quote
Old 2nd May 2011, 10:42   #6
Smurge
Junior Member
 
Join Date: Apr 2008
Posts: 21
Quote:
But did you test on Win95 and NT4? I'm sure it tells you to use quotes for a reason.
ähm, i tested it on 98SE. I thought this is the oldest version anyone will use... but maybe im wrong
Smurge is offline   Reply With Quote
Old 2nd May 2011, 10:50   #7
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Quote:
Originally Posted by Smurge View Post
ähm, i tested it on 98SE. I thought this is the oldest version anyone will use... but maybe im wrong
You're arguing with Microsoft, not us lol.

Stu
Afrow UK is offline   Reply With Quote
Old 2nd May 2011, 17:56   #8
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Stu, thanks for clearing that up, I had not thought of the parameter ambiguity problem. And even without params, if it's officially required by MS then the wiki info is technically correct.
MSG is offline   Reply With Quote
Old 2nd May 2011, 19:41   #9
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
I could not actually find MS docs that state that the path should be quoted but MSDN is 2000+ these days, and the uninstall info is MSI specific

IntOp $PostCount $PostCount + 1
Anders 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