jeff@jonasclub.com
Posts: 8
Joined: Tue Mar 20, 2018 1:41 pm

Local File Copy on Target System

I'm trying to replicate an action which takes place in my current Wise installer in a test AI install and not having much luck in finding the command.

The action in the Wise scripting language is to copy local files from their installed location into another folder location on the target install. It looks like "Copy local file from %INSTALLATION_PATH%\FOLDER1\*.htm to %INSTALLATION_PATH%\FOLDER2\ (Preserve existing)" - (i.e. never replace file once it's in there).

This action executes at the very end of my install script because the source htm files need to be placed in their folders first before they are copied to their secondary location. As a clunky workaround, I could identify every htm file in the source folders and duplicate them into the secondary location, but that method doesn't seem to handle wildcards to pick up all .htm files at one time. Quite awkward...
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Local File Copy on Target System

Hello,

Indeed, unfortunately you cannot use wildcards alongside with our file duplication feature. I've added this improvement on our roadmap and hopefully it will be addressed by our dev team in the future. Thank you for your suggestion.

That being said, the only workaround solution for you will be to create your own custom action to bulk copy the files matching your wildcards expression. For instance you can create a small BAT file and launch it using our "Launch file" predefined custom action.

If you have any questions or doubts just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jeff@jonasclub.com
Posts: 8
Joined: Tue Mar 20, 2018 1:41 pm

Re: Local File Copy on Target System

I was thinking that Custom Actions was my only route for copying (and for deleting files) on the target system, but I'm not sure how a batch file would look that tries to use the installed location (I believe AI saves this in the APPDIR variable) to perform any actions. If I used %APPDIR%\folder\ in the batch file, would that work?

Edit - hmm...I see from that https://www.advancedinstaller.com/user- ... -file.html gives some guidance on how parameters can get passed in. Trying that out.
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Local File Copy on Target System

Hello,

Yes, you should be able to pass the "[APPDIR]" property formatted reference as a parameter to your BAT file as it is exposed in the referenced article.

Just let us know if you have any further questions or doubts.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”