wix,custom-action , How to launch executable after installation (exe is delivered by .msm)

How to launch executable after installation (exe is delivered by .msm)


Tag: wix,custom-action

I did everything as explained in tutorial, but my executable wasn't launched after product installation completed. There is a nuance that my executable is delivered with .msm module, so in .wxs file for .msi I do the following to launch application:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <!-- I omit here features and elements which are irrelevant to the question-->
    <Feature Id="Configurator" Display="hidden" Level="1">
        <MergeRef Id="MergeConfigurator"/>
        <UIRef Id="WixUI_Minimal"/>
        <Publish Dialog="ExitDialog" Control="Finish" Event="DoAction"
                 Value="LaunchConfigurator">WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed</Publish>
    <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="!(loc.ExitDlgCheckBoxText)" />
    <Property Id="WixShellExecTarget" Value="[#SystemConfigurator.exe.81c0fa8f-9a8e-49d8-9dc2-ce01ca163146]" />
    <CustomAction Id="LaunchConfigurator" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
    <DirectoryRef Id="TARGETDIR">
        <Merge Id="MergeConfigurator" SourceFile="$(var.MergeModulesPath)\ConfiguratorSetup_$(var.Platform).msm" DiskId="1" Language="1033"/>

For the property with Id=WixShellExecTarget I have tried to pass value both with and without GUID (this is Package/@Id of .msm with my executable). I opened my .msi with Orca and saw the exact ID of my executable (it's SystemConfigurator.exe.81c0fa8f-9a8e-49d8-9dc2-ce01ca163146, that's why I pass this very value).

But what it's wrong?

I logged installation process using /l*v option, and there is a portion from log:

Action 18:47:57: LaunchConfigurator. 
Action start 18:47:57: LaunchConfigurator.
MSI (c) (54:68) [18:47:58:106]: Invoking remote custom action. DLL: C:\Users\AAGENO~1\AppData\Local\Temp\MSIB233.tmp, Entrypoint: WixShellExec
MSI (c) (54:08) [18:47:58:106]: Cloaking enabled.
MSI (c) (54:08) [18:47:58:106]: Attempting to enable all disabled privileges before calling Install on Server
MSI (c) (54:08) [18:47:58:106]: Connected to service for CA interface.
MSI (c) (54!04) [18:47:58:476]: Note: 1: 2715 2: SystemConfigurator.Client.exe.81c0fa8f-9a8e-49d8-9dc2-ce01ca163146 
MSI (c) (54!04) [18:47:58:476]: Note: 1: 2715 2: SystemConfigurator.Client.exe.81c0fa8f-9a8e-49d8-9dc2-ce01ca163146 
Action ended 18:47:58: LaunchConfigurator. Return value 3.
MSI (c) (54:34) [18:47:58:476]: Note: 1: 2205 2:  3: Error 
MSI (c) (54:34) [18:47:58:476]: Note: 1: 2228 2:  3: Error 4: SELECT `Message` FROM `Error` WHERE `Error` = 2896 
DEBUG: Error 2896:  Executing action LaunchConfigurator failed.


Error 2715 means that the file key you're using isn't actually in the file table. Assuming it's referring to SystemConfigurator.exe.81c0fa8f-9a8e-49d8-9dc2-ce01ca163146 I would open the MSI file with Orca and see if that is the correct value AND keep in mind that Windows Installer proiperties are case-sensitive so if if it really is upper-case then use upper case. Make sure it really is a dash too, and not an underscore.


WiX – copy arbitrary files

The folder where my setup.exe is located contains a subfolder CALhaving files named something like xyz1234.cal – their names vary from customer to customer. These files have to be copied into a folder CAL in the target directory. So I created a CustomAction and a C# dll which uses the...

Should a WiX web installer and stand-alone installer both show up in Add/Remove programs?

We have two WiX installers that use our own BA. One installer gets all the packages from the web, while the other gets all the packages from the exe. We call them "Web" and "Full" installers. We have a case where a user might install one package from the web...

Retrieve x64 Program Files path from 32-bit process

First some background. I have created a WPF bootstrapper application for my WiX installer where I need to retrieve and display the default install location. Unless I am doing something wrong it appears the executable created by WiX is always 32-bit even if my Visual Studio configuration is set to...

How to change Install button display text conditionally

Is it possible to change the "Install" button display text based on some condition i.e if fresh install then "Install" if upgrade then "Update"? Basically, on major upgrade i am skipping some of my custom dialogs (which are shown on fresh installation) so on InstallReady dialog i want to show...

Unable to access TextView of the the Custom ActionBar

I am using different layout and showing into action bar. I want to change value of TextView programatically which I used in layout. Here is my xml file: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/splashscreen_background"> <TextView android:id="@android:id/text1" android:layout_width="?attr/actionBarSize" android:layout_height="match_parent"...

