cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
userzed
Level 3

Howto change the Product name displayed in Add/Remove programs?

How do I change the default product name that appears in the Add/Remove programs window, i.e. the displayname value in the uninstall key in windows registry?
Labels (1)
0 Kudos
(26) Replies
shankrupa
Level 3

You can update the registry entry for your product
By setting the display name for your product

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\your_productname]

"DisplayName"="Customized Display Name"

Hope this will help you
0 Kudos
MEinstaller
Level 7

What if there is no registry key created for my product. I check the [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\your_productname] and there is nothing listed for the product that I just installed.
Can I still use your suggestion of updating the registry entry if it doesn't exist?

Thanks,
0 Kudos
MEinstaller
Level 7

Nevermind I found the registry entry, it just wasn't named with the name of my application. But when I use the Registry update it does not change the name of my application in the Add/Remove programs. Should I be using something besides the update registry action? Should it be something in the postInstall? Any guidance you could provide would be appreciated.
0 Kudos
enanrum
Level 9

I use the same concept to change the icon for my uninstallers in the ARP console, you can use it for the display name:

My reg file:
[CODE]REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$V(HASHKEY)]
"DisplayName"="$V(CUSTOMDISPLAYNAME)"
[/CODE]
You can set the CUSTOMDISPLAYNAME and HASHKEY values in a Custom Action prior to the Install section in the sequence:

String displayname =  "Your Custom Name";
String installLocation = arg0.resolveString("$P(absoluteInstallLocation)");
installLocation = FileUtils.normalizeFileName(installLocation, '/');
// Product_bean is the Bean ID for the Product
// Installation Design -> Product Name -> Advanced -> Bean Id
String uid = arg0.resolveString("$P(Product_Bean.key.UID)");
int hash = installLocation.hashCode();
String uidandhash = uid + hash;

arg0.getServices().getISDatabase().setVariableValue("CUSTOMDISPLAYNAME",displayname );
arg0.getServices().getISDatabase().setVariableValue("HASHKEY",uidandhash);


Regards,
Tom
0 Kudos
MEinstaller
Level 7

Thanks for the quick reply. I tried what you suggested but I get a NullPointerException: fileName cannot be null error in my log file.
Any idea why this is happening? From looking at the code you gave me it looks like it should work. Would you need to see the log file?

Thanks
0 Kudos
enanrum
Level 9

Can you post the code you used in your Custom Action?

How are you using fileName?
0 Kudos
MEinstaller
Level 7

I used the code you posted but put in my display name. Then I selected onExecuting for the event. Maybe that's where I messed up?
Now in my events I have the following:
package com.installshield.gicu.event;

import java.io.*;
import java.net.*;
import com.installshield.event.*;
import com.installshield.event.ui.*;
import com.installshield.event.wizard.*;
import com.installshield.event.product.*;
import com.installshield.wizard.*;
import com.installshield.wizard.service.*;
import com.installshield.wizard.awt.*;
import com.installshield.wizard.swing.*;
import com.installshield.wizard.console.*;
import com.installshield.product.*;
import com.installshield.util.*;
import com.installshield.ui.controls.*;
import com.installshield.database.designtime.*;

public class InstallScript
{

public void onExecutingbean240f5a9a0fe43cf9bf12f52cc503ce76f(com.installshield.event.wizard.WizardActionContext arg0)
{
}
}
0 Kudos
userzed
Level 3

Many Thanks.

I've been looking for the longest time for a method to determine the product uninstall key. I could see that the first part of the string is the UID; did not know what the second part was until now!
0 Kudos
enanrum
Level 9

Very important to add the Custom Action in your sequences first - then add the on Executing the Custom Action to the events and then put it the code!

Are you still having issues?
0 Kudos
userzed
Level 3

Thanks.

No issues. I just wrote and tested a custom event to determine the product uninstall key using .

A lesson learned:
Place the 'get uninstall key' custom event in the Sequences view AFTER any logic to determine the install location (e.g the Destination dialog). The install location hash code (obviously) depends on the install location string value.
0 Kudos
enanrum
Level 9

Ahh...yes, the hash is based on the install location - when I said add it prior to the install section - I meant Right before it!!!

Glad it worked out for yah.
later
Tom
0 Kudos
MEinstaller
Level 7

When I try to compile it gives me errors saying that
Error in InstallScript.java on line 33: unreported exception com.installshield.wizard.service.ServiceException; must be caught or declared to be thrown
and
Error in InstallScript.java on line 33: unreported exception com.installshield.database.ISDatabaseException; must be caught or declared to be thrown

for this line of code
arg0.getServices().getISDatabase().setVariableValue("HASHKEY",uidandhash);

