How to restrict the user to double clicking on msi package - wix

My requirement: MSI package installation through silent mode only using power shell script. Here I am unable to restrict the user to launch MSI by double clicking on the MSI setup. What is Wix installer code need to be added for this.

The typical technique is to define a secure custom public property such as SCRIPTDRIVEN and then write a Launch Condition that requires SCRIPTDRIVEN=1 or it aborts. Then in your PowerShell pass SCRIPTDRIVEN=1.

Related

Burn - unwanted impersonation for MsiPackage

I am using WixStandardBootstrapperApplication to chain the install of .Net framework followed by my standard MSI package. My MSI package needs to identify the invoking user to write to the %USERPROFILE% location, however Burn requests privilege elevation from the start and runs my entire MSI under the elevated context. My MSI package worked correctly before being bundled in the bootstrapper - in that it only elevated after the InstallUISequence. Is there a way around this?
Burn installs all the per-machine packages in a chain from a single elevated process. Likewise, per-user packages are installed from a single unelevated process. There's no option to change that behavior.

Run wix immediate custom action with elevated privileges

We are populating the IIS websites to a drop down list based on the instructions provided here: Bind IIS local websites in dropdown list of wix installation?
The custom action works when the msi is launched from admin command prompt, however there is a failure when the msi is launched with out admin rights. Having the Impersonate value to no in the CA does not elevate the custom action execution with administrator privileges.
Is there a way to launch the msi with administrator privileges? How to execute immediate custom action in UI sequence with elevated access rights?
Thanks.
It's unfortunate that the IIS API (ServerManager class in .NET) requires elevation. What I do in this situation is create a bootstrapper for the MSI and mark it to require elevation.
In order to resolve the issue of running the Immediate custom action with admin rights, we had to embed the msi into an exe and display the error message if exe is not run as administrator.
ChilKat Zip 2 Secure Exe creator software was used to create an exe. https://www.chilkatsoft.com/chilkatsfx.asp
Added the following snippet in wix project: <Condition Message="Launch installer with admin rights!">Privileged</Condition> in order to display error message if the it is run in non admin mode.

Run WIX installer package in a non-User mode and Provide answer file to a WIX installation package

it is possible to install wix installer in non user mode and it take the input from the answer file this is the screen
answer file will put the Server name and data base name.
<serverName>localhost\SqlExpress</serverName><databaseName></databaseName>
This is the my answer file
Windows Installer does not have a facility for answer files. Instead, automated behavior is provided through property settings.
The primary way to set properties for an installer operation is via the msiexec command-line. You would probably want to use one of the quiet/unattended modes, too.
Another way, since an MSI file is a database, is to set properties in a copy of the MSI.

How to run WIX bootstrap built exe to run in silent mode?

Is it possible to run the exe built using WIX burn bootstrap to run in silent mode? I need to do this in order to skip the UAC prompt. Are there any better ways to skip the UAC prompt using the WIX project itself? Without making any changes to the registry keys manually.
Burn supports silent installations. Use the /quiet switch to run installation without any user interface. This will not show the UAC prompt.
AppInstaller.exe /install /quiet
If your installation requires elevated rights to install properly, run it from another already elevated process - either command line, or a management software.

How to get wix bootstrapper to start extracting installer immediately

My installer has a license dialog, so I don't see the need to display one in the bootstrapper. This earlier question had an answer which doesn't display the license agreement, but still requires the user to click the install button. I'd like to immediately extract and run .msi without requiring any user input. Is there a way to skip the dialog completely?
There is option called /passive which should do what you want: start installation automatically, showing the user interface.
However, the problem is that it can't be set by default - you'd have to wrap your .msi into some kind of .exe which calls the msi with specific command line.
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Burn-Launch-using-passive-option-as-default-td7591613.html