stealth_thunder
Posts: 7
Joined: Thu Sep 30, 2004 4:21 pm

How do I remove files after complete installation

hi,

How do you actually work this out.... I have many files link to a setup.exe so what i want to do is to group them together and extract them to the temporary folder of windows. here's the problem how do u remove the files after you have extract and automatically install the setup.exe meaning to remove the entire folder that is in the temp.

1. I did a custom action - Install- setup.exe( so that it will setup the installation)
2. I dun noe how to remove the folder that is being extract to the temp meaning when you install the folder "setup" is extract to the temporary folder and after installation " how do you remove it automatically"

Can advanced installer do that
UdreaMihai
Posts: 90
Joined: Wed Mar 23, 2005 8:13 am

Hi,

Can you be a little more specific about what you are trying to achieve?
Maybe it is an easier way to do it.

If a custom action creates temporary files or folders another custom action must be scheduled to remove those temporary files or folders at the end of the installation process.

Best regards,
Mihai
Udrea Mihai
Advanced Installer Team
http://www.advancedinstaller.com
stealth_thunder
Posts: 7
Joined: Thu Sep 30, 2004 4:21 pm

Ok you see when you extract something to a temporary folder, you would use the custom action " install" lanuch a file let say "setup.exe" the others related files that is being extracted out to the temporary folder remains there.

But after you start to install this setup.msi, the setup.exe and other files would follow the install path you choose eg. to the Windows Temporary Folder. But after the the installation is completed. How do you set in custom actions to make it remove all the files in that temporary folder??
UdreaMihai
Posts: 90
Joined: Wed Mar 23, 2005 8:13 am

Hi,

In order to remove the files after the installation is completed, you should create a custom action from the "Custom Actions" page, which should be placed under the "Commit" Install Sequence. That custom action may be a simple program which removes a folder given as parameter.

Use the "New Attached Custom Action" toolbar button and select the program, then specify the folder you want to delete in the "Command Line" field. Use quotation marks when you specify the folder name because it may contain spaces.

However, if those temporary files that are used when you install the package are a part of the MSI package, they'll be restored by a Repair action performed for the installation, because Windows Installer will consider those files as part of the application you install and thus restore them.

Hope this helps.

Best regards,
Udrea Mihai
Advanced Installer Team
http://www.advancedinstaller.com
stealth_thunder
Posts: 7
Joined: Thu Sep 30, 2004 4:21 pm

Can you show me the entire process step by step and how u mark the quotation in the command line because I do not understand and require steps to improve my understanding.Please be in more details on the steps.

sorry to bother u , your help is appreciated
Mike
Posts: 292
Joined: Wed Jun 01, 2005 10:50 am
Location: Craiova, Romania
Contact: Website

The process, step by step:
- define a temporary directory where your setup files will be put, e.g. In the "Files and Folders" tab, on the "Files" tree, select the "Windows Volume"->"Temporary" branch, and press the INS key to insert your temporary directory, say "My temp". Add there all the files you require.
- create the custom action that will run the setup file
- in order to delete that temporary directory you will need also a custom action. Say you have an executable for that job called "eraseDir.exe". This "eraseDir.exe" should be able to delete a folder given as a parameter in the command line. You create a custom action under "Commit" section of the "Install sequence" tree. Use the "New attached custom action" in the toolbar. This will promt you to select the file. After you have selected the "eraseDir.exe" you must fill in the "Command line" text field. To do that click the "Edit" button next to it. In the window that appears click the "Folder" button and select from the directory tree the "Windows Volume"->"Temporary"->"My temp" folder.Click OK. This will pass to your "eraseDir.exe" the path on the target machine where the temporary folder is located.

Hope this will help you,
Mihai
Mihai Bobaru
Advanced Installer Team
http://www.advancedinstaller.com
stealth_thunder
Posts: 7
Joined: Thu Sep 30, 2004 4:21 pm

Hi, thanks for you help but i have some question to ask you.

Let say I do not have "erasedir.exe" , i created a dummy.exe would it work out???

I getting this message when I create a dummy.exe which is basically an empty.exe files.

Code: Select all

There is a problem with this Windows Installer package.A program run as part of the setup is not finish as expected.Contact your support personnel or package vendor
when I press " ok " it rollback the settings removing that temp folder in the windows temporary file.

I wonder did I did good or bad for this but is this the correct way of showing the user or I have did wrongly.[/img]
Mike
Posts: 292
Joined: Wed Jun 01, 2005 10:50 am
Location: Craiova, Romania
Contact: Website

What I ment by "erasedir.exe" is any EXE file that erases a folder. You
should be able to find on the net such EXE or you can make one yourself.

Another program that does nothing or something else than erasing a
folder is not suitable for your problem.

Regards,
Mihai
Mihai Bobaru
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”