Is Component/@Guid attribute is a MUST in case of producing MergeModule

In my .wxs file for components, there are only components with single file, and this is the case for generatable GUIDs. But it seems to me that for .msm (merge module), component's GUID should be explicitly specified. Or I'm free to use Guid="*" and that would be OK? I tried...

How to launch executable after installation (exe is delivered by .msm)

I did everything as explained in tutorial, but my executable wasn't launched after product installation completed. There is a nuance that my executable is delivered with .msm module, so in .wxs file for .msi I do the following to launch application: <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product> <!-- I omit here features and...

Dealing with shared registry values

I'm working on an installer that's creating registry values and deleting them on uninstall. However some of the registry values I'm working with could be shared with other companion applications. I only want it to remove the registry values if it's the only component using those registries. If other apps...

Msi & exe singing Microsoft Authenticode requirments

I am trying to sign my small application, following this tutorial: In the tutorial they did not ask me to purchase Microsoft Authenticode Certificates I need to Removes "Unknown Publisher" security warnings; after I signmy msi and exe files I still have "Unknown Publisher" Can I sign my msi or...

ExePackage does not run elevated although PerMaschine is set to “yes”

In my WIX-Bundle, i have an ExePackage like the following: It executes a ConsoleApplication which tries to open an write to a HKLM-Registry entry which fails when triggered out of the bundle. In cmd, everything works fine when executed as admin: <ExePackage Id="SqlServerAuthConfig" DisplayName="Configuration of SQL-Server Auth-Mode" Compressed="yes" PerMachine="yes" Vital="yes"...

How to define WIX agent requirment in TeamCity?

I have add a WIX installer project to solution in Visual Studio 2013. The project is built with every commit on TeamCity. There are several build agents connected to TeamCity cloud, but only some have WIX installed. Usually I would add the build agent requirement, so only the computer with...

WiX - not executing custom action during update

I have two custom actions (immediate and deferrend). I would like to skipping actions during upgrade. I tried: <Product Id="*" Name="$(var.ProductName)" Language="1033" Version="$(var.Version)" Manufacturer="$(var.Manufacturer)" UpgradeCode="{GUID}"> <MajorUpgrade DowngradeErrorMessage="Newer version is already installed." /> <Custom Action='CAa' After='InstallInitialize'>NOT Installed AND NOT PATCH</Custom> and: <Custom Action='CAa' After='InstallInitialize'>NOT Installed AND NOT...

WiX: VS2013 How to change output directory

I have a WiX project in VS2013. The output directory in wixproj is: bin\$(Platform)\$(Configuration)\ by fact it is \bin\x64\Release\en-us How and where I can change the real output to \bin\x64\Release\ ?...

How to add assemblies to WiX toolset setup, which comes from a nuget package?

I use the Votive-project type to create a setup with the WiX toolset. I know, that I can add an assembly like this to the setup: <File Id="FILE_myproject.dll" Source="$(var.myproject.TargetPath)" KeyPath="yes" /> What I don't know is, how can I add referenced assemblies to the setup, which comes in a nuget...

WiX: Install component based on ComboBox selection

I'm trying to create an installer which installs some components based on the selection of a Combobox but it seems like the condition isn't working. I declared the Combobox as the following: ... <UI> <ComboBox Property="Option"> <ListItem Text="Red" Value="red" /> <ListItem Text="Blue" Value="blue" /> <ListItem Text="Green" Value="green" /> </ComboBox> ......

Create a new user with an underscore in the name

I am trying to create a user in WiX, using the following XML: <Component Id="cmp_MyNewFolder" Guid="*"> <util:User Id="MyNewUser" CreateUser="yes" Name="DUMMY&#95;USER" Domain="[ComputerName]" Password="" PasswordNeverExpires="yes" RemoveOnUninstall="yes" UpdateIfExists="yes" /> <CreateFolder> <util:PermissionEx GenericAll="yes" User="DUMMY&#95;USER"/> </CreateFolder> </Component> I've removed the GUID and password for this post, so the issue isn't with those. The problem is...

WIX-Installer ServiceControl “sufficient privileges” error

Visual Studio 2015 RC Wix v3.10.0.1726 I am creating a installer for a windows services. I've tested the service with InstallUtil and it runs fine. Unfortunately I'm having a bit of troubles with wix, here is the exact error - "Service 'Service Name' failed to start. Verify that you have...

Deploy Any CPU build with WiX to x86 using MSBuild

I have a set of solutions that build a complete .NET Any CPU application. I have a WiX project that will deploy that application as x86 and I can run this all manually in Visual Studio 2013 without any issues. Now I'm trying to get this to work in MSBuild...

WiX - upgrade services

I Installed my application in version. Services have been installed on the user account (with username / password). How to make an update, so the user does not have to specify login and password again? <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />   <Component Id="MyService" Guid="MyGUID"...

