2

There is similar questions on SO such as this and this however both suggest ClickOnce which I don't (can't) use.

I have started a new Setup project (InstallAllUsers=false) and have specified theApplication Folder to be [LocalAppDataFolder][ProductName]

which at install time points to

C:\Users\nonadmin\AppData\Local\Setup1\

When running the installer on Windows 7 as a non-admin I get this:enter image description here

From my perspective it appears all the MSI does is copy the one text file to C:\Users\nonadmin\AppData\Local\Setup1\, something that could be done manually without this popup showing

The error message says something about 'unknown publisher' - does this occur for any msi/exe that simply runs? (even if it does nothing)

How can I avoid this dialog (a la ClickOnce) for non-admin users?

Community
  • 1
  • 1
wal
  • 17,409
  • 8
  • 74
  • 109

1 Answers1

3

To avoid a consent prompt, you need to mark the package as "UAC compliant." (See "Guidelines for Packages" in the MSI SDK.) It looks like Visual Studio deployment projects don't support that bit so you'd have to modify the package in a post-build script (or use a different tool, like Wix that supports it directly).

Any package or executable that isn't Authenticode signed shows up as "Unknown publisher."

Bob Arnson
  • 21,377
  • 2
  • 40
  • 47
  • Bob do you know the field to modify post-build? I'm already using a post-build script to make RemovePreviousVersions do what its supposed to do – wal Jul 16 '11 at 00:12
  • "Guidelines for Packages" in the MSI SDK says: "Omit Bit 3 from the value of the Word Count Summary Property to indicate that the package can be required to be elevated. Do not include this bit unless elevated privileges are not required to install this package." – Bob Arnson Jul 16 '11 at 00:42
  • I use the following command to update `RemovePreviousVersions` in a vbs script: `UPDATE InstallExecuteSequence SET Sequence=1450 WHERE Action='RemoveExistingProducts'` - after much googling I couldnt find any information about how to do the same for the `Word Count Summary` property. The best I found was http://blogs.msdn.com/b/jamesfi/archive/2007/05/02/making-an-msi-that-doesn-t-need-a-uac-lua-prompt.aspx which mentions the Package/@InstallPrivileges attribute. Do you have any more info that could help do this via vbs? – wal Jul 18 '11 at 00:04
  • The Windows SDK comes with the wisuminf.vbs script to update summary information properties, but you'll have to query the property, turn on bit 3, and then set the property. Package/@InstallPrivileges is a WiX attribute; WiX supports the UAC compliant bit directly. (.vdproj projects are very limited.) – Bob Arnson Jul 18 '11 at 01:21
  • Thanks, got it working by running `cscript $(ProjectDir)..\WiSumInf.vbs $(BuiltOuputPath) Words=10` Before running this Words=2 (ie `Source is compressed` is set) – wal Jul 18 '11 at 02:31