PDA

View Full Version : Howto change the Product name displayed in Add/Remove programs?



userzed
01-06-2006, 04:56 PM
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?

shankrupa
01-20-2006, 01:17 AM
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

MEinstaller
10-25-2006, 08:05 AM
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,

MEinstaller
10-25-2006, 08:14 AM
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.

enanrum
10-25-2006, 09:52 AM
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:

REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$V(HASHKEY)]
"DisplayName"="$V(CUSTOMDISPLAYNAME)"

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

MEinstaller
10-25-2006, 10:42 AM
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

enanrum
10-25-2006, 10:47 AM
Can you post the code you used in your Custom Action?

How are you using fileName?

MEinstaller
10-25-2006, 10:51 AM
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)
{
}
}

userzed
10-25-2006, 11:15 AM
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!

enanrum
10-25-2006, 11:17 AM
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?

userzed
10-25-2006, 11:38 AM
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.

enanrum
10-25-2006, 11:42 AM
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

MEinstaller
10-25-2006, 02:59 PM
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?

MEinstaller
10-26-2006, 07:48 AM
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?

enanrum
10-27-2006, 10:25 AM
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!

MEinstaller
10-30-2006, 08:55 AM
Here is the code I used to get this to work on my machine.

public void onExecutingbean<bean_name>(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.

enanrum
10-30-2006, 10:03 AM
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

MEinstaller
10-30-2006, 11:43 AM
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.

enanrum
10-31-2006, 12:00 PM
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!!

MEinstaller
07-09-2007, 07:27 AM
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

enanrum
07-15-2007, 09:42 PM
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:




REGEDIT4

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



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());
}
}

MEinstaller
07-16-2007, 10:20 AM
I am setting the Registry values using the following code which is in my .reg file in one of my components.

Windows Registry Editor Version 5.00

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



This is the code I have for setting the variables which is directly after the Destination dialog.

public void onChangingDisplayName(com.installshield.event.wizard.WizardActionContext arg0)
{
try {
String displayname = "DeleteMe 3.4.3";
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(bean25757.key.UID)");
int hash = installLocation.hashCode();
String uidandhash = uid + hash;

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


JOptionPane.showMessageDialog( null, "Your value: " + displayname);
JOptionPane.showMessageDialog( null, "Your value: " + uidandhash);
} catch(ISDatabaseException se) {
System.out.println(se.getMessage());
} catch(ServiceException s) {
System.out.println(s.getMessage());
}
}

I have once again been talking to support about this issue I am having but they are not much help.:o

The message dialogs report back the correct information, it seems from there on that there is a disconnect.

enanrum
07-16-2007, 03:26 PM
You need to use:

'REGEDIT4'

The update registry does not work with 'Windows Registry Editor Version 5.00'

Tom

MEinstaller
07-16-2007, 04:10 PM
Actually it does, at least from my experience. I just tested this using both types of reg files and it acted the same way using both files. I think my problem is that the DisplayName is updated during the creation of the uninstaller or something like that, because I can update all of the other fields in the registry like icon, version, etc. but not the DisplayName.

I was trying to update the DisplayName to include the version but I may have to settle for just putting the version information in separately unless there are any other ideas.

Thanks for your help Tom it is much appreciated.

enanrum
07-18-2007, 09:44 AM
Hmm..that is correct, the last thing the Install section of the sequences does is create the uninstaller, then goes to the post install section in the sequence.

Maybe you can add another .reg file in the Support Files and run an Execute Process to manually run the .reg file!

Another option could be to change the DisplayName using a 'Set Product Bean Property' in the sequence just prior to the Install section and change it back in the Post Install Section- although you may see the new name being displayed in the Progress Dialog!

I have not tried that, just rambling here! Have no idea how the uninstaller maybe affected either!

Regards,
Tom

Pallavi.Agrawal
01-27-2012, 01:54 AM
Hi all,

I created a setup which is working Fine.

In this setup, application name was "ABC".

Now I created another setup having same no of file which were in previous setup.

The change is: in previous setup, name of exe file is "ABC.exe". And in this setup I changed the product name from "ABC" to "DEF" and exe file name is now "DEF.exe". I didn't change the Product code and even I don't want to change it.

Now whenever Old application is installed on user's machine and he/she install new one without uninstalling previous then at that time there is an Upgrade dialog come to user (Its fine behavior just as i want). But whenever user upgrade an application at that time nothing is getting changed. All things event desktop shortcut of the application are of the old version. I want to upgrade all old files and shortcuts by new one.

Please Help Me........:confused: :confused: :confused:



Thanks and regards,
--
Mohit Patel

enanrum
01-27-2012, 09:21 AM
Try changing the "Replace Option" to always Replace for the main feature(s) and change all others to "Default"