Silently overwrite files

Got a problem you cannot solve? Try here.
NickDay
Posts: 145
Joined: Tue Oct 05, 2010 9:13 am

Silently overwrite files

Postby NickDay » Fri Jul 22, 2011 8:59 am

Hi,

My installer is installing some files which already exist in the target folder.
It used to just silently overwrite these.
Now instead it is displaying a dialog

"Dialog Title: Overwrite

<Path to file>

Old file version:...
Old file date:...

New file version:...
New file date:...

Would you like to overwrite this file?

(Yes) (No) (Cancel) (No to All) (Yes to All)"

I think the installer has changed because I've enabled the native engine, in order to be able to 'transform instance'.

In the Install Files options I hoped to see a checkbox something like "Silently overwrite files if they already exist in target.".
I tried 'File is Vital for Installation' but that did not help.

Is there a way of suppressing this dialog and just having my files overwritten, as before, please?

Thanks,

Nick

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

Re: Silently overwrite files

Postby giaviv » Fri Jul 22, 2011 11:55 am

Nick,

Please try setting NATIVE_OVERWRITE to ALWAYS

Checkout 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

NickDay
Posts: 145
Joined: Tue Oct 05, 2010 9:13 am

Re: Silently overwrite files

Postby NickDay » Mon Jul 25, 2011 5:04 am

Thanks Aviv, that's just what I need and it works correctly.
Nick

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

Re: Silently overwrite files

Postby giaviv » Mon Jul 25, 2011 7:45 am

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

NickDay
Posts: 145
Joined: Tue Oct 05, 2010 9:13 am

Re: Silently overwrite files

Postby NickDay » Wed Sep 07, 2011 10:53 am

Hi Aviv,

I spoke too soon; problems remain. I have described the behaviour I'm seeing below. Please can you tell me how I can achieve what I need?

I am using IA11.

1) With files I don't wish to overwrite if they already exist at the target location:
Set Variable NATIVE_OVERWRITE to NEVER and also I have the 'Never Overwrite' box checked in the copy options dialog.
If the file I'm trying to install _does_not_exist_ in the target location, I get the following error. If I say 'Yes' it will retry indefinitely. 'No' results in my file not being installed, of course.
So even though it did not already exist, and it would have been safe to install it, it does not get installed. *** This is not the required behaviour.

ERROR
The system cannot find the path specified
<target pathname of file I'm trying to install>
Would you like to try again?
(Yes) (No) (Cancel) (No to All) (Yes to All)

If the file _does_ exist in the target location, I don't get a message, and the file is not overwritten. (This is the required behaviour.)

2) With files I wish to silently overwrite, even if they exist in the target location:
Set Variable NATIVE_OVERWRITE to ALWAYS and also I have the 'Never Overwrite' box not checked in the copy options dialog.
If the file I'm trying to install does not already exist in the target location, I get the above error. If I say 'Yes' it will retry indefinitely. 'No' results in my file not being installed.
*** This is not the required behaviour.

If the file I'm trying to install _does_ already exist in the target location, it does get overwritten. (This is the required behaviour.)

Best regards,

Nick

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

Re: Silently overwrite files

Postby giaviv » Wed Sep 07, 2011 4:38 pm

Nick,

Did you turn on the Native Engine?
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

NickDay
Posts: 145
Joined: Tue Oct 05, 2010 9:13 am

Re: Silently overwrite files

Postby NickDay » Thu Sep 08, 2011 2:47 am

Hi Aviv,
Yes,
Set Variable NATIVE_ENGINE to TRUE
right near the top.
Thanks for your quick reply, by the way.
Nick

NickDay
Posts: 145
Joined: Tue Oct 05, 2010 9:13 am

Re: Silently overwrite files

Postby NickDay » Thu Sep 08, 2011 3:07 am

Hi Aviv,
Hang on for the moment, I may have solved it...
Nick

NickDay
Posts: 145
Joined: Tue Oct 05, 2010 9:13 am

Re: Silently overwrite files

Postby NickDay » Fri Sep 09, 2011 3:43 am

Hi Aviv,

I think the problem I described did not happen with every build of my installer. When I sent my previous message I was wondering whether it was only occurring when I use miabuild (I build from the IDE and using miabuild from a batch script), and if so, whether my Path environment variable was pointing at an old release of InstallAware. No, that seems fine.
However, I cannot get the problem to occur today (whichever way I build), though I doubt that I have changed anything likely to have corrected it.

Are you aware of any situation where an installer should display the following error message?

ERROR
The system cannot find the path specified
<target pathname of file I'm trying to install>
Would you like to try again?
(Yes) (No) (Cancel) (No to All) (Yes to All)

Regards,

Nick

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

Re: Silently overwrite files

Postby giaviv » Fri Sep 09, 2011 8:45 am

Nick,

It sounds like a permissions problem - could that be?
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

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

Re: Silently overwrite files

Postby giaviv » Fri Sep 09, 2011 8:45 am

Nick,

It sounds like a permissions problem - could that be?
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

NickDay
Posts: 145
Joined: Tue Oct 05, 2010 9:13 am

Re: Silently overwrite files

Postby NickDay » Fri Sep 09, 2011 10:47 am

Good thought Aviv, but all my tests (both successful and failing) have been when logged into the same user account (with Administrator privileges) so I doubt it.

Besides, the error message seems really odd -- why would an installer throw an error when a certain file (which it's about to install) does not exist already on the target machine.

Could it be that some fault in the installer building process resulted in this file being omitted from the installer, and that's what it's really reporting?
Anyway, I'll look out for the problem recurring; it seems to have just 'gone away' for now.

Best regards,

Nick

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

Re: Silently overwrite files

Postby giaviv » Sat Sep 10, 2011 7:55 am

It could definitely be that, but I need more information.

Please let me know if this problem reoccurs.
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

NickDay
Posts: 145
Joined: Tue Oct 05, 2010 9:13 am

Re: Silently overwrite files

Postby NickDay » Mon Nov 17, 2014 6:42 am

Hi Aviv,
Well, to pick up a three-year-old thread, I have a very similar situation.

I am writing an installer in a development situation, where files are being added to a product during its development.

So the situation will be:

1. Build installer and run on customer site.
2. Add some new files to installer and rebuild it.
3. Run installer; at Maintenance dialog select 'Modify' or 'Repair'. Updated set of files gets installed.
4. Go to step 2.

What actually happens is that at step 3, when the new set of files is being installed, the 'The system cannot find the file specified' error is reported for any files included in this build of the installer, which were not in the previous build. So our instructions to the customer for step 3 will have to be to run our installer, and select 'Uninstall' rather than 'Modify', or 'Repair' then run it a second time to install. Is there a way we can just have the installer update an existing installation, with new files, via 'Modify'/'Repair', please?

Thank you,
Nick
Last edited by NickDay on Tue Nov 18, 2014 4:40 am, edited 2 times in total.

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

Re: Silently overwrite files

Postby FrancescoT » Mon Nov 17, 2014 1:25 pm

Dear Nick,

maybe I'm missing something, but It's not quite clear to me how the updated set of files gets installed, while you are running a Maintenance mode installation ... which it should only repair an existing installation without installing any new/updated file.

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: No registered users and 88 guests