Discussion:
[WiX-users] How to force the .msi "run as Administrator"
Xin Liu (Person Consulting)
2007-02-26 13:06:46 UTC
Permalink
We have a .msi file built from Wix toolset which calls one of the VS SDK tool. So if the .msi is ran in Vista, even if you are a member of Administrator group, it will failed. However, if run it "as Administrator" (Right click cmd.exe, choose "Run as Administrator", then call the .msi from the cmd.exe), operation succeed.
So is there a method in Wix to force run the .msi as Administrator.

Thanks,
Xin Liu
Gareth at Serif
2007-02-26 13:48:15 UTC
Permalink
You need to make sure that your bootstrapper has one of the magical Vista
strings within it like "setup" or "install". This will instantly elevate
the priveledges within Vista unless it has a corresponding Manifest file
telling it not to.

I get the impression that you're calling the MSI file directly and I was
under the impression that this was equally magical on Vista. Try adding
"setup" to the name of your MSI though - so if you're running myapp.msi, try
calling it myapp-setup.msi and see if Vista catches it and elevates the
permissions. If you have UAC switched on you should get a different,
more-friendly UAC warning.

Regards,
Gareth
Post by Xin Liu (Person Consulting)
We have a .msi file built from Wix toolset which calls one of the VS SDK
tool. So if the .msi is ran in Vista, even if you are a member of
Administrator group, it will failed. However, if run it "as Administrator"
(Right click cmd.exe, choose "Run as Administrator", then call the .msi
from the cmd.exe), operation succeed.
So is there a method in Wix to force run the .msi as Administrator.
Thanks,
Xin Liu
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
--
View this message in context: http://www.nabble.com/How-to-force-the-.msi-%22run-as-Administrator%22-tf3292742.html#a9159071
Sent from the wix-users mailing list archive at Nabble.com.
Wilson, Phil
2007-02-26 19:00:01 UTC
Permalink
If you are an administrator and you install the MSI then it will elevate
when it goes to the InstallExecuteSequence (and work!) while the UI
sequence runs as standard user. If it's failing even though you are an
administrator then you are perhaps installing something from the UI
sequence. If this is the case, you're really doing the wrong thing, but
you fix it by getting the UI sequence to run as administror with an
elevated launcher or Run As.

Phil Wilson


-----Original Message-----
From: wix-users-***@lists.sourceforge.net
[mailto:wix-users-***@lists.sourceforge.net] On Behalf Of Gareth at
Serif
Sent: Monday, February 26, 2007 5:48 AM
To: wix-***@lists.sourceforge.net
Subject: Re: [WiX-users] How to force the .msi "run as Administrator"


You need to make sure that your bootstrapper has one of the magical
Vista strings within it like "setup" or "install". This will instantly
elevate the priveledges within Vista unless it has a corresponding
Manifest file telling it not to.

I get the impression that you're calling the MSI file directly and I was
under the impression that this was equally magical on Vista. Try adding
"setup" to the name of your MSI though - so if you're running myapp.msi,
try calling it myapp-setup.msi and see if Vista catches it and elevates
the permissions. If you have UAC switched on you should get a
different, more-friendly UAC warning.

Regards,
Gareth
Post by Xin Liu (Person Consulting)
We have a .msi file built from Wix toolset which calls one of the VS
SDK tool. So if the .msi is ran in Vista, even if you are a member of
Administrator group, it will failed. However, if run it "as
Administrator"
Post by Xin Liu (Person Consulting)
(Right click cmd.exe, choose "Run as Administrator", then call the
.msi from the cmd.exe), operation succeed.
So is there a method in Wix to force run the .msi as Administrator.
Thanks,
Xin Liu
----------------------------------------------------------------------
--- Take Surveys. Earn Cash. Influence the Future of IT Join
SourceForge.net's Techsay panel and you'll get the chance to share
your opinions on IT & business topics through brief surveys-and earn
cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEV
DEV _______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
--
View this message in context:
http://www.nabble.com/How-to-force-the-.msi-%22run-as-Administrator%22-t
f3292742.html#a9159071
Sent from the wix-users mailing list archive at Nabble.com.


