I need to sign an installer executable for Windows using a p12 file.
Before signing, this EXE file icon has a "shield icon" on it indicating that it requires administrative privileges, as it should.
However, after I sign using the signtool and the following command:
signtool.exe sign /f mycert.pfx /p <password> /t http://timestamp.verisign.com/scripts/timstamp.dll /v "<file to be signed>"
the signing succeeds but the shield icon disappears. When I run the resulting executable, it fails because it is no longer running under administrative privileges.
What do I need to do in order to sign an executable and have it keep its administrative privileges?
You should set the requestedExecutionLevel to requireAdministrator in your app's manifest to declare it as needing administrative privileges.
I suspect that your app is named "install" or similar, and so the non signed-and-manifested version picked up the administrator requirement as part of backwards compatibility settings, but now it looks like a current application and so Windows checks to see which privileges it requests, and since it doesn't request any the app doesn't get elevated.
See Create and Embed an Application Manifest with Your Application
Depending on how the app is created also look at /MANIFESTUAC (Embeds UAC information in manifest) and /win32manifest (C# Compiler Options)
Related
How to run command in CMD with administrator privileges after user clicks install on NSIS? I use Zip2Exe.
Am I mistaken in thinking that installers ask for these permissions anyway?
Either way it looks like you may be out of luck you might have to use makensis instead.
https://nsis.sourceforge.io/mediawiki/index.php?title=Zip2Exe&oldid=4446
It only allows you to set some very basic installer options like the
name, directory and compression method. It's not possible to add a
license, sections, script code etc.
I am trying to create a setup that installs other programs on a desktop.
one of these files is a msp file and i run it like a normal exe file.
I have tried to open it like you would an msi file with no possitive result.
Can anyone help?this is how i currently try to run it.
this is the error i receive its in dutch but a rough translation is "cannot open this installation package. contact the provider of the file or check if it is a valid windows installer package.
Sorry it took a while , but i fixed the bug.
I used the msp file as an msi file.
I used the wrong parameter you need to use /p instead of /i
I have a installshiled project which generates setup.exe file. I'd like to enable silent install by generating proper setup.iss file. I ran the following command:
Setup.exe /r
which lunched the installer, but it never created the setup.iss file. I looked in C:\Windows as the documentation suggested, as well as some other locations (local directory, program files etc.)
Why isn't it created and how to fix?
Thanks,
Ok I found the problem, and a workaround:
The problem was that my msi project was a Basic MSI Project, as opposed to InstallScript and InstallScript MSI projects. This kind of project does not support reading a response file (aka setup.iss). However, there is a way to perform silent installation for the .msi / setup.exe file:
Setup.exe /s /v"/qn"
will do the trick.
All of this information can be found here
Another option is to explicitly state where you want the setup file generated, using the /f1 option:
Setup.exe /r /f1"C:\your\path\here\setup.iss"
Documentation on this can be found here, but here is a summary from that link:
Using the /f1 option enables you to specify where the response file is (or where it should be created) and what its name is, as in Setup.exe /s /f1"C:\Temp\Setup.iss". Specify an absolute path; using a relative path gives unpredictable results. The /f1 option is available both when creating a response file (with the /r option) and when using a response file (with the /s option)
I have inherited some InstallShield InstallScript projects.
I am currently using InstallShield 2009.
I cannot seem to create a log file when I run the setup.exe.
What command line options do I need to specify?
InstallShield has a method for creating a log file for the Setup.exe and Update.exe bootstrappers. You can simply use the /debuglog parameter from the command line when you run Setup.exe. This command line parameter can be used with the Setup launcher for Basic MSI, InstallScript MSI, and Web projects.
Here it is:
Setup.exe /debuglog
You will notice that a file called InstallShield.log has been created in the same folder as Setup.exe.
For more read >> http://www.installationdeveloper.com/686/using-log-files-in-installshield/
There is no such feature in InstallScript project types. The really good logging is in MSI project types. InstallScript really only has the ability to record a response file and generate a very terse logfile as part of a silent install. (/s /f1 /f2 arguments)
Setup.exe Command-Line Parameters
You can add registry settings which will tell Windows Installer to log your installation.
The registry settings you'll need are:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer]
"Logging"="voicewarmup"
"Debug"=dword:00000007
Once you run the installation, navigate to %temp% inside windows explorer and there will be .LOG files with a naming scheme of MSI#####.LOG.
NOTE: This should log all installations on your machine, so you may want to delete these registry settings when you're done.
I have a sharepoint feature installer packaged as a batch file. The users should be able to run the .bat file and install the feature themselves in their environment with the admin previliges. Is there any command i can include in my .bat file to run it with elevated previliges?
runas provides this functionality.
One other approach is to compile the bat file to exe. Using a utility such as http://www.bdargo.com/ you can add an "Manifest Token" which will prompt the user to allow it to run with elevated privileges.
Note: I'm not affiliated with that company.