Overwriting files with UAC elevation

Got a problem you cannot solve? Try here.

Overwriting files with UAC elevation

Postby NickDay » Thu Nov 24, 2011 6:31 am

Hi,

IA12, Native Engine.

My installer is trying to install files in a directory under C:\Program Files.
I have these split into two groups, 'always overwrite' and 'never overwrite'.

I am finding that the 'always overwrite' group will be installed if not yet present, but are not installed if a file of the same name (different content) was already present.

The actual lines in the installer are like this:

Comment: Install 'never overwrite' files.
Set Variable NATIVE_OVERWRITE to NEVER
Install Files ... (the 'Never Overwrite' checkbox is checked)

I think this is working OK.
followed by:

Comment: Install 'always overwrite' files.
Set Variable NATIVE_OVERWRITE to ALWAYS
Install Files ... (the 'Never Overwrite' checkbox is unchecked)

It is these files which are not overwriting existing ones.
If I uninstall, they are not removed (as the installer had not installed them).
I don't know whether the checkbox on the dialog is intended to be scoped out by the variable, hence the 'belt an braces' settings.

I have tried setting the Project Settings→Project →Summary →UAC Elevation setting to either Elevate Administrators Only or Always Elevate, and have seen no difference with the above behaviour. I believe that the elevation is actually happening (in case you think a security policy is inhibiting it). At least, the elevation permission dialog is displayed.

Do you have any ideas please, or do you need further information?

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

Re: Overwriting files with UAC elevation

Postby giaviv » Fri Nov 25, 2011 9:08 am

Hi Nick,

What happens when you try this with the Windows Installer engine instead?
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: Overwriting files with UAC elevation

Postby giaviv » Fri Nov 25, 2011 9:09 am

Hi Nick,

What happens when you try this with the Windows Installer engine instead?
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: Overwriting files with UAC elevation

Postby NickDay » Fri Nov 25, 2011 10:17 am

Hi Aviv,
I have now overcome the problem by having my installer delete the problem files before installing them again.
If you'd still like me to try the Windows Installer I can, (let me know), but I don't think it's a good solution for me as (if I remember correctly) I'm using Native Engine facilities in this installer.
I think the original problem was due to Windows 7 permissions, with default security policies, which allow fles to be created or deleted under C:\Program Files, but not edited and resaved, or overwritten.
Nick
NickDay
 
Posts: 112
Joined: Tue Oct 05, 2010 9:13 am

Re: Overwriting files with UAC elevation

Postby giaviv » Tue Dec 06, 2011 6:00 pm

Nick,

Just one more thing - the Windows Installer engine is more restrictive than the Native Engine in this context.
With the Native Engine you have the capability to FORCE overwrites, even if older versions of files are being installed on top of newer ones -
with Windows Installer you can NOT do this.

P.S - you can also use the NATIVE_OVERWRITE_OLDER variable in your case.
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


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 0 guests

cron