问题
I have this bit in a Component in my WIX Installer
<util:User Id="CIUSER" CreateUser="yes" UpdateIfExists="no" Name="myuser" PasswordNeverExpires="yes" Password="noneofyourbusiness">
<util:GroupRef Id="Users" />
</util:User>
I also use this as a reference in other parts of the code to set directory permissions.
It seems like a new user profile gets created each time I install my product. So if anything id placed on the desktop, logging in as this user doesn't see it from install to install.
For the most part I just have this code in the installer to assist people who are setting our system up. This is a desktop application, but it is sold as a single "device" and isn't a general use computer and we are creating a non-privledged account to execute our application under.
This is WIX 3.5. Anyone see anything like this before or know what I may be doing wrong?
It creates the user fine and sets the proper permissions, just multiple profiles now exist under users in Windows 7.
回答1:
Set RemoveOnUninstall
attribute to no
, the default is yes
. You are really creating a new user with every installation and so the profiles are distinct.
The failure to remove the profile on uninstall turns to be a known defect in WiX 3.5.
It is independent of UpdateIfExists
attribute, and it also does not matter whether the product is uninstalled and reinstalled, or upgraded.
Rob Mensching's note on the defect says that custom action bugs will not be fixed before WiX 4.0. This also reminds us that all of wixutil is implemented using a custom action and that we all are technically able to create a better custom action for handling user accounts and include it in the MSI as a binary or a script, provided that the issue is urgent enough. Or maybe just one to remove inactive user profiles on uninstall.
(Credit for this answer goes largely to additional research conducted by question author. My own first shot at the cause has been found to be wrong. Thank you.)
来源:https://stackoverflow.com/questions/10420673/wix-user-element-seems-to-create-a-new-user-profile-on-every-install