cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
drostowsky
Level 5

Name for start menu folders on Windows?

On Windows, where does the start menus folder name come from? I'd like to modify it in code to uniquely identify it when someone does a multiple installation of our product (for example). Not sure how to do that in code.

Thanks
Dave
Labels (1)
0 Kudos
(7) Replies
jweiskoff
Level 2

Looks like it's the [ProgramMenuFolder] property based on digging in the Direct Editor's Directory Table.
0 Kudos
drostowsky
Level 5

From observation, it seems to be coming from the displayName of the feature. However, when I update the features displayName in code, it doesnt seem to work that way if the user doesnt install the product in the default suggested destination path.

In my products onBeginInstall() method I have code like this to set the features name:

String sBeanId1 = arg0.getServices().resolveString("$P(feature1.beanId)");    

String sDisplayName = "NewFeatureName";

productservice.setProductBeanProperty(ProductService.DEFAULT_PRODUCT_SOURCE, sBeanId1, "displayName", sDisplayName);


Everything works well if the user accepts the default installation path of:
"C:\program files\my company\NewFeatureName"

That is, the Start menu has a folder called "NewFeatureName" post-install.

However, if the user changes the destination directory to "c:\temp" for example, the start folder comes out as "FeatureName" (i.e. the original feature name set in ISMP's GUI).

Am I not setting the feature name correctly?
0 Kudos
drostowsky
Level 5

jweiskoff wrote:
Looks like it's the [ProgramMenuFolder] property based on digging in the Direct Editor's Directory Table.

Thanks, but how do I update that guy in code then?
0 Kudos
enanrum
Level 9

Am I missing something here! When you say add to the Start Menu - are you not adding an Icon to the Start Menu and isn't the name set in the icon action?

I'm confused as to what you are trying to do! Are you trying to change the actual Product Name!!!
0 Kudos
drostowsky
Level 5

What Im trying to do is handle the situation where someone installs our product twice on Windows machines, but in different directories. When the user finishes the installation, they go to the Windows Start button > All Programs. Normally, they would see a folder called "My Product" listed twice (I cant remember if it does this or the second install just plows over the folder of the first which is really bad too). I want them to have unique names "My Product 1" and "My Product 2"
0 Kudos
enanrum
Level 9

Ok let me get this straight!

If they reInstall your product to a different directory - you want to change the name to NewProductName on the new path! If they are installing it to a different directory why are you changing the name, it's not going to overwrite the original - it's going to a different directory!!! But that's OK if you just want to differentiate the 2!

You have to be adding an Icon to the start menu! If I'm understanding what you are trying to do, you want a seperate icon for each install!!! What are you using for the parameters for this Icon! I think that is where your problem is! You add the Icon Action and give the properties to the Icon! You give it the Folder, Name and Target! I think if you just need to use a Variable for the Name property of the icon - say $V(ICONNAME) - and update the variable in the Custom Action it shouldn't clobber the old one!

I do not know how this will affect Uninstallation with the VPD where you will have basically 2 of the same product on the system with the same UUID's!!!! I think it will uninstall 1 and the uninstall of the original may fail to uninstall it!!! I dont know!

Hope this helps,
Tom
0 Kudos
drostowsky
Level 5

Thanks! I was able to successfully use $V(ICONNAME) for the "Folder" property in my shortcut. I set the variable name in code in the onBeginInstall() method for my product.

i.e. arg0.getServices().getISDatabase().setVariableValue("ICONNAME", myString);
0 Kudos