WixSharp inject multiple Custom CLR Dialogs

Using WixSharp, we can insert a custom System.Windows.Forms window as dialog . project.InjectClrDialog("ShowCustomDialog", Dialogs.InstallDirDlg, Dialogs.VerifyReadyDlg); [CustomAction] public static ActionResult ShowCustomDialog(Session session) { return WixCLRDialog.ShowAsMsiDialog(new MyCustomDialog(session)); } The MyCustomDialog is derived from WixCLRDialog class. If I have consecutive custom dialogs ( done in System.Windows.Forms ) to show. How do I insert...

Wix- Unable to write to XML file when using Property Name as Value

I am trying to write a value into an XML file during the installation, this value comes from a text field which user fills it during the installation stage. In my GUI file for the installer I have the following EditField: <Control Id="LogEdit" Type="Edit" X="45" Y="155" Width="100" Height="18" Property="LOGVALUE" Text="{80}"...

Single Package Authoring

I am trying to create Single Package Authoring installation using following tutorial - http://www.egoroff.spb.ru/blog/62003.html Main wix file is following: <?xml version='1.0' encoding='windows-1252'?> <Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'> <Product Name='Foobar 1.0' Id='GUID' UpgradeCode='GUID' Language='1033' Codepage='1252' Version='1.0.0' Manufacturer='Acme Ltd.'> <Package Id='*' Keywords='Installer' Description="Acme's Foobar 1.0 Installer" Comments='Foobar is a registered trademark of Acme Ltd.'...

executing an vb script from another project bud in the same solution in C#

i am trying to call a VB script that i made that in the same solution bud in another project, it is a C# project with windows forms and WIX. i am building an .MSI installer and when i arrive at a certain form i want it to execute a...

WiX error build target

I'm trying to create my MSI setup with WiX and MSBuild command which deploy my img.png into a repertory and i have this error : "MSB4019: project imported "C:\Program Files\MSBuild\Microsoft\WiX\v[[Version.M ajor]].x\Wix.targets" was not found. " Make sure that path of declaration are correct In this line : <Import Project="$(WixTargetPath)" />...

Module failed to register HRESULT / Error 1001

My first question is about the error below : Module [Path/Name of dll].dll failed to register. HRESULT -2147024769. Contact your support personnel. I can continue the installation but i want to get rid of this error if possible. The second question is about the following error : Error 1001. Exception...

command line Start.Info.Argument error

I would like run this command with C# : "%WIX%/bin/heat.exe" dir "C:\Documents and Settings\APP" -gg -sfrag -cg Appli -out wixappli.wxs I have this code (Program.cs) : System.Diagnostics.Process process1 = new System.Diagnostics.Process(); process1.StartInfo = new System.Diagnostics.ProcessStartInfo("cmd.exe"); process1.StartInfo.Arguments = String.Format("/k \"%WIX%/bin/heat.exe\" dir \"{0}\" -gg -sfrag -cg Appli -out wixappli.wxs ", @"C:\Documents and...

How to change $(var.Platform) from x86 to Win32 in Wix

I have a Visual C++ 2013 solution including many C++ projects and a WIX installer project. On x64 platform, everything is okay. But On x86 platform, $(OutDirectory)$(Platform)$(Configuration) of C++ projects is ...Win32..., but $(OutDirectory)$(Platform)$(Configuration) of WIX is ...x86... What can I do?

Trigger uninstall and Repair of previously installed product

i am new to Wix toolsets. i have successfully made my first installer in Wix but now i am confused about my software updates which usually are minor. in my installer i want to check if user have any older version installed then i want to show him three options...

Wix Toolset install C++ 2010 Redistributable

I can integrate together on installation package Wix Toolset the installer Microsoft Visual C ++ 2010 redistributable? I tried this with a custom action, but it does not install if another installation is in progress. Someone would have any suggestions of how to do? Also another question. I can call...

Cant find File System, Registry icon in WIX setup project in Visual Studio

I installed WIX in my machine. I followed the video of https://www.youtube.com/watch?v=CoFPyIbcqN8enter link description here I can not find any way to add File Systems, no icon for it, no context menu entry on project. I am using Visual Studio 2012....

How to change text style of the Title & Description text controls of a WiX dialog?

Where can I find information of the Style values for a text control of a WiX dialog? For example, the default text style used for the WiX dialog Title control is {\WixUI_Font_Title} & I would want to use the same style but to change the color to White. For the...

Package the .Net redistributable in my burn bootstrapper

I'm trying to package the .Net 4.5.2 redistributable into my burn application, by following the instructions on this page. But it fails to find the file in the temp burn location. According to the log burn tries to find the file here: [0A14:09C4][2015-05-12T16:48:52]w343: Prompt for source of package: NetFx452Redist, payload:...

