Page 1 of 1

Back up files before installation

Posted: Tue Jul 16, 2013 3:00 pm
by somnetics
Sir, I have a situation where when I am upgrading an installation, I need to preserve one of the files from the previous install.

I have tried to create a directory [Create Folder] and moving the file [Copy Local Files] but it doesn't seem to work.

Can you suggest a strategy to accomplish this task?


Thank You.

Re: Back up files before installation

Posted: Wed Jul 17, 2013 9:13 am
by FrancescoT
Dear User,

If you are using the Windows Installer Engine with your package, the "Create Folder" & "Copy Local Files" commands are not executed immediately, but deferred at Apply Install execution.

Both commands are Windows Installer command and this behavior can be observed with any other command part of the Windows Installer engine (Purple Commands).

Due the above consideration, very probably when your script tries to Copy those local files these are not anymore available.

Finally and if you are using the Windows Installer Engine, you can force the immediate commands execution with the help of the InstallAware Native Engine. This can be easily done by placing the command you want to execute immediately, within a NATIVE ENGINE on/off sequence.

Example;

Code: Select all

Set Variable NATIVE_ENGINE to TRUE
Create Folder
Copy Local Files \ to
Set Variable NATIVE_ENGINE to FALSE

For more information about IA NATIVE ENGINE capabilities, please refer to IA documentation.

Regards

Re: Back up files before installation

Posted: Wed Jul 17, 2013 9:37 am
by somnetics
Thanks for the reply. Can you sugest another way to preserve a file when I do an update on a computer?

Re: Back up files before installation

Posted: Thu Jul 18, 2013 8:41 am
by FrancescoT
Dear User,

if I haven't missed your question, unfortunately there aren't other possible ways to do the same.

... you have to copy these files before they are removed by he new install ... if you want to move them under a different local path.

Regards

Re: Back up files before installation

Posted: Thu Jul 18, 2013 10:21 am
by somnetics
Francesco,

Here is a snag. We have two projects which are included in a wrapper project. We did this because at the time there was a bug in installaware that would not let us install on both 64 and x86 machines so we made two seperate projects with a wrapper project.

The copying strategy works when I run the 64 installer alone. When I run it throught the wrapper installer the copying does not take place.

I put a MessageBox around the copying so I know it is running through that code.

When I run the 64 installer the files get copied.
When I run the wrapper the files don't.

HELP!!

Re: Back up files before installation

Posted: Thu Jul 18, 2013 10:55 am
by somnetics
More info. I moved the code to do the file copying into the wrapper project. It doesn't copy the files in the wrapper project. It copies the files in the x64 project. The exact same code is in both. I don't know what the difference is.

Re: Back up files before installation

Posted: Fri Jul 19, 2013 6:05 am
by FrancescoT
Dear user,

I'm very sorry, but I'm not able to figure out the exact way you used to copy such files by the information you shared.

Unfortunately, I don't know what your project's script does exactly ... for sure there is a problem with it.

Regards

Re: Back up files before installation

Posted: Fri Jul 19, 2013 8:32 am
by somnetics
Thank you sir I figured it out. I couldn't have done it without your hint:

Set Variable NATIVE_ENGINE to TRUE

Re: Back up files before installation

Posted: Fri Jul 19, 2013 8:47 am
by FrancescoT
... I'm happy you finnaly solved :D .
Don't forget to swicth OFF the IA Native Engine, once you completed your file copy operation.

Regards