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

前端 未结 3 1645
无人及你
无人及你 2020-12-14 08:07

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 wi

相关标签:
3条回答
  • 2020-12-14 08:08

    I would suggest you ask the user with a custom form if the application should startup automatically and then create a link in the users startup folder.

    0 讨论(0)
  • 2020-12-14 08:09

    Take a look in the registry at HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run. If you want it to start per-user then look in HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run. If you want it to start when Windows starts, without requiring a user to log on, that's a Service.

    0 讨论(0)
  • 2020-12-14 08:22

    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" />
    
    0 讨论(0)
提交回复
热议问题