Copy Local Files - Force Overwrite

Got a problem you cannot solve? Try here.
Post Reply
gsaunders
Posts: 81
Joined: Mon Aug 16, 2010 2:37 pm

Copy Local Files - Force Overwrite

Post by gsaunders »

Using Installaware 11...

In Windows 7 with one of our older application the data was stored in c:\Program Files\Application

Because of the location of the data and the old (non-themed) application the data updates would show up in the c:\users\username\AppData\Local\Virtual\Program Files\Application.

Sooo...

We now have a new version of the application (themed) AND we want to put the data in the c:\ProgramData\Application folder. So part of the new installation needs to copy the old data (from both above folders) to the new location.

Here is the rub... to get all the data I have to first copy what is in the c:\Program Files\Application into the c:\ProgramData\Application folder AND then copy what is in the c:\users\username\AppData\Local\Virtual\Program Files\Application into the c:\ProgramData\Application folder.

To do this I have been trying to use the Copy / Move Local Files command. The RUB is this... since the second folder (c:\users\username\AppData\Local\Virtual\Program Files\Application) has the same file names as what is in the main folder (c:\Program Files\Application) and the user is prompted as to whether to overwrite the files.

So the question is this. Is there a way to do a copy of local files and force an overwrite. In this case I need the files to overwrite without bugging the user.

Thanks,

Greg
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Copy Local Files - Force Overwrite

Post by giaviv »

Greg,

Actually, the best (and most "clean") way to go about this would me removing your old version before installing the new one.
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
gsaunders
Posts: 81
Joined: Mon Aug 16, 2010 2:37 pm

Re: Copy Local Files - Force Overwrite

Post by gsaunders »

giaviv wrote:Greg,

Actually, the best (and most "clean") way to go about this would me removing your old version before installing the new one.
Do you mean having the user manually uninstall the old version via Add / Remove Progams???

Regardless the old application's uninstall deletes the data so I MUST copy the data from the old applicaiton's data location to the new installation's data location. Then we can uninstall the old application and let our installer continue.

So ultimately my question is:

Is there a way to do a copy of local files and force an overwrite. In this case I need the files to overwrite without bugging the user. I don't believe the standard Copy / Move Local Files command offers this so does anyone have a different solution to achieve this??? A plug-in? Or some other idea?

Greg
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Copy Local Files - Force Overwrite

Post by giaviv »

Greg,

You can uninstall the setup from within InstallAware, without asking the user to go to the Add/Remove Programs.

Regardless, the functionality you are depicted is best achieved with the Native Engine using these variables:

Code: Select all

NATIVE_OVERWRITE: Initially PROMPT. With the initial value, when setup is about to overwrite a file during a native engine installation, the end-user will be prompted with an overwrite dialog displaying the file dates and versions for both the new file and the old file, as well as the options to overwrite or skip the file. Set to ALWAYS to automatically overwrite files. Set to NEVER to automatically skip installing files that already exist on the target. Any other value will be interpreted as PROMPT. If the end-user makes the choice to apply the overwrite decision in the prompt dialog to all files, this variable will also be automatically updated, keeping the setup script aware of end-user choices and providing it with the ability to override them. 
NATIVE_OVERWRITE_OLDER: Initially FALSE. Determines whether the native setup engine is allowed to replace files that have been determined to be newer with older files that are included in the installation. Set to TRUE to permit the native setup engine to replace files that are newer with older copies (this is not recommended). This variable overrides the value of the NATIVE_OVERWRITE variable when FALSE, and the file being installed by setup is determined to be older than the file already present on the target system. The native engine compares files as follows: If both files are versioned, the decision is based on the comparison of the file versions (the installed file has to be a newer version than the present file). If none of the files are versioned, the decision is based on the comparison of file dates (the installed file has to be modified more recently than the present file). If the file being installed lacks version information but the present file contains version information, the file being installed is assumed to be older. If the file being installed contains version information but the present file lacks version information, file dates are compared. 
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
gsaunders
Posts: 81
Joined: Mon Aug 16, 2010 2:37 pm

Re: Copy Local Files - Force Overwrite

Post by gsaunders »

giaviv wrote:Greg,
You can uninstall the setup from within InstallAware, without asking the user to go to the Add/Remove Programs.
Giaviv... understood... I am already doing this.

My problem is the copying of local files and needing them to overwrite without asking the user. I am just running into a situation where I have to do the overwrite... UNLESS I do all this checking before hand of whether the file already exists.

So ultimately my question is:

Is there a way to do a copy of local files and force an overwrite. In this case I need the files to overwrite without bugging the user. I don't believe the standard Copy / Move Local Files command offers this so does anyone have a different solution to achieve this??? A plug-in? Or some other idea?

Greg
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Copy Local Files - Force Overwrite

Post by giaviv »

Dear Greg,

Please refer to the second part of my previous post - i've addressed that exact question - thanks!
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
gsaunders
Posts: 81
Joined: Mon Aug 16, 2010 2:37 pm

Re: Copy Local Files - Force Overwrite

Post by gsaunders »

giaviv wrote:Dear Greg,

Please refer to the second part of my previous post - i've addressed that exact question - thanks!
Sorry I missed that... I was on the Android and didn't see. That's what I needed.

Thanks
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Copy Local Files - Force Overwrite

Post by giaviv »

Sure! Good luck.
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Post Reply