How do I install the Wix extension on after a Visual Studio 2013 Update?

I have installed Wix 3.9 on VS 2012. Recently, I just got VS 2013 and I am not sure how to install just the extension on there? How do I do without uninstalling wix 3.9 and reinstalling it back again?...

how to skip dialog based on selected feature

I want to add a custom dialog in the UI sequence after the Feature selection (Customize) dialog. The feature selection is done through a Feature tree. How can I figure out if a particular feature was selected and launch the custom dialog? Right now I am having the following codes...

Error allocating file install folder in WIX 3.9

I am setting up the installation locations for my installer. However, it throws an error when I try to set the locations. Source code: <?xml version="1.0" encoding="UTF-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Product Id="*" Name="Wix_setup" Language="1033" Version="" Manufacturer="Frank Jansen" UpgradeCode="37a42e55-dea8-47da-8f4f-fb065dd38a9e"> <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> <MajorUpgrade DowngradeErrorMessage="A newer version of...

Set location of binaries in wixproj file

I am using Wix 3.9 and when I run a continuous integration build in TFS I get an error heat.exe: The directory could not be found because TFS is putting binaries in a different location to my local machine, so the project will build locally but not on TFS. In...

Service dependencies are causing my wix msi to force a reboot on uninstall

I have spent the past 3 days running in-place while tracking down the cause of forced reboots on my system, but have finally narrowed it down to a very specific cause. I have a service suite that I am working on in Wix. There are 10 msi's that are all...

SHFileOperation cannot remove folder

I am writing a C++ Custom action for WiX that will be called during installation to remove any leftovers installed by the installer. Consider the following code: UINT __stdcall DeleteResidue(MSIHANDLE hInstall) { HRESULT hr = S_OK; UINT er = ERROR_SUCCESS; LPWSTR lpFolderPath = NULL; std::wstring temp; SHFILEOPSTRUCT shFile; hr =...

Namespace prefix 'bal' is not defined

I've got this error. Since I put below code in the Bundle.wxs. <BootstrapperApplicationRef Id="WixExtendedBootstrapperApplication.Hyperlink2License"> <bal:WixExtendedBootstrapperApplication ThemeFile="Resources\COTheme.xml" LicenseUrl="http://xxxxxx /> </BootstrapperApplicationRef> Could please anyone help me?...

Change Wix Product version number using NANT XmlPoke

I ran into this issue recently - when I try to replace the Wix Product version number using NANT XMLPOKE task, it returns the following error message "No matching nodes found". <xmlpoke file="..\Setup\abc.wxs" xpath="//Wix/Product[@Version]" value="${version.label}" > Initially I thought that this was an issue with XPATH statement that I wrote....

Creating a silent installer for a MSI

What is the best way to make a silent installer (or unattended) for a program that was already created and has a msi installer? At work I'm told to create an installer that is automated and does all the interaction with the user automatically so that the user essentially just...

WIX XMLConfig Different Root Element Names

I'm running into an odd issue with a "config" msi I'm writing in WIX that uses XMLConfig to check for, delete and then create the new values in a single xml file. Since I Discovered WIX I've been packaging a lot of our manual configuration processes so this is my...

No environment variable set after installation of MSI generated by WIX

My WSX file looks like this: https://gist.github.com/pyeremenko/891eceb779197e4be240#file-sample-wxs-L23-L25 Copying works fine, i.e. exe file available in Program Files/test/my_test folder, but I can't access TEST env variable after installation via echo %test% (of course I reload cmd) I tried also to look for it in System Properties > Environment Variables, but there...

How to add several ports to FirewallException in Wix?

I use property PORTS to pass some http ports to my installation. Then these ports will be stored into init file and used by the application. I need to add these ports to FirewallException? But following code does not work: <Component Id="fwException" Guid="MyGUID"> <Condition>Privileged</Condition> <RegistryKey Root="HKCU" Key="Software\Company\[ProductName]"> <RegistryValue Name="fwException" Value="1"...

Database changes management in installer updates

How can I run a series of database scripts depending on some condition? Basically I want to check build installed on user's machine and then want to run all the scripts till the build in the installer. Say user has build number 4.10 installed and if he goes to install...

How can I change the text in the Wix installer dialog?

My text message is stuck to "Install My Product to:" How can I change this? ("My Product" is the name of my product and the string above is resolved based on the Name attribute in my Product.wxs). I have 2 dialogs and the second requires a different message....

Detect if 32 or 64 bit windows and define var

I want to install Visual C++ 2012 redistribute with my app. I would like to install the appropriate version based on the architecture of the machine. eg if platfrom is x86 vcredist_filename = Microsoft_VC120_CRT_x86.ms else vcredist_filename = Microsoft_VC120_CRT_x64.ms Ive tried to accomplish in many differents ways but I cant get...