Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WiX: How to register application to start when Windows launches?

I'm exploring distribution of .NET desktop applications with MSI generated by WiX.

So far it works great. But I've got a few questions, googling can't help out with.

What's the advised way of registering application to start when windows launches (in WiX)?

What WixUI could I use and how?

Notes:

  • The application is not a Windows Service and should not be registered as such.
  • It would be nice to let user to disable that option in the setup process.

Thanks in advance!

like image 704
Rinat Abdullin Avatar asked Jun 27 '09 11:06

Rinat Abdullin


People also ask

How does WiX Installer work?

The WiX tools follow the traditional compile and link model used to create executables from source code. At build time, the WiX source files are validated against the core WiX schema, then processed by a preprocessor, compiler, and linker to create the final result.

What is WiX bundle?

A bundle is a collection of installation packages that are chained together in a single user experience. Bundles are often used to install prerequisites, such as the . NET Framework or Visual C++ runtime, before an application's .


1 Answers

I found this using Google (Providing automatic program start via the Registry); it also includes adding UI. Don't forget you should also provide an option outside the setup to enable/disable autostart.

The basic Wix for it is:

  <Property Id="ASSISTANCE_START_VIA_REGISTRY">1</Property>    <!-- Auto-start via Registry -->   <Component Id="MerliniAssistanceAutostart" Guid="Place-your-own-GUID-here">     <RegistryValue Id="MerAs.rst" Root="HKMU" Action="write"                    Key="Software\Microsoft\Windows\CurrentVersion\Run"                    Name="Merlinia Assistance Client"                    Value="[INSTALLDIR]Assistance.exe"                    Type="string" />     <Condition>ASSISTANCE_START_VIA_REGISTRY</Condition>   </Component>    <ComponentRef Id="MerliniaAssistanceAutostart" /> 
like image 170
Shay Erlichmen Avatar answered Sep 22 '22 12:09

Shay Erlichmen