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

Remove old package


8 replies to this topic

mishka

mishka
  • Full Members
  • 21 posts

Posted 15 August 2004 - 09:28

Hello

I use following settings for my release: Compressed to one file (setup.exe), Cache web download, Cache path [Windows Folder]Downloaded Installations.

As result, when setup.exe is run it first uncompresses installation package to above folder\{GUID of package} and starts from there.

Question:
After full uninstall or after upgrade to a package with different GUID this folder stays. Every time I build a new package - new package code is generated. I have to do it because I want to have upgrade functionality. This folder is pretty big and I have already something like 20 copies of it.. :(

How can I remove this folder after full uninstall or after upgrade ?

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 15 August 2004 - 10:38

I don't think there is any way to do this automatically. You could write your own delete custom action and call it during the uninstall or upgrade procedure. You would need to feed a list of GUIDS of prior installation packages you want removed to this function. I created a cleanup setup like this for QA at one point to delete all stranded packages from their PC's.
Regards
-Stein Åsmul

mishka

mishka
  • Full Members
  • 21 posts

Posted 15 August 2004 - 10:51

I presume I can remove my old cached files in OnEnd().
I know when I performing full uninstall or upgrade to new package.
The question is folder name to remove.
In first case its "package code" property that I can get from MsiGetProperty.
In second case - how to get code of package that is currently upgraded ?


Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 16 August 2004 - 06:25

I had a list of the package guids used for all my previous setup versions. I then fed this list to a delete function that would delete all instances found.
Regards
-Stein Åsmul

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 16 August 2004 - 06:26

I think you can get the package code of a package by going to the advanced properties for that file.
Regards
-Stein Åsmul

htjostheim

htjostheim
  • Full Members
  • 7 posts

Posted 11 October 2006 - 10:20

Was there ever any solution to this? I have the same problem. Each time the installation is run, it will make a catalog under Downloaded Installations with a file about 50 megabytes big. After several installations that will take up a significant amount of storage space. Can anyone explain how to delete thise files after installation?

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 11 October 2006 - 13:01

The solution is simply to create a feature to delete old packages. This can be done in several ways such as an MSI deferred mode custom action, a simple batch file, an automated cleanup scheduled task etc...

I think the packages are written as [Windows Folder]Downloaded Installations\[PACKAGEGUID] . In other words if you know the package GUIDs for the packages you can delete the entries. You can get the package code from existing MSI files like this:

CODE

Set installer = Wscript.CreateObject("WindowsInstaller.Installer")
   Set objSumInfo = installer.SummaryInformation("ABSOLUTEPATHTOMSI", 0)
   strRevision=objSuminfo.Property(9)
   MsgBox strRevision

' Clean up objects
set objSumInfo = nothing
set installer = nothing


Regards
-Stein Åsmul

htjostheim

htjostheim
  • Full Members
  • 7 posts

Posted 12 October 2006 - 11:18

Will it be possible for the installset to delete the files itself after it is done installing?

Guess it would be done by using the code you showed to build the path and delete the folder.

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 12 October 2006 - 12:46

If you do delete it, make sure you delete only on uninstall, NOT install. This folder is used for repair / self repair etc... In general I would not recommend inserting this cleanup code in your main setup (Installshield might even have features for this I am not aware of). Keeping the folder installed is an extra security for patching scenarios (no prompt for source media to the user).

I would strongly recommend writing a separate cleanup script (batch file or a customized MSI set to not register on the system -remove Register / Publish product standard action). If you insist on inserting the code in your uninstall, I would try to do this from an immediate mode custom action after InstallFinalize in the InstallExecuteSequence (no immediate mode actions are allowed here by standard, but they should still work). Note: You may also try to hook up an installscript custom action to a button in the InstallComplete dialog. However, this might not work. In earlier versions of Installshield the installscript engine is shut down at this stage. VBScript custom actions still work.

Edited by Glytzhkof, 12 October 2006 - 12:48.

Regards
-Stein Åsmul