cpinstall
Posts: 19
Joined: Thu Jun 08, 2006 4:00 pm

Uninstall .msi file location

After the installation is complete, it puts the .msi for instructions on how to perform uninstalls in C:\WINDOWS\INSTALLER

Is there a way to give it a name (it seems like the filename is random) and put it in [APPDIR] instead so it doesn't get "lost" ?
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

"C:\WINDOWS\INSTALLER" is the folder where Windows Installer is keeping the cached MSIs. The cached MSI is used on uninstall or upgrade to access the older version of the product. This is fully controlled by Windows Installer.
Is there a way to give it a name (it seems like the filename is random) and put it in [APPDIR] instead so it doesn't get "lost" ?
I don't think this can be done since WI generates a random name for the cached MSI. What you can do is to copy the original MSI file to APPDIR using a "File Copy/Move" file operation. If you really want to to that let me know and I'll tell you how to do it.

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
cpinstall
Posts: 19
Joined: Thu Jun 08, 2006 4:00 pm

gigi wrote:Hi,

I don't think this can be done since WI generates a random name for the cached MSI. What you can do is to copy the original MSI file to APPDIR using a "File Copy/Move" file operation. If you really want to to that let me know and I'll tell you how to do it.
I noticed that the cached MSI for uninstall isn't the same file as the one performing the install. In fact, it's much smaller. My install .msi is 150MB. The cached MSI file is only 1.5MB. Why are they so different in size? How does the "REPAIR" work if it doesn't contain all the files?

As a result of the much smaller file size, is there a way to copy the cached MSI file to APPDIR instead of the original MSI file? Or is there a way to slim down the original MSI file first with just uninstall instructions before copying it to APPDIR?
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,
The cached MSI file is only 1.5MB. Why are they so different in size? How does the "REPAIR" work if it doesn't contain all the files?
Only the MSI Database is cached (without the files). The repair will not work if the original MSI file is not found (the location of the original MSI is stored by WI in the registry). Windows Installer will prompt the user to select the original MSI file in case it is not found.
As a result of the much smaller file size, is there a way to copy the cached MSI file to APPDIR instead of the original MSI file?
I don't think that this can be done since Windows Installer cache the MSI file under a random name. What you can do is to copy the original MSI file to your APPDIR for backup. Here is how you can do that:

In the "Install Parameters" page create a property and name it SOURCE_FOLDER. Switch to "Custom Actions" page and create a "Property set with Formatted" custom action under "InstallUISequence->Begin". Use following options for the CA:
Property Name: SOURCE_FOLDER
Formatted Text: [SourceDir]

Now drag this custom action (while shift key is pressed) to "InstallExecuteSequence->Begin".

Switch to "Files and Folders" page and create a property based folder using the property created below.

Now select the "Application Folder" and choose "New File Operation->File Copy/Move". Choose SOURCE_FOLDER as source folder. As "Operation" choose "Copy".

Hope this helps,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”