- NSIS Discussion
- ARP registry - quotes or no quotes
Archive: ARP registry - quotes or no quotes
MSG
2nd May 2011 06:55 UTC
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.
Afrow UK
2nd May 2011 09:51 UTC
You should add quotes in case the path contains spaces. ExecWait in the docs explains why.
Stu
Smurge
2nd May 2011 10:57 UTC
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
Anders
2nd May 2011 11:27 UTC
Originally posted by Smurge
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...
Originally posted by Smurge
I have tested ...
But did you test on Win95 and NT4? I'm sure it tells you to use quotes for a reason.
Afrow UK
2nd May 2011 11:35 UTC
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.
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:
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
Smurge
2nd May 2011 11:42 UTC
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 ;)
Afrow UK
2nd May 2011 11:50 UTC
Originally posted by Smurge
ä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
MSG
2nd May 2011 18:56 UTC
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.
Anders
2nd May 2011 20:41 UTC
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 :(