This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Local cached MSI does not get deleted when uninstalling
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 10, 2008
12:56 AM
Local cached MSI does not get deleted when uninstalling
I have an InstallScript MSI Project. I activated the "Cache MSI locally" and indicated the "Cache Path" to "[LocalAppDataFolder]Downloaded Installations".
I had a look today into this cache path folder and was really surprised to find a list of folder, not only from the actual installed versions, but also uninstalled versions.
Does IS2008 not delete the cached MSI files when uninstalling a version?
How do I get IS2008 to delete the cached MSI files during uninstall?
I had a look today into this cache path folder and was really surprised to find a list of folder, not only from the actual installed versions, but also uninstalled versions.
Does IS2008 not delete the cached MSI files when uninstalling a version?
How do I get IS2008 to delete the cached MSI files during uninstall?
(28) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 03, 2011
12:34 PM
Most of this seems to center around removing old cache upon installing the new product.
In our situation, we always use Major upgrades. What I would like to do is always remove the old cache on uninstall so that the only cache that will exist will be for the most recent, installed product. If that is removed, the cache should be cleaned as well.
I was thinking of just creating a custom action widget to blow away the current cache location on uninstall (REMOVE="ALL").
This may be steering off topic, but what happens if I patch the current installation on a system? To create the patch, a new package (different package code) needs to be generated. Once patch is applied, what will the cache location look like? ...
Installed package cached in {Package Code 1}. Now I generate a patch from newly created package with {Package Code 2}. What happens in the Cache, is a new directory created with the original .msi patched with the deployed .msp?
Just wondering.
In our situation, we always use Major upgrades. What I would like to do is always remove the old cache on uninstall so that the only cache that will exist will be for the most recent, installed product. If that is removed, the cache should be cleaned as well.
I was thinking of just creating a custom action widget to blow away the current cache location on uninstall (REMOVE="ALL").
This may be steering off topic, but what happens if I patch the current installation on a system? To create the patch, a new package (different package code) needs to be generated. Once patch is applied, what will the cache location look like? ...
Installed package cached in {Package Code 1}. Now I generate a patch from newly created package with {Package Code 2}. What happens in the Cache, is a new directory created with the original .msi patched with the deployed .msp?
Just wondering.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 05, 2011
03:48 PM
From what you describe, I believe you could use Chris Painter's code sample which is included in this post. Chris did a simple script to always remove all but the current install cache, unless uninstalling, in which case he removed them all.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 05, 2011
03:51 PM
I guess I did what amounts to the same thing. Created a widget to run on uninstall that just whacks our cache directory.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 26, 2011
03:56 AM
Randy,
I'm taking your approach, but there is a function called PackageTitle() and used in the function RemoveOldCache().
It seems that it is yet another user function to retriece the package code?
Would you be so kind to tell me how did you implement this?
Thank you.
Marc
I'm taking your approach, but there is a function called PackageTitle() and used in the function RemoveOldCache().
It seems that it is yet another user function to retriece the package code?
Would you be so kind to tell me how did you implement this?
Thank you.
Marc
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 26, 2011
08:24 AM
Sure.
The PackageTitle() function is a private method we used to retrieve the product folder name where the cache is stored. In order to clean the cache, you will recall that you need to place it in a specific sub folder. In the "Releases" section of the InstallShield IDE, on the "Setup.exe" tab, there is a section for "Cache Msi Locally" ("Yes" by default), which has a "Cache Path" value where the cache will be stored. By default this will be "[LocalAppDataFolder]Downloaded Installations", however, this is not specific enough. To make it easy to find the cache for each product you install, you will change this to be "[LocalAppDataFolder]Downloaded Installations\[Your Product Name]. This is the value of "Product Name" in your general properties.
In your script, you will need a function that's something like this...
prototype STRING PackageTitle(HWND);
function STRING PackageTitle(hMSI)
STRING sProductName;
NUMBER nSize;
begin
try
MsiGetProperty(hMSI, "ProductName", sProductName, nSize);
if (nSize > 0) then
return sProductName;
endif;
catch
endcatch;
end;
You could hard-code this into your script, but it's better to grab it dynamically so your script will work with all installs without having to change it.
Hope that helps.
The PackageTitle() function is a private method we used to retrieve the product folder name where the cache is stored. In order to clean the cache, you will recall that you need to place it in a specific sub folder. In the "Releases" section of the InstallShield IDE, on the "Setup.exe" tab, there is a section for "Cache Msi Locally" ("Yes" by default), which has a "Cache Path" value where the cache will be stored. By default this will be "[LocalAppDataFolder]Downloaded Installations", however, this is not specific enough. To make it easy to find the cache for each product you install, you will change this to be "[LocalAppDataFolder]Downloaded Installations\[Your Product Name]. This is the value of "Product Name" in your general properties.
In your script, you will need a function that's something like this...
prototype STRING PackageTitle(HWND);
function STRING PackageTitle(hMSI)
STRING sProductName;
NUMBER nSize;
begin
try
MsiGetProperty(hMSI, "ProductName", sProductName, nSize);
if (nSize > 0) then
return sProductName;
endif;
catch
endcatch;
end;
You could hard-code this into your script, but it's better to grab it dynamically so your script will work with all installs without having to change it.
Hope that helps.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 26, 2011
08:47 AM
I've used my PurgeCache CA for several customers now and it's pretty easy to implement it. I can post it again if you like.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 26, 2011
09:00 AM
Hi Chris.
I believe your code is already in the early part of this thread. However, it's been quite a while. Do you have an update to it?
I believe your code is already in the early part of this thread. However, it's been quite a while. Do you have an update to it?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 26, 2011
09:06 AM
It's probably the same. I'd have to find it and compare to what's in my TFS.
The "code" of course is only the InstallScript function portion of the solution. The rest is the mechanics of scheduling the custom action and following a convention in the Product/Release configuration settings so that setup.exe will cache the MSI in the manner that the InstallScript is expecting.
Still, I've found it only takes me a few minutes to implement for each customer that wants a self extracting EXE. They usually don't even know I've done it for them... I just do it out of a respect forbest practices.
The "code" of course is only the InstallScript function portion of the solution. The rest is the mechanics of scheduling the custom action and following a convention in the Product/Release configuration settings so that setup.exe will cache the MSI in the manner that the InstallScript is expecting.
Still, I've found it only takes me a few minutes to implement for each customer that wants a self extracting EXE. They usually don't even know I've done it for them... I just do it out of a respect forbest practices.
![](/skins/images/A5EADE085F77DE82FB3B14D6B307AE6A/responsive_peak/images/icon_anonymous_message.png)