Archive: Partial selection & instdir autodetect


Partial selection & instdir autodetect
Bwahahahah, more newbie questions...
I'm working on another installer, but there's an odd "bug". When a subsection has one section disabled and readonly and another section enabled, the subsection can appear either partially enabled or fully enabled; i.e. here:
Subsection
-Off (readonly)
-On
the subsection can appear either fully enabled or partially enabled. Now, this wouldn't really be a problem, except for that I want the subsection to be disabled after the user clicks on it when it's components are enabled. (That and it looks rather odd.) My question is, what flag defines partial selection?

Also, how do I autodetect the Winamp install directory? I want to be able to detect Winamp 2.x's or, if 2.x isn't there, Winamp 3's install directory, on different Windows platforms (which, as far as I can tell, changes the location of the registry keys).

I searched the forum on this and nothing came up, so sorry if any of it's been brought up before. Attached is the


Please post that bug report in SF.

You should implement the logic to $INSTDIR in .onInit using ReadRegStr, StrCmp and friends.


umm...that's the problem...i dunno how (what keys to read etc.)


Try their uninstall key, maybe you can find some useful information there.


yes, i know, but it's location changes with the windows version, doesn't it?


Nope, it's always HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall. You can also use HKCU but that's another story.


mm...i bet i've been checking hkcu.
so when i read hklm\software\microsoft\windows\currentversion\uninstall\winamp\uninstallstring, do i get "blablabla\winamp\uninstallwa.exe" or just "blablabla\winamp\"?

as for the "bug", IS there any flag that defines a partial selection?


You'll get the uninstaller path, possibly quoted with parameters so you should parse it.

There is no such flag, it's auto processed and as you can see it's auto processed the wrong way so a bug report is in place ;)


KiCHiK: NSIS is supposed to be a Winamp Plugin installer. How do you want to do that when you don't know where Winamp is? Weird! :weird:


NSIS is an all-around installer, not just for Winamp plugins. Just thought I'd point that out...

When making an installer for a Winamp plugin, I suppose the author of the script will have to insert some function that will auto-search for the Winamp dir, no?


That's what bothers me:

Originally the second line of the documentation of NSIS
NSIS exists largely because of the need to distribute Winamp.
Originally the fifth paragraph of the documentation of NSIS
Another thing we needed was a good way to distribute Winamp plug-ins.
And now you're telling me that NSIS doesn't even know where Winamp is? That's weird, very weird for an installer that only exists because of Winamp. I know, nant, that NSIS is primairly ment to install somewhat about everything, but... you know.:blah:

Changes in latest CVS version:

Rewrote a lot of the components tree code:
- Added SF_PSELECTED for partially selected sub-sections
- SF_EXPAND now refreshes the components tree
- Fixed problems with sub-sections with RO sections as children
- (-1) sent to .onMouseOverSection when mouse over nothing
- RO sections can now be in InstTypes too (default to old behavior)
- Optimized code