Phobos
Posts: 85
Joined: Fri Sep 08, 2006 11:52 am
Location: Germany

Temporary Files

Hi,

I am currently evaluating Advanced Installer 4.3 and I run into an issue regarding Temporary Files. What I want to do is to add a temporary script to my application directory that gets executed through a custom action, and then gets deleted once the setup has completed.
However, the behavior I'm experiencing does not allow me to accomplish this. In my AI project I add the script as a temporary file to the application directory. If I now build and execute my package, the temporary file is immediatly copied to the default APPDIR, so this happens before I even had a chance to define a path through the dialog. What also happens is that my temporary file gets removed before the custom actions start, and not at the end of the setup. My custom actions are set to run at "InstallFinalize", and the AI documentation says regarding temporary files:

"They are copied at the beginning of the setup process on the CostFinalize standard action, and removed at the end of the setup after the InstallFinalize standard action."

But this does not seem to be the case. What I want to achieve is that my temporary files do get installed into the application directory that is defined through the dialog, and that they get removed at the very end of the installation, after my custom actions have run. How can I do this?

Thank you for your assistance.

Dennis
Phobos
Posts: 85
Joined: Fri Sep 08, 2006 11:52 am
Location: Germany

Any help on this?
Mihai
Posts: 38
Joined: Wed Mar 23, 2005 12:19 pm

Hi,

The temporary files are extracted before the dialogs are displayed in order to be available also in those dialogs. Your temporary file is extracted in the default application location because when the location is changed the temporary file has been already extracted.

Temporary files are recommended to be placed in predefined directories, such "Windows Volume" > "Temporary".

However, if your installation requires the temporary file in the application folder I will give you more details about how to achieve that.

As for the other problem, the temporary files are indeed removed after the "InstallFinalize" action. The problem is that your custom action is also after "InstallFinalize". So, to be sure that your custom action is executed before the temporary files are removed, in the "Custom Action" page, delete your custom action from the "InstallFinalize" folder and then create it again. You must do that after you have added your temporary file(s).

Let me know how it works.

Regards,
Mihai
Mihai Udrea
Advenced Installer Team
Phobos
Posts: 85
Joined: Fri Sep 08, 2006 11:52 am
Location: Germany

Hi,

My temporary files do not actually have to be in the application directory, I changed my project and now use the Windows Volume Temporary folder which is working fine.

However, I am still having a problem with the deletion of temporary files. When I created a testpackage I added a temporary file and created a custom action afterwards. In this test the custom action was executed before the temporary file was deleted, so exactly what I want to do.
I then tried the same with the project I am currently working on, but here it did not work. There are several custom actions in my project, and I only recreated the one that relies on the temporary files. Do I have to recreate all my custom actions?

Thanks for the help.
Mihai
Posts: 38
Joined: Wed Mar 23, 2005 12:19 pm

Hi,

Only the custom actions that relies on temporary files must be recreated.
If you still encounter other problems you could send us the AIP file at support at advancedinstaller dot com.

Regards,

Mihai
Mihai Udrea
Advenced Installer Team
danliang
Posts: 8
Joined: Thu Dec 28, 2006 7:31 pm

Mihai wrote:Hi,

The temporary files are extracted before the dialogs are displayed in order to be available also in those dialogs. Your temporary file is extracted in the default application location because when the location is changed the temporary file has been already extracted.

Temporary files are recommended to be placed in predefined directories, such "Windows Volume" > "Temporary".

However, if your installation requires the temporary file in the application folder I will give you more details about how to achieve that.

As for the other problem, the temporary files are indeed removed after the "InstallFinalize" action. The problem is that your custom action is also after "InstallFinalize". So, to be sure that your custom action is executed before the temporary files are removed, in the "Custom Action" page, delete your custom action from the "InstallFinalize" folder and then create it again. You must do that after you have added your temporary file(s).

Let me know how it works.

Regards,
Mihai
Though this is an year old, I am in need of this! If you, or anyone else for that matter, can provide me with the details to do so, that would be greatly appreciated.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

Why you need to put temporary files in the "Application Folder"? This is not recommended since the "Application Folder" can be changed during installation.

My recommendation is to place them in predefined directories, such "Windows Volume" > "Temporary".

Regards,
Gigi
______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”