Zarbon001
Posts: 11
Joined: Tue Aug 02, 2011 9:39 pm

Move Folders on the Target Computer Before Install

Thu Feb 23, 2012 3:52 pm

Hello,

I need to have my installer copy all of the files and folders in my installers target directory on the target computer before the instillation of my app.

mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Move Folders on the Target Computer Before Install

Fri Feb 24, 2012 10:32 am

Hello,

I'm afraid I don't understand your project requirement. When running an application's installation package, its purpose is to copy the application's resources on the target machine.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Zarbon001
Posts: 11
Joined: Tue Aug 02, 2011 9:39 pm

Re: Move Folders on the Target Computer Before Install

Fri Feb 24, 2012 2:16 pm

Our situation is that we have our applications information out on many of our client's PC already my manually putting it out there before using Advanced Installer. So before we can go and update the files we need to back up their files so if there is an issue with the new version and their system we can go and replace the old files to keep the product working properly.

Zarbon001
Posts: 11
Joined: Tue Aug 02, 2011 9:39 pm

Re: Move Folders on the Target Computer Before Install

Fri Feb 24, 2012 6:54 pm

I have a more specific question is there a way to set the location in the back up custom action so that I could reference that location in a batch file and use the batch file to move the files.

mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Move Folders on the Target Computer Before Install

Mon Feb 27, 2012 12:34 pm

Hello,

If you need to perform a backup, here's an article you can follow and adapt to fit your needs.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Zarbon001
Posts: 11
Joined: Tue Aug 02, 2011 9:39 pm

Re: Move Folders on the Target Computer Before Install

Wed Feb 29, 2012 3:27 pm

The issue I am having is I am trying to specify the location of the temp directory that the backup script will copy to because I need to reference that location in a batch file and will this command copy all of the files in my app directory? [APPDIR]*.*

mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Move Folders on the Target Computer Before Install

Thu Mar 01, 2012 1:11 pm

Hello,

I'm not sure I completely understand what you are trying to accomplish. Can you please give us more details and exemplify?

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Zarbon001
Posts: 11
Joined: Tue Aug 02, 2011 9:39 pm

Re: Move Folders on the Target Computer Before Install

Thu Mar 01, 2012 2:34 pm

I have built an installer for a program that our company has manually installed on many of our customers systems. I am making an updater for that program that will put all of the files from the version in a backup location. To do this I want to run the backup custom action and specify the temp path that it is sending the files on the target computer to and then reference that temp path in a batch file which I w use to move the temp directory to a permanent backup location.

mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Move Folders on the Target Computer Before Install

Fri Mar 02, 2012 10:27 am

tfolder - the property set by the Backup script which designates the temporary directory where the backup files/folders reside. This is the value you will need to set in your .BAT file.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Zarbon001
Posts: 11
Joined: Tue Aug 02, 2011 9:39 pm

Re: Move Folders on the Target Computer Before Install

Tue Mar 27, 2012 4:26 pm

I tried to do that, but it still didn't work is this what you meant

Code: Select all

@echo off
set TIMESTAMP=%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%--%TIME:~0,2%-%TIME:~3,2%-%TIME:~6,2%
@echo TIMESTAMP=%TIMESTAMP%
md C:\backup\%TIMESTAMP%
xcopy /e "%tfolder%" "C:\backup\%TIMESTAMP%"
This is what my custom action looks like
example .png
This is what my custom action looks like
example .png (124.82KiB)Viewed 12856 times

mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Move Folders on the Target Computer Before Install

Thu Mar 29, 2012 12:06 pm

Hello,

If you need to reference that installer property within the .BAT you cannot add it as an environment variable. Even if you created it correctly as part of the installation, environment variables cannot be used by the same process they get created by.

Here's what you can try:
- in the attached custom action from the screen shot set the "Command" field to something like:

Code: Select all

"&Backup.bat" [tfolder]
- then in the .BAT file you can reference it like this since it's the first parameter:

Code: Select all

%1
For more information you can look how to pass command line parameters to a .BAT file on the Internet. Here's a good place to start.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”