Back up files before installation

Got a problem you cannot solve? Try here.
somnetics
Posts: 21
Joined: Tue Aug 14, 2012 8:48 am
Location: St. Paul Minnesota

Back up files before installation

Postby somnetics » Tue Jul 16, 2013 3:00 pm

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.

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Back up files before installation

Postby FrancescoT » Wed Jul 17, 2013 9:13 am

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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

somnetics
Posts: 21
Joined: Tue Aug 14, 2012 8:48 am
Location: St. Paul Minnesota

Re: Back up files before installation

Postby somnetics » Wed Jul 17, 2013 9:37 am

Thanks for the reply. Can you sugest another way to preserve a file when I do an update on a computer?

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Back up files before installation

Postby FrancescoT » Thu Jul 18, 2013 8:41 am

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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

somnetics
Posts: 21
Joined: Tue Aug 14, 2012 8:48 am
Location: St. Paul Minnesota

Re: Back up files before installation

Postby somnetics » Thu Jul 18, 2013 10:21 am

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!!

somnetics
Posts: 21
Joined: Tue Aug 14, 2012 8:48 am
Location: St. Paul Minnesota

Re: Back up files before installation

Postby somnetics » Thu Jul 18, 2013 10:55 am

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.

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Back up files before installation

Postby FrancescoT » Fri Jul 19, 2013 6:05 am

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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

somnetics
Posts: 21
Joined: Tue Aug 14, 2012 8:48 am
Location: St. Paul Minnesota

Re: Back up files before installation

Postby somnetics » Fri Jul 19, 2013 8:32 am

Thank you sir I figured it out. I couldn't have done it without your hint:

Set Variable NATIVE_ENGINE to TRUE

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Back up files before installation

Postby FrancescoT » Fri Jul 19, 2013 8:47 am

... 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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: Bing [Bot] and 128 guests