Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Add/Remove Programs Icon


4 replies to this topic

baillie

baillie
  • Members
  • 4 posts

Posted 21 June 2001 - 22:53

Hello,

I've got an install that works fine ( ie. it installs and then uninstalls from the control panel Add/Remove Programs ).

The problem is that I don't know how to force my icon to be used in the Add/Remove Programs pane.  On most operating systems it defaults to a nothing icon.  On some Windows 2000 systems, the default seems to be the lovely Internet Explorer icon.  

Does anyone know how to put your own icon in the Add/Remove Programs pane.

Your help is much appreciated.


Perotin

Perotin
  • Full Members
  • 407 posts

Posted 22 June 2001 - 14:07

Hi baillie!

This has been answered in a forum here ... but I cannot find it now. So the trick is to use
"DisplayIcon" besides "DisplayName" ...
Set the registry value and look what the "add/remove programs" panel will show.


baillie

baillie
  • Members
  • 4 posts

Posted 22 June 2001 - 16:03

Ahhh...Master Perotin,

Your explanation was good coming from memory, but I needed a little more help.  I searched on the word DisplayIcon that you mentioned and the answer was in the InstallShield 6 forum.  The solution worked fine for me with InstallShield 5.1 as well.

Here is the solution for anyone interested.

function SetupRegistry()
 string szKey, szName, szValue;

begin

 //
 // Change the Add/Remove Programs icon to our UNINSTALL_ICON
 //
 szKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall" ^ @PRODUCT_NAME;
 szName  = "DisplayIcon";
 szValue = TARGETDIR ^ @SERVER_DIRECTORY ^ @UNINSTALL_ICON;
 RegDBSetKeyValueEx ( szKey, szName, REGDB_STRING, szValue, -1 );

 return 0;
end;

Slick and easy.  I could find no reference to this in any InstallShield information.  This forum is crap hot.

Thanks.


Blake Miller Wonder

Blake Miller Wonder
  • Members
  • 121 posts

Posted 27 June 2001 - 17:45

Here is some more information for the uninstall data for Windows 2000.

If you fill in most of this information, then a 'click here for support information' link will appear in the list of the Add/Remove window when your program is selected.  Clicking on the link will pop up a window with more information in it.

"Publisher" will show string for publisher.

'DisplayVersion' will show a version string.

"HelpLink" should be a URL to a web site providing support for your product.

"HelpTelephone" should be a phone number to technical support as a string.

"ReadMe" should be the file path to your product's read me or online documents file.

"RegCompany" should be string as name of company entered in RegisterUserEx dialog.

"RegOwner" should be string as name of user entered in RegisterUserEx dialog.

"URLUpdateInfo" should be a URL to a link where users can go to find out about updates to your product.

Here is the code snippet I created from an IS 6.0 install (sensitive information removed...):

This might be good for ME, but I do not know what level of uninstall ME supports yet...


   // -----------------------------------------
   // add extra information for uninstallation
   // but only if on Windows 2000
   if( g_bWin2000 )then

       RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);

       l_sKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall" ^ PRODUCT_GUID;

// I do not know what this value is used for yet...
       l_sValue = "";
       RegDBSetKeyValueEx(l_sKey, "Comments", REGDB_STRING, l_sValue, -1);