I didn't know that these threw exceptions, any thoughts on this?
0 Kudos
MEinstaller
Level 7

Ok I caught the exceptions that were thrown but I'm still having some issues. I can get it to compile depending where I place this action in my sequence. Although it still does not change the name in the Add/Remove programs. If I put the action down in the postInstall then I get an error on install about the registry file missing some double quotes but it looks alright to me. Does it matter where I have the Registry update action in my Install Design?
0 Kudos
enanrum
Level 9

It should compile no matter where you put it in your sequences! You must be carefull NOT to remove the Custom Action from the sequence without removing the Custom event in the Events section using the 'Event Browser' button! If you can't see your action when you click the Event Browser - let me know there is away to get it in there!

Other than that I can't see why you would be having errors!!!

All you are doing with the Custom Action is setting the 2 variables by getting the HASHKEY and DisplayName! Thats why you need to do that after the destination dialog and before the Install in the sequence! You can add your 'Windows Registry Update' to any feature! Are you getting errors in the error log?

This should work!
0 Kudos
MEinstaller
Level 7

Here is the code I used to get this to work on my machine.

public void onExecutingbean(com.installshield.event.wizard.WizardActionContext arg0) throws ServiceException, ISDatabaseException
{ String displayname = "Name I wanted displayed";
ProductService ps = (ProductService)arg0.getService(ProductService.NAME);
ps.setRetainedProductBeanProperty(ps.DEFAULT_PRODUCT_SOURCE, "bean_ID of bean you are changing", "displayName", displayname);
}

Hopefully this will help others.
0 Kudos
enanrum
Level 9

Your original question was to Change it in the Add/Remove Programs - I didn't realize you wanted it changed throughout!!! Could have answered this a few replies ago! 🙂

Yes - by changing it the way you are will change it Everywhere - not just in the Add/Rem Prog! It will also change your install location, that is if your using the default install location!

Regards,
Tom
0 Kudos
MEinstaller
Level 7

I did not notice that it changed it everywhere until you mentioned it, probably because I am not using the default install location. Now from one screen to the next in the Installer the name of the application being installed changes.

I did just want the name in the add/remove programs to change, not everything else. The solution I posted was what Macrovision support suggested I do. :confused:
Thanks for pointing out that it changes everywhere, now I'm not sure that support's solution was what I wanted.
0 Kudos
enanrum
Level 9

It has nothing to do with the default install location!! You use the ProductService to change the properties of your features components and stuff like that - when you change the displayName property using this method - you are actually changing the Name Property for the Product!!

Could you not get the reg file to work? I think this would be your best bet! What was your original reasoning for doing this anyway!!
0 Kudos
MEinstaller
Level 7

I am revisiting this issue again and was wondering if anyone had any advice for me. I am trying to use the registry entry and code that was given in the beginning of this post.

For some reason the setvariableValue does not seem to set the variables in my registry file. I get the values to come up in Message boxes during the install but the registry keys do not seem to be updated. I put $V(valuename) in the registry key that is being run by the installer. I also tried just updating a file during the install with this value and that would not work either. Any ideas????

Thanks
0 Kudos
enanrum
Level 9

Can you post your RegFile and where you are setting it!

I add my reg file by adding a 'Windows Registry Update' Action to a component. The regfile looks like this; there is more like Publisher, URLInfoAbout etc... but there's no vars with those so for your purpose:

[CODE]

REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$V(HASHKEY)]
"DisplayIcon"="$V(ICON)"

[/CODE]

Hope this helps!

Regards,
Tom

And I am setting it by adding a Custom Action in the Sequence AFTER the Destination dialog box:
    
public void onExecutingAddRemoveIcon(com.installshield.event.wizard.WizardActionContext arg0)
{
try {
String icon = arg0.resolveString("$PATH($P(AddRemoveIconFiles.absoluteInstallLocation)/TS_icon.ico)");
String installLocation = arg0.resolveString("$P(absoluteInstallLocation)");
installLocation = FileUtils.normalizeFileName(installLocation, '/');
String uid = arg0.resolveString("$P(Product_Bean.key.UID)");
int hash = installLocation.hashCode();
String uidandhash = uid + hash;

arg0.getServices().getISDatabase().setVariableValue("HASHKEY",uidandhash);
arg0.getServices().getISDatabase().setVariableValue("ICON",icon);

} catch (ServiceException se) {
arg0.logEvent(this,Log.ERROR, se.getMessage());
} catch(ISDatabaseException e){
arg0.logEvent(this,Log.ERROR, e.getMessage());
}
}

0 Kudos