To inspect an MSI for paths and items included use SuperOrca. This is a great free tool.
Use WIX to create installer and setup projects. Wixwiki.com
Wednesday, December 15, 2010
Thursday, December 9, 2010
Elevating an Exe's privileges
Resending this, I missed one thing the first time
To get an executable to always request elevation when run, create a file with the following in it. The file name will need to be in the format like this:
yourexecutable.exe.manifest
You will also need to replace the highlighted section with the name of the executable you will be embedding the manifest in.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" name="ElevationTest" type="win32"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
After you do that, open a Visual Studio Command prompt and run the following:
mt.exe –manifest arg1 -outputresource:arg2;1
Where arg1 is the name of the .manifest file you just created and arg2 is the name of the executable you want to embed the manifest into. Don’t forget the ;1 on the end, it is not a typo.
Courtesy of Chris Stoleworthy
To get an executable to always request elevation when run, create a file with the following in it. The file name will need to be in the format like this:
yourexecutable.exe.manifest
You will also need to replace the highlighted section with the name of the executable you will be embedding the manifest in.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" name="ElevationTest" type="win32"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
After you do that, open a Visual Studio Command prompt and run the following:
mt.exe –manifest arg1 -outputresource:arg2;1
Where arg1 is the name of the .manifest file you just created and arg2 is the name of the executable you want to embed the manifest into. Don’t forget the ;1 on the end, it is not a typo.
Courtesy of Chris Stoleworthy
Subscribe to:
Posts (Atom)