开发者

How to create a per-user Startup folder shortcut in a per-machine installation?

开发者 https://www.devze.com 2023-02-06 15:10 出处:网络
I am installing an application using WiX 3 for all users (property ALLUSERS=1). I would like to create a shortcut to my application in the current user\'s Startup folder. How can I override the ALLUSE

I am installing an application using WiX 3 for all users (property ALLUSERS=1). I would like to create a shortcut to my application in the current user's Startup folder. How can I override the ALLUSERS=1 for my Startup folder shortcut only?

I am using the WiX Shortcut el开发者_如何转开发ement:

<Shortcut Id="MyAppShortcut" Directory="StartupFolder" ... />

but the "StartupFolder" resolves to the 'All Users' Startup folder because of the per-machine installation.

Any suggestions?


Installing the shortcut only for the current user doesn't seem like a good idea: what if I install your software under an account I only use for administrative tasks such as installing software? Because I try to follow best practices and Don't Run as Administrator!

If you're trying to run a single instance of the software in the background for the whole system, then you probably should write your software as a Windows Service instead of creating startup shortcuts. Wix has support for installing a service.

If you want a UI component to configure/manage the service to live in the tray, then you can then still install a shortcut for a separate executable to the All Users start up folder. That way all users can interact with the service, but the service itself is launched only once.

0

精彩评论

暂无评论...
验证码 换一张
取 消