Copy Move Local Files Issue

Got a problem you cannot solve? Try here.
jcassidy
Posts: 14
Joined: Tue Apr 15, 2014 12:02 pm

Copy Move Local Files Issue

Postby jcassidy » Tue Aug 12, 2014 10:18 am

Hello,

My requirement is to create a unique folder to backup to and then move the existing files into this folder. To do so I have attempted multiple configurations of the below code.

Code: Select all

Does Folder Exist C:\RMT\ (get result into variable OLDRMTEXISTS)
if Variable OLDRMTEXISTS Equals TRUE
    Set Variable MYDATE to $DATE$
    Replace / with _ in variable MYDATE
    Set Variable MYDIR to C:\RMT$MYDATE$
    Create Folder $MYDIR$
    Apply Install (get result into variable MYSUCCESS)
    Copy Local Files C:\RMT\*.* to $MYDIR$\*.* (include subfolders)
    Apply Install (get result into variable MYSUCCESS)
end



No matter what I do and how I configure this the files and folders do not copy. I end up with an empty folder with the correct name.

Also once I start moving things around or chance the copy local files command not even the folder is created which forces me to create a new project while copying and pasting the existing code.

Without change to the code and pasting it into the new project the folder creation works again but I am still unable to get the files and folders to copy over to the new destination.

Things I have attempted:
    * Having only one apply after the create directory and copy local files command.
    * Removing the wild card *.* from the files field.
    * Removing the create folder, creating the folder manually, running the copy local file command followed by the apply install.
    * Changing from SUCCESS to MYSUCCESS (did not think this would do anything but worth ruling out.)

There must be something that I am missing. The only really frustrating part about this however is that I had to create over 9 different projects to get this far. Working with this feature caused the Apply Install command to be corrupted for the whole installer which resulted in the creation of multiple new projects.

Any guidance other than the current forum posts and available documentation would be appreciated as I scoured these resources prior to posting this message.

Thanks
James

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

Re: Copy Move Local Files Issue

Postby FrancescoT » Tue Aug 12, 2014 11:18 am

Dear James,

try the following instead;

Code: Select all

Does Folder Exist C:\RMT\ (get result into variable OLDRMTEXISTS)
if Variable OLDRMTEXISTS Equals TRUE
    Set Variable MYDATE to $DATE$
    Replace / with _ in variable MYDATE
    Set Variable MYDIR to C:\RMT$MYDATE$

   Set Variable NATIVE_ENGINE to TRUE
   Create Folder $MYDIR$
   Copy Local Files C:\RMT\*.* to $MYDIR$\*.* (include subfolders)
   Set Variable NATIVE_ENGINE to FALSE

end


I suppose that your problem is caused by the multiple calls to Apply Install ( ... which it is not recommended in your case) and by the "include subfolders" flag with the "Copy Local Files" command. The flag only works when used with NATIVE ENGINE ... otherwise it's ignored.

Hope this helps you.

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

jcassidy
Posts: 14
Joined: Tue Apr 15, 2014 12:02 pm

Re: Copy Move Local Files Issue

Postby jcassidy » Tue Aug 12, 2014 11:25 am

Hello Francesco,

This works great! This also clears up what is meant by the NATIVE_ENGINE as well.

As always thanks for the expeditious assistance.

Sincerely
James

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

Re: Copy Move Local Files Issue

Postby FrancescoT » Tue Aug 12, 2014 11:30 am

I'm happy you solved :D !

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: Baidu [Spider] and 117 guests