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
- :
- Deleting unused files at end of Installation.
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
‎May 01, 2013
03:30 PM
Deleting unused files at end of Installation.
Hello All,
I have what should be a basic question... We have a complex logic structure to remove unused files based on how an xml file is generated. But basically we want to remove unused files. So since this logic is quite complex, i put it into a c# console application.
I call in the deferred in system context custom action, exe type, installed with product. (I'm using a basic MSI project).
When i call the exe, no files are deleted. However, when the installation is completed, and i double click the exe console app, the files are being deleted, no problem.
Is this because the installer has a hold on the files until the installation is 100% complete? I can't quite figure out what is going on. I've tried calling it in the Deferred sequence, Deferred in System Context.
Please advise.
TIA
I have what should be a basic question... We have a complex logic structure to remove unused files based on how an xml file is generated. But basically we want to remove unused files. So since this logic is quite complex, i put it into a c# console application.
I call in the deferred in system context custom action, exe type, installed with product. (I'm using a basic MSI project).
When i call the exe, no files are deleted. However, when the installation is completed, and i double click the exe console app, the files are being deleted, no problem.
Is this because the installer has a hold on the files until the installation is 100% complete? I can't quite figure out what is going on. I've tried calling it in the Deferred sequence, Deferred in System Context.
Please advise.
TIA
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 01, 2013
03:47 PM
In your custom action, I would verify if the XML file exists at the time of execution. In addition, you will have to make a determination if the files are in use, and if so, by what.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 02, 2013
09:29 AM
The file is present during execution. So there is nothing going on there.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 02, 2013
09:41 AM
I would add a CA right before the CA for the exe which opens a modal message box (just for testing, to pause the installer) or you could use a tool like catest (Google) which is very helpful. With the installer paused, check the file access with a tool like ProcessMon (Microsoft Sysinternals) or launch the exe and debug from the same deferred user context as the installer is using, using run as.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 02, 2013
03:15 PM
What is catest?
Fantastic idea on the pausing, never thought of that before, thanks!
Fantastic idea on the pausing, never thought of that before, thanks!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 03, 2013
08:26 AM
catest.dll is a tool I used to debug a C++ custom action. The readme that comes with it only talks about launching another CA DLL, so you might need to tell it to launch a wrapper DLL which then launches your exe for test purposes. You add catest's CA to your MSI where you would have added the CA you want to debug. Then in a INI file you provide the details for your CA. When MSI runs to that point it launches the CA in catest.dll which opens a dialog box and allows you to attach a debugger or setup your test scenario. But the really useful feature is that when you complete your custom action (successfully or failure and implement a change in your CA) you can just have the catest dialog launch your CA again, without having to rollback and start the MSI again. It has been several months since I last worked with it, so I hope I recalled the details correctly.
More details here:
http://blogs.msdn.com/b/astebner/archive/2005/03/07/388739.aspx
download the zip here:
https://skydrive.live.com/?cid=27e6a35d1a492af7&id=27E6A35D1A492AF7%21483
More details here:
http://blogs.msdn.com/b/astebner/archive/2005/03/07/388739.aspx
download the zip here:
https://skydrive.live.com/?cid=27e6a35d1a492af7&id=27E6A35D1A492AF7%21483