I want to run an executable with command line parameters in WiX. How do I pass parameters?
I would add that I need to run a console EXE file which is contained by the MSI file to be installed.
I tried to add parameters somewhere in the example, step 3 at How To: Run the Installed Application After Setup, but I have not found out how to achieve this.
Simply set the ExeCommand attribute to the command line you want. For the custom action used in the article you mentioned, the ExeCommand attribute can contain command line options.
The mostly good point in creating installers is not to use a prompt by itself. This is ugly and you need to be patient on administrator rights, trying to start third-party applications.
Instead of this you can create a deferred CA, using C++, C# or VB.NET. It is a bit longer, needs to know "some" syntax and so on, but you can control whatever you want. To start with, here are some resources:
Deferred custom actions with WiX (simple how-to)
CustomAction Element (at WiX home on SourceForge)
Related
When Burn runs an MSI installer, using MsiPackage, I'd like the MSI's log file to have a custom name, like MyProductName.log. I'd also like to append to an existing log file (with same name).
In InstallShield's Basic MSI Project's Release view there is an entry "MSI Command-Line Arguments" where you can enter a custom log file name:
/l+* "%TEMP%\MyProductName.log"
The "+" will append the log to an existing file.
Burn can pass public properties to the MSI, but I don't see a way to do what I want.
It looks like I'll need to write code (custom Burn bootstrapper) to run after the MsiPackage is installed (or uninstalled) to copy the contents of the log file (in the Burn variable defined in LogPathVariable) to the file with the custom name.
You can use the LogPathVariable attribute of the MsiPackage element to provide a custom log file name ...
See: http://wixtoolset.org/documentation/manual/v3/xsd/wix/msipackage.html
Also: https://support.firegiant.com/hc/en-us/articles/230912207-Pass-Properties-to-MsiPackage-from-Bundle-
To do what I needed, I wrote a simple bootstrapper, which became more complicated as I addressed things like passing installer properties to the bootstrapper, giving warnings if installing an x86 installer on an x64 OS (we encourage customers to use and x64 installer), etc.
I have an application with a bootstrapper that installs multiple components below it. The code below uses ninject to have a loosely coupled database layer.
With regards to the bundle/bootstrapper, I would like to move the database layer out into a separate msi in order to support optional data layer choices on install (e.g.: radio buttons to install SQLite/SQLExpress/MySQL etc..).
I am struggling to figure out how to get the install directory working though, as the database components needs to install into the root/install directory of the main application. (rather than using the gac etc).
How can I do this? I have tried the steps mentioned here: How to use properties to set the installation path? but to no avail. I must have something wrong.. but given the code is spread over 5(ish) files, it seems a little large to load here!
Any pointers to get started trying to implement this, or should I go ahead and upload the code?
The method you refer to should work. Note however that the name of the property given in
<MsiProperty Name="INSTALLLOCATION"
should match the name used in wxs file of the corresponding MSI package. Typically if the MSI was created based on WixUI_InstallDir template the name would be APPLICATIONFOLDER and in the default template without the UI it is INSTALLFOLDER.
I have a msi file im trying to embed an .bat file converted to .exe
what I've done so far in orca>
add binary
set name, put in binary data(pointed the .exe)
went into customaction
set actionname, type 2, sourcename, left target empty
went into installexecutesequence
put in my actionname, left condition empty, put in sequence After installfinalize 6600
I put in 6601
now when I run this MSI.
installs the software, but my .exe doesn't run until I hit the uninstall button and prompts a message saying:
A program run as part of the setup did not finish as expected
any idea what im doing wrong?
I want to have this MSI run the .exe after installation.
thanks!
I assume this EXE is manipulating the system in any way, which means you need to change the CustomAction Type to 3074 and place it before InstallFinalize.
Does this script need to run on installation, uninstallation and repair?
If only during installation: set NOT REMOVE as condition.
Anyways: It is not a good idea to embedd a compiled batch file into a MSI file. Most actions you need to do can be done using Standard Windows Installer functions. If you need to add functionality to the MSI at least don't compile the batch file for the following reasons:
nobody knows what the batch is doing
no standard logging for this batch file
no uninstallation/repair of what the batch is doing
no customization of the batch possible if needed
I have a file which is not installed:
<Binary Id="LaunchMyExe" SourceFile="$(var.Project.DependenciesPath)/myProgram.exe" />
And I would like to run it quietly during the InstallUISequence but I can't..
How to link the BinaryKey of this file to the CAQuietExec custom action?
Any sample appreciated.. thanks!!
You'll have to author another custom action, which will extract that file from Binary and place to some folder known to your "LaunchMyExe" action, for instance, Temp folder.
Is your program a console application? If it's a regular GUI application, you, most probably, don't need CAQuietExec action because you can run it directly with CustomAction element.
Set these properties:
BinaryKey="LaunchMyExe" - this is the key into the Binary table where your exe is stored.
ExeCommand="" - this tells WiX and Windows Installer you want type 2 custom action.
set other properties as appropriate.
If your application is a console one, then you would need WiX Quiet Execution Custom Action to hide the console window while it runs.
These links would help you:
Quiet Execution Custom Action gives examples on how to use QtExec action.
How To: Run the Installed Application After Setup for an overview on using custom actions.
So I have a Wix 3.0 project that installs an IIS7 Native Code Module. When uninstalling I would like to be able to shut down the IIS7 application pools before deleting the file so that a reboot is not necessary.
I am using the appcmd utility to shut down the app pools in a CustomAction element, but when I attempt to do an uninstall I get this error before the customaction is ever invoked:
The setup must update files or
services that cannot be updated while
the system is running. If you choose
to continue, a reboot will be required
to complete the setup.
I have the "After='InstallInitialize'" property set on the CustomAction, because the documentation says that any deferred/not-impersonated custom action must come between InstallInitialize and InstallFinalize.
So is there some way to have a custom action execute before this check for files in use is made? Or disable this check for a given file, or make the check happen later in the sequence?
Yes, you can specify the order for actions to occur by modifying the Sequence column in the InstallExecuteSequence table within the MSI file.
Get the ORCA tool to examine the MSI file to see what I mean, and use a Javascript script to modify the MSI as appropriate.