Archive: Start Menu Folder Problem


Start Menu Folder Problem
The first version of my program was 1.0.0

So I did this:

!define VERSION "1.0.0"

This writes
MyProgramName 1.0 to the following key
HKEY_LOCAL_MACHINE\SOFTWARE\MyProgramName
string: Start Menu Folder
value: MyProgramName 1.0

Now when I change to this
!define VERSION "1.1.0"

All the install dialogs say 1.1.0 except
the "Choose Start Menu Folder" dialog. It still displays
MyProgramName 1.0

from the first install

Do I have to change this registry entry on every install(update)?
If so how?

or another option


this too
Here's what I have for the pages

;Start Menu Folder Page Configuration
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\MyProgramName"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"

I'm not even sure why or how the version number shows up in this registry entry, because the shortcuts don't show it.

?


You have configured the Start Menu Folder Page to remember the last used Start Menu Folder. I recommend you not to add a version number to the folder name.


where am I adding a version to the folder name?
or do you mean program name?

Becauase I do have this:

;Configuration

;General
!define VERSION "1.1.0"
Name "MyProgramName ${VERSION}"


Man How do I get rid of this!
I am trying to delete that first install version number on subsequent installs but can't even delete it using:

;Start Menu Folder - this can be removed later
WriteRegStr HKLM "SOFTWARE\MyProgramName "Start Menu Folder" "MyProgramName" //instead of "MyProgramName 1.0"


Totally lost now
I have deleted the key manually

DeleteRegKey HKLM "SOFTWARE\MyProgramName" //which had MyProgramName 1.0

and it still shows up in "Chose Start Menu Folder" !!!????

I have searched the registry for this and can't find it! Where is it getting it from?


It really gets it from the key you have set in your script.

If you have not set MUI_STARTMENUPAGE_DEFAULTFOLDER it will use the name.


But I don't have version or 1.0 used anywhere in the script.

??


So its not in the script and its not in the registry.

??


Should I change it to this?

;Start Menu Folder Page Configuration
!define MUI_STARTMENUPAGE_DEFAULTFOLDER
;!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
;!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\MyProgramName"
;!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"


but then there would be no option on a first time install right?


Really, it does not make up that name itself :) It uses the key you have defined in your script.

If you want your installer to remember the last folder, you should keep the registry settings.

By default, the default folder uses the name set using the Name command. You have added a version number to that one, so you will have to use MUI_STARTMENUPAGE_DEFAULTFOLDER if you don't want the version number.

So you should use these settings:
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "MyProgramName"
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\MyProgramName"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"


OK back to square one now
I tried that and it doesn't remove the version number even when I removed the version number from the name. How do I remove the version number (or update it to newer one) for the "Choose start menu folder" dialog on subsequent installs?

Or there is really no way to remove this value on installs after the original one?

Unless it is uninstalled and then the corrected one (your example) is installed later?

Another thing I mentioned earlier that I don't understand is why does the start menu not have the 1.0 on mine like Microsoft Visual Studio 6.0 has its version number on the menu? It just shows up in the install "Chose Start Menu Folder" dialog.


It uses the default name if there is no name in the registry key. After you have completed an installation with a new folder name, it will use that name

If you always want a version number and you don't want it to remember anything, you don't have to use these settings.


Not in my world
Lets strike your first sentence and say its moot because perhaps 200 people have installed my 1.0.0 version program

Now, I put the example you gave me in 1.1.0
and remove the version from the program name.

The first time that 1.1.0 is installed, I get:
"Chose Start Menu Folder" MyProgramName 1.0

The second time I install it I STILL get:
"Chose Start Menu Folder" MyProgramName 1.0

Why isn't your second sentence true regarding my above example?
Or am I misunderstanding again?

How do change the installer to get this:
"Chose Start Menu Folder" MyProgramName.

?


If you remove the registry setting, it will never use the registry name anymore.

If you have set a registry key, it will always use the last value. If you have changed the name and completed the installation, it will use the new name.


Going in circles now I think
I tried to delete it, that was one of my previous questions........

I put this in a section:
DeleteRegKey HKLM "SOFTWARE\MyProgramName"

This has the "Start Menu Folder" string with data "MyProgramName 1.0"

after the 1.1.0 install is run, This key is gone. yea!

the second time the 1.1.0 insatll is run, it puts it back in somehow
when I am NOT using the version as part of the Name and the text "1.0" is no where in my script! no where.

so where is it getting it from now?


Remove MUI_STARTMENUPAGE_REGISTRY_ROOT etc. and it will never remember a folder name.


strange, interesting, and it gets the result i need. !! yea

but i would have thought that leaving in the surrounding defs:
MUI_STARTMENUPAGE_DEFAULTFOLDER and MUI_STARTMENUPAGE_REGISTRY_KEY
would cause problems.

I still don't understand how anyone would ever update a Start Menu Folder with a version number.

But at least my problem of showing the old incorrect one on new installs is solved.

Thanks for the persistant help.


You don't seem to get the point of using the registry setting.

You only need MUI_STARTMENUPAGE_REGISTRY_KEY if you want it to remember the previous preference. For example, if the user wants to put your shortcuts in AAA instead YourApp and runs the installer again, AAA will still be the default setting.

It shows the previous number because that was the stored folder. You could add some string parsing that will increase the stored version number, but that will give some problems, since the user can choose any format (like "My App 1.0 - Second Install", "1.0 My App" etc.).