Summary
Information about how to uninstall an InstallScript-based project based on the globally unique identifierSynopsis
This article discusses how to uninstall an InstallScript-based project, you must know the setup?s globally unique identifier (GUID), which is used as the name of the uninstallation registry key HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\<GUID>.
Retrieve the value of the product?s uninstallation string, UninstallString, from the key listed above. Parse this value to find the path to Setup.exe. After parsing the string, pass the path to Setup.exe in the szProgram parameter of LaunchAppAndWait.
Below is an example of the steps above. To use this in your script, change the product GUID to one that matches the setup you wish to uninstall.
Discussion
function UninstallSetup()
STRING szKey, svNumValue, szUninstValue, firststring, svString, secondstring;
NUMBER nvSize, nType, nResult, numResult;
LIST listID;
begin
nType = REGDB_NUMBER;
szUninstValue = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{E2320DC5-B30D-11D3-8871-00104BD34E2B}";
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
// Retrieve the uninstallation string.
if (RegDBGetKeyValueEx(szUninstValue, "UninstallString", nType, svNumValue, nvSize) < 0) then
MessageBox("RegDBGetKeyValueEx failed.", SEVERE);
endif;
listID = ListCreate ( STRINGLIST );
StrGetTokens ( listID , svNumValue , "\"" );
nResult = ListGetFirstString (listID, svString);
firststring = svString;
// Loop while list items continue to be retrieved.
while (nResult != END_OF_LIST)
// Display the current element.
MessageBox (svString, INFORMATION);
// Get the next string in the list.
nResult = ListGetNextString (listID, svString);
numResult = StrFind ( svString , "setup.exe" );
if (numResult > 0)then
secondstring = svString;
endif;
endwhile;
LongPathToQuote ( secondstring , TRUE );
if (LaunchAppAndWait (secondstring, "", WAIT) < 0) then
MessageBox("Failed to Remove the Application", SEVERE);
endif;
end;
STRING szKey, svNumValue, szUninstValue, firststring, svString, secondstring;
NUMBER nvSize, nType, nResult, numResult;
LIST listID;
begin
nType = REGDB_NUMBER;
szUninstValue = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{E2320DC5-B30D-11D3-8871-00104BD34E2B}";
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
// Retrieve the uninstallation string.
if (RegDBGetKeyValueEx(szUninstValue, "UninstallString", nType, svNumValue, nvSize) < 0) then
MessageBox("RegDBGetKeyValueEx failed.", SEVERE);
endif;
listID = ListCreate ( STRINGLIST );
StrGetTokens ( listID , svNumValue , "\"" );
nResult = ListGetFirstString (listID, svString);
firststring = svString;
// Loop while list items continue to be retrieved.
while (nResult != END_OF_LIST)
// Display the current element.
MessageBox (svString, INFORMATION);
// Get the next string in the list.
nResult = ListGetNextString (listID, svString);
numResult = StrFind ( svString , "setup.exe" );
if (numResult > 0)then
secondstring = svString;
endif;
endwhile;
LongPathToQuote ( secondstring , TRUE );
if (LaunchAppAndWait (secondstring, "", WAIT) < 0) then
MessageBox("Failed to Remove the Application", SEVERE);
endif;
end;
Additional Information
For more information on the methods used to launch applications, see the InstallShield Help Library topics:
Related Articles
Uninstalling the beacon component from an application server breaks the application server configuration 7Number of Views Uninstalling an InstallShield Installation Manually 18Number of Views Add/Remove Programs Hangs When Launching an Application During Uninstall 4Number of Views Extracting Files from a Setup.exe 26Number of Views Silent Uninstall for Setup.exe with Multiple-Instance MSI 3Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Case id: 00001065
Activity: Status change: 2 hours ago