tderouin
14th January 2003 20:34 UTC
Setting Default Start Menu Folder From Registry
Just a note for people who wish to read in the value of the selected start menu folder from previous installs and maybe a suggestions for the Modern UI folks, I've changed Function {$SETSTARTMENU} in Contrib/Modern UI/System.nsh to the following:
Function "${SETSTARTMENU}"
!insertmacro MUI_HEADER_TEXT $(MUI_TEXT_STARTMENU_TITLE) $(MUI_TEXT_STARTMENU_SUBTITLE)
ReadRegStr ${MUI_TEMP1} HKCU "Software\${MUI_PRODUCT}" "Start Menu Folder"
StrCmp "${MUI_TEMP1}" "" +4
StartMenu
::Select /noicon /autoadd /text "$(MUI_INNERTEXT_STARTMENU_TOP)" /lastused "${MUI_STARTMENU_VARIABLE}" /checknoshortcuts "$(MUI_INNERTEXT_STARTMENU_CHECKBOX)" "${MUI_TEMP1}"
goto donestart
StartMenu::Select /noicon /autoadd /text "$(MUI_INNERTEXT_STARTMENU_TOP)" /lastused "${MUI_STARTMENU_VARIABLE}" /checknoshortcuts "$(MUI_INNERTEXT_STARTMENU_CHECKBOX)" "${MUI_STARTMENU_DEFAULTFOLDER}"
>donestart:
Pop "${MUI_STARTMENU_VARIABLE}"
FunctionEnd
>
Joost Verburg
15th January 2003 12:35 UTC
Done :D Download the latest version from CVS and use:
!define MUI_STARTMENU_REGISTRY_ROOT "HKCU"
!define MUI_STARTMENU_REGISTRY_KEY "Software\Test Software"
!define MUI_STARTMENU_REGISTRY_VALUENAME "Start Menu Folder"
tderouin
16th January 2003 19:03 UTC
The CVS version that was packaged today on 1/16 hasn't had its Modern UI/System.nsh updated since 1/13.
I also noticed there's a bug in the code I posted if the value isn't in the registry that I'm working on fixing right now.
tderouin
16th January 2003 19:36 UTC
Here's the fixed version, for some reason there's a problem with two calls to StartMenu::Select for whatever reason.
Function "${SETSTARTMENU}"
!insertmacro MUI_HEADER_TEXT $(MUI_TEXT_STARTMENU_TITLE) $(MUI_TEXT_STARTMENU_SUBTITLE)
ReadRegStr ${MUI_TEMP1} HKCU "Software\${MUI_PRODUCT}" "Start Menu Folder"
StrCmp "${MUI_TEMP1}" "" +3
StrCpy $R0${MUI_TEMP1}
goto donestart
StrCpy $R0${MUI_STARTMENU_DEFAULTFOLDER}
>donestart:
StartMenu::Select /noicon /autoadd /text "$(MUI_INNERTEXT_STARTMENU_TOP)" /lastused "${MUI_STARTMENU_VARIABLE}" /checknoshortcuts "$(MUI_INNERTEXT_STARTMENU_CHECKBOX)" "$R0"
Pop "${MUI_STARTMENU_VARIABLE}"
FunctionEnd
>
Quarc
2nd February 2003 22:59 UTC
Hi!
hm, I'm newbie to SuperPiMPing. How exactly do I do that now? How can the installer retrieve the install dir and the Autostart folder from previous installation?
Or where do I find a hint for that?
Regards, Marc
kichik
3rd February 2003 14:00 UTC
First of all make sure you have the latest CVS version (see FAQ for details on getting it). Next, have a look in Examples\Modern UI\StartMenu.nsi. It's an example that does exactly what you are looking for.
Quarc
3rd February 2003 14:22 UTC
thanks very much!
Quarc
3rd February 2003 19:53 UTC
But somehow i dont see, how it gets the start menu position from Registry (also the install dir). An it also doesn't do it if i install it twice. The second time it doesn show the path of the first install. :-/
So how does it work?
Joost Verburg
4th February 2003 11:42 UTC
The defines are missing in StartMenu.nsi. I'll fix that.
Quarc
4th February 2003 20:08 UTC
thanks, works now.