------------------------------------------------------------------------
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
V
Bob Arnson
2007-02-26 16:06:48 UTC
Permalink
Post by Xin Liu (Person Consulting)
We have a .msi file built from Wix toolset which calls one of the VS
SDK tool.
Please be more explicit. Which tool? As a custom action or a build-time
tool? Can you show a code fragment?
--
sig://boB
http://bobs.org
Xin Liu (Person Consulting)
2007-02-27 01:51:51 UTC
Permalink
Our .msi calls the regit.exe which comes from Visual Studio SDK 2005 during installation. It is defined in custom action.
The code fragment is shown as follows:
<InstallExecuteSequence>
<Custom Action='CmdRegIt' After='InstallFinalize'>NOT Installed</Custom>
<Custom Action='CmdUnRegIt' Before='InstallInitialize'>Installed</Custom>
</InstallExecuteSequence>
<CustomAction Id='CmdRegIt' FileKey='regit.exe' ExeCommand='/root:Software\Microsoft\VisualStudio\8.0 "[SEFolder]Bin\bservice.dll' Return='check' />
<CustomAction Id='CmdUnRegIt' FileKey='regit.exe' ExeCommand='/u /root:Software\Microsoft\VisualStudio\8.0 "[SEFolder]bin\bservice.dll"' Return='check' />

The problem is that when running the .msi in Vista, calling the regit.exe in custom action doesn't register the COM component (bservice.dll) successfully. So we need a way in Wix to let the .msi run in "elevated mode"----to run in Administrator privilege.

Thanks,
Xin
From: Bob Arnson [mailto:***@bobs.org]
Sent: Tuesday, February 27, 2007 12:07 AM
To: Xin Liu (Person Consulting)
Cc: wix-***@lists.sourceforge.net
Subject: Re: [WiX-users] How to force the .msi "run as Administrator"

Xin Liu (Person Consulting) wrote:
We have a .msi file built from Wix toolset which calls one of the VS SDK tool.

Please be more explicit. Which tool? As a custom action or a build-time tool? Can you show a code fragment?



--

sig://boB

http://bobs.org
Bob Arnson
2007-02-27 03:31:26 UTC
Permalink
Post by Xin Liu (Person Consulting)
Our .msi calls the regit.exe which comes from Visual Studio SDK 2005
during installation. It is defined in custom action.
Regit.exe is not redistributable; you shouldn't be using it to register
packages. Instead, extract the registration information and put it in
the Registry table to let MSI manage the registration.
--
sig://boB
http://bobs.org
Xin Liu (Person Consulting)
2007-02-27 07:56:17 UTC
Permalink
How to extract the registration information? I heard there are some tools which can output a Wix include file containing the registration information. But regit.exe doesn't provide that functionality.

Thanks,
Xin

From: Bob Arnson [mailto:***@bobs.org]
Sent: Tuesday, February 27, 2007 11:31 AM
To: Xin Liu (Person Consulting)
Cc: wix-***@lists.sourceforge.net
Subject: Re: [WiX-users] How to force the .msi "run as Administrator"

Xin Liu (Person Consulting) wrote:
Our .msi calls the regit.exe which comes from Visual Studio SDK 2005 during installation. It is defined in custom action.

Regit.exe is not redistributable; you shouldn't be using it to register packages. Instead, extract the registration information and put it in the Registry table to let MSI manage the registration.




--

sig://boB

http://bobs.org
Bob Arnson
2007-02-27 16:20:46 UTC
Permalink
Post by Xin Liu (Person Consulting)
How to extract the registration information? I heard there are some
tools which can output a Wix include file containing the registration
information. But regit.exe doesn't provide that functionality.
Take a look at the tallow tool in WiX v2 or heat in WiX v3 to extract
self-registration information. A more reliable method is to translate
the source registration directly -- such as .rgs files, which are
basically just a twist on registry format.
--
sig://boB
http://bobs.org
Julien R.
2007-02-27 15:21:39 UTC
Permalink
Make sure all customs actions needing administration privileges are run
deferred with the NoImpersonate bit set.

You SHOULD NOT assume client side of your MSI is running with administration
privileges, it is a critical design mistake. Actions needing administration
privileges must be performed by the windows installer server. Therefore it
is highly recommended your bootstrapper to be marked with "asInvoker" in the
RequireExecutionLevel marker of the manifest.

Read carefully this blog:
http://blogs.msdn.com/rflaming/archive/2006/10/01/uac-in-msi-notes-what-are-the-hurdles-in-windows-vista-logo-compliance-related-to-uac-and-msi.aspx
Post by Xin Liu (Person Consulting)
We have a .msi file built from Wix toolset which calls one of the VS SDK
tool. So if the .msi is ran in Vista, even if you are a member of
Administrator group, it will failed. However, if run it "as Administrator"
(Right click cmd.exe, choose "Run as Administrator", then call the .msi
from the cmd.exe), operation succeed.
So is there a method in Wix to force run the .msi as Administrator.
Thanks,
Xin Liu
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
--
View this message in context: http://www.nabble.com/How-to-force-the-.msi-%22run-as-Administrator%22-tf3292742.html#a9184321
Sent from the wix-users mailing list archive at Nabble.com.
Continue reading on narkive:
Loading...