// I do not know what this value is used for yet...
       l_sValue = "";
       RegDBSetKeyValueEx(l_sKey, "Contact", REGDB_STRING, "", -1);

       l_sValue = TARGETDIR ^ <Icon File Name>;
       RegDBSetKeyValueEx(l_sKey, "DisplayIcon", REGDB_STRING, l_sValue, -1);

       l_sValue = @PRODUCT_NAME;
       RegDBSetKeyValueEx(l_sKey, "DisplayName", REGDB_STRING, l_sValue, -1);
       
       l_sValue = @PRODUCT_VERSION;
       RegDBSetKeyValueEx(l_sKey, "DisplayVersion", REGDB_STRING, l_sValue, -1);

       l_sValue = "http://<Your Web Page Here>";
       RegDBSetKeyValueEx(l_sKey, "HelpLink", REGDB_STRING, l_sValue, -1);

       l_sValue = "<Your Phone Number Here>";
       RegDBSetKeyValueEx(l_sKey, "HelpTelephone", REGDB_STRING, l_sValue, -1);

       GetSystemInfo(DATE, l_nValue, l_sValue);
       RegDBSetKeyValueEx(l_sKey, "InstallDate", REGDB_STRING, l_sValue, -1);

       l_sValue = TARGETDIR;
       RegDBSetKeyValueEx(l_sKey, "InstallLocation", REGDB_STRING, l_sValue, -1);

       l_sValue = SRCDIR;
       RegDBSetKeyValueEx(l_sKey, "InstallSource", REGDB_STRING, l_sValue, -1);

       Sprintf(l_sValue, "%d", SELECTED_LANGUAGE);
       RegDBSetKeyValueEx(l_sKey, "Language", REGDB_NUMBER, l_sValue, -1);

// set any of these to '1' to indicate the
// particular operation should be disallowed
       l_sValue = "0";
       RegDBSetKeyValueEx(l_sKey, "NoModify", REGDB_NUMBER, l_sValue, -1);
       l_sValue = "0";
       RegDBSetKeyValueEx(l_sKey, "NoRemove", REGDB_NUMBER, l_sValue, -1);
       l_sValue = "0";
       RegDBSetKeyValueEx(l_sKey, "NoRepair", REGDB_NUMBER, l_sValue, -1);

       l_sValue = "<Identify Product Here>";
       RegDBSetKeyValueEx(l_sKey, "ProductID", REGDB_STRING, l_sValue, -1);

       l_sValue = @COMPANY_NAME;
       RegDBSetKeyValueEx(l_sKey, "Publisher", REGDB_STRING, l_sValue, -1);

       l_sValue = TARGETDIR ^ "<Your ReadMe File>";
       if( Is(FILE_EXISTS, l_sValue) != 1 )then
           l_sValue = "";
       endif;
       RegDBSetKeyValueEx(l_sKey, "ReadMe", REGDB_STRING, l_sValue, -1);

// company name string from RegisterUserEx
       l_sValue = g_sCompany;
       RegDBSetKeyValueEx(l_sKey, "RegCompany", REGDB_STRING, l_sValue, -1);

// user name string from RegisterUserEx
       l_sValue = g_sUser;
       RegDBSetKeyValueEx(l_sKey, "RegOwner", REGDB_STRING, l_sValue, -1);

// URL to your company web page
       l_sValue = "http://<Company Web Page>";
       RegDBSetKeyValueEx(l_sKey, "URLInfoAbout", REGDB_STRING, l_sValue, -1);

       l_sValue = "http://<Product Updates Web Page>";
       RegDBSetKeyValueEx(l_sKey, "URLUpdateInfo", REGDB_STRING, l_sValue, -1);

       // WWXXYYZZ in Hex converted to Decimal
// use calculator to figure it out...
       l_sValue = "134217728";
       RegDBSetKeyValueEx(l_sKey, "VersionMajor", REGDB_NUMBER, l_sValue, -1);

// version of product as strings...
       l_sValue = "8";
       RegDBSetKeyValueEx(l_sKey, "VersionMajor", REGDB_NUMBER, l_sValue, -1);
       l_sValue = "0";
       RegDBSetKeyValueEx(l_sKey, "VersionMinor", REGDB_NUMBER, l_sValue, -1);

// if installed by Windows Installer
// (set to zero if using InstallShield Professional...
       l_sValue = "0";
       RegDBSetKeyValueEx(l_sKey, "WindowsInstaller", REGDB_NUMBER, l_sValue, -1);

   endif; // end Windows 2000 check