PDA

View Full Version : BUG! DisplayName (uninstall name) broken



timelox
11-04-2003, 03:13 AM
In my Dev8 scripts the below method got called in the OnFirstUIAfter or OnRebooted event depending on the flow of things:

RegDBSetItem(REGDB_UNINSTALL_NAME, szUninstallName);

The reason was to change the name displayed in the "Add/Remove Programs" control panel applet.

In DevStudio 9 this call do not change anything. In the help file for DevStudio 9 it also mentions an "easier way" to change the display name and that is to change the value of the internal variable "UNINSTALL_DISPLAYNAME". There is also a note that this variable must be changed before the moving of files start.

So...I change that variable in the OnFirstUIBefore event. BUT the display name is still unaltered.

DevinEllingson
11-04-2003, 03:23 PM
timelox,

The help is inaccurate, UNINSTALL_DISPLAYNAME applies only to InstallScript MSI projects, not InstallScript, so changing it in this type of project will have no effect.

Calling RegDBSetItem will change the display name, but you must do it AFTER calling MaintenanceStart as MaintenanceStart automatically updates the registry value to IFX_PRODUCT_NAME when called. (MaintenanceStart is called in OnMoveData).

You could also change IFX_PRODUCT_NAME which should cause MaintenanceStart to set the name you expect.

As far as OnRebooted, you will need to call RegDBSetItem manually in OnRebooted if you want to change this after reboot.

Devin Ellingson
InstallShield Software Corporation

timelox
11-05-2003, 02:29 AM
Hmm...have you tried changing the UNINSTALL_DISPLAYNAME for an InstallScript project?

I ran a few tests yesterday and found out that:

1. Calling RegDBSetItem(REGDB_UNINSTALL_NAME, szUninstallName); do nolonger work for InstallScript projects. I have called this function in the OnFirstUIAfter or OnRebooted events (depending if the script needed to reboot or not) in scripts created in Dev7 and Dev8 and it worked perfectly. But with DevStudio 9 it do nolonger work. You say that it should work but it do not work in my DevStudio 9 InstallScript projects.

2. Changing the UNINSTALL_DISPLAYNAME variable in the OnFirstUIBefore (i.e. before any moving of files start) will actually change the DisplayName key in "HKLM\Software\Microsoft\...\Uninstall\InstallShield_{prodcode}" but not in "HKLM\Software\Microsoft\...\Uninstall\{prodcode}". However, the Add/Remove Programs panel reads the key from InstallShield_{prodcode} so changing the variable UNINSTALL_DISPLAYNAME do actually work for InstallScript projects. You say that it should not work but it DO work in my InstallScript projects.

3. I tried changing the variable IFX_PRODUCT_NAME in the OnFirstUIBefore and OnMaintUIBefore but that do not work either. You say that it should but it do not work in my InstallScript projects.

So...whatever you say it works the other way. I don't get it. Please explain.

The only way I found that actually works in InstallScript projects made with DevStudio 9 is to change the UNINSTALL_DISPLAYNAME variable in the OnFirstUIBefore or OnMainUIBefore. I think I'll stick with that method for now even though you say that it should not work. I just don't know any better way to do it.

Regards,
Magnus

DevinEllingson
11-05-2003, 03:21 PM
timelox,

Are you using an 'InstallScript' or 'InstallScript MSI' project?

Devin Ellingson
InstallShield Software Corporation

timelox
11-06-2003, 02:20 AM
It is an InstallScript project.

Well, my installscript projects was upgraded from 7>8>9 and I don't think InstallScript MSI projects were available in Dev7. When the scripts are upgraded in Dev9 they end up as InstallScript projects not InstallScript MSI projects.

Anyway, if it was an MSI project I would have posted my question in the "InstallShield DevStudio 9 (Windows Installer Projects)" forum.

Still, since the call to "RegDBSetItem(REGDB_UNINSTALL_NAME, szUninstallName);" nolonger work I will post a bug report about that.

DevinEllingson
11-06-2003, 05:04 PM
timelox,

The behavior you are describing is typical of an "InstallScript MSI" project, not an "InstallScript" project.

For the project, under Build | Settings, can you please check the "Libraries" edit box. Is "Iswi.obl" listed there?

Devin Ellingson
InstallShield Software Corporation

timelox
11-07-2003, 02:22 AM
Yes "iswi.obl" is listed there. Under Project->Settings the Type is also displayed as "InstallScript MSI Project".

In Dev8 the choice for a pure "InstallScript Project" did not exist so I think I have mislead you by calling it that. With Dev7/8 we split the projects into two types for support issues and that was MSI or InstallScript. So by mistake I thought mine were InstallScript since I do not work with pure MSI projects. Sorry about that.

Anyway, my InstallScript MSI Project worked perfectly in Dev7 and Dev8 but when upgrading to DevStudio 9 strange things happen. One thing is the call to RegDBSetItem(REGDB_UNINSTALL_NAME, ...) that do nolonger work. Why?

There are other things I need to investigate as well but that will probably become another thread...

Please explain why REGDB_UNINSTALL_NAME do not work anymore after upgrading to DevStudio9.
Thanks for your help.

DevinEllingson
11-09-2003, 06:53 AM
timelox,

Thanks for the information.

I have determined that this is a Dev7/8->9 break for InstallScript MSI projects. I have created 1-GV4BT regarding this issue.

As a workaround you will have to set UNINSTALL_DISPLAYNAME when calling RegDBSetItem to ensure that the display name will be updated appropriately:



RegDBSetItem(REGDB_UNINSTALL_DISPLAY_NAME, "DisplayName");
UNINSTALL_DISPLAYNAME = "DisplayName";


Devin Ellingson
InstallShield Software Corporation

timelox
11-10-2003, 02:20 AM
Thanks,

Today I set the variable "UNINSTALL_DISPLAYNAME" in the OnFirstUIBefore or OnMaintUIBefore and that works fine (and hopefully it will continue doing that).

The variable "REGDB_UNINSTALL_DISPLAY_NAME" in your suggested workaround do not exist though.

Anyway, why should I do that RegDBSetItem call when it's enough to just change the variable "UNINSTALL_DISPLAYNAME" ?

DevinEllingson
11-10-2003, 03:01 AM
timelox,

Sorry, I meant REGDB_UNINSTALL_NAME.

You are correct, if you change UNINSTALL_DISPLAYNAME you don't really need to call RegDBSetItem as well, unless you want the registry key to be created immediately, as chaning UNINSTALL_DISPLAYNAME won't cause anything to change until the key is created at the end of the setup.

Devin Ellingson
InstallShield Software Corporation