I do this because when you try and add the localsystem account as: NT 
AUTHORITY\SYSTEM, it will not check the "Local System account" 
radiobutton under the "Log On" tab in the service properties.
It will instead select the "This account:" radiobutton and add NT 
AUTHORITY\SYSTEM as the username.
So what i do, is when the user selects what account to use in a dialog, 
i do the simple logic:
if (Local System is selected)
{
    SERVICEACCOUNTFULLNAME = "LocalSystem"
}
else
{
    SERVICEACCOUNTFULLNAME = "[WINDOWSDOMAIN]\[WINDOWSUSERNAME]"
}

where WINDOWSDOMAIN and WINDOWSUSERNAME are edit boxes in that dialog 
with these properties.
This way, i tackle both cases.
-When i add as account "LocalSystem", it actually selects the "Local 
System account" radiobutton under the "Log On" tab in the service 
properties.
-When i add as account [WINDOWSDOMAIN]\[WINDOWSUSERNAME] then the user 
account is added in the selected "This account:" radiobutton under the 
"Log On" tab in the service properties.

This is the only way i found to handle this situation without having to 
define 2 components, which i didn't like as a solution, don't ask me why 
:P I don't know either :)

John Bergman wrote:
> Can I ask why you are using SERVICEACCOUNTFULLNAME as a parameter, rather 
> than doing something like this?
>
>     <CustomAction Id='SetPermissionableUser' Property='PermissionableUser' 
> Value='[WINDOWSDOMAIN]\[WINDOWSUSERNAME]' />
>
> -----Original Message-----
> From: Stelios Kyprou [mailto:stelios.kyp...@formicary.net] 
> Sent: Tuesday, July 20, 2010 4:20 AM
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] [Wix-users] Installing a windows service based on 
> user give account
>
> Or i realised i can use Account and give it "LocalSystem". This way you can 
> have one component for both.
> In case anyone is wondering, you can do the following:
>
>     <Component Id='ServiceExeComponent' Guid='YOUR-GUID'
>       SharedDllRefCount='no' KeyPath='no' NeverOverwrite='no' Permanent='no' 
> Transitive='no'
>       Win64='yes' Location='either' Directory="INSTALLLOCATION">
>       <File Id="A_Executable" KeyPath="yes" Checksum="yes" 
> Source="$(var.A_FilesDir)\ALM_GC.exe" />
>       
>       <util:User Id="UpdateUserLogonAsService" UpdateIfExists="yes" 
> CreateUser="no" Name="[WINDOWSDOMAIN]\[WINDOWSUSERNAME]"
>              LogonAsService="yes"/>
>       
>       <ServiceInstall Id='ServiceInstall' DisplayName='Liquidity Bot' 
> Description='Liquidity Bot' Name='ALM_Bot'
>         ErrorControl='normal' Type='ownProcess' Start='auto' Vital='yes' 
> Account='[SERVICEACCOUNTFULLNAME]' Password='[WINDOWSPASSWORD]' 
> Interactive='no'/>
>  
>       <ServiceControl Id='A_ServiceControl' Name='ALM'
>         Start='install' Stop='both' Remove='uninstall' Wait='yes'/>
>     </Component>
>
> I have 4 properties:
> WINDOWSDOMAIN
> WINDOWSPASSWORD
> WINDOWSUSERNAME
> SERVICEACCOUNTFULLNAME
>
> SERVICEACCOUNTFULLNAME
>  is the combination of :[WINDOWSDOMAIN]\[WINDOWSUSERNAME] if we have a user 
> account. If we have a builtin account, SERVICEACCOUNTFULLNAME
> is: "LocalSystem" (for example)
> In case of a builtin account, the Password attribute is disregarded
>
> Bob Arnson wrote:
>   
>> On 7/19/2010 12:04 PM, Stelios Kyprou wrote:
>>   
>>     
>>> I know that i can make that happen if i don't provide Account and 
>>> Password in the ServiceInstall tag, but then again it depends on what 
>>> the user chooses to run the service as in a dialog.
>>>    
>>>     
>>>       
>> Use two components with conditions based on the dialog properties.
>>
>>   
>>     
>
> --
> Stelios Kyprou
> Systems Engineer
> Formicary - delivering quality financial technology solutions(TM) 
> www.formicary.net
>
>
> ----------------------------------------------------------------------------
> This message is confidential and may be privileged. It is intended solely for
> the named addressee. If you are not the intended recipient, please inform us.
> Any unauthorised dissemination, distribution or copying hereof is prohibited.
>
> Formicary Limited registered office in England and Wales, address 1 Taillar
> Road, Hedon, East Yorkshire HU12 8GU, registration number 3894343, VAT number
> 747644304, does not guarantee that the integrity of this communication has 
> been
> maintained nor that this communication is free of viruses, interceptions or
> interference.
> ----------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>   

-- 
Stelios Kyprou
Systems Engineer
Formicary - delivering quality financial technology solutions(TM)
www.formicary.net


----------------------------------------------------------------------------
This message is confidential and may be privileged. It is intended solely for
the named addressee. If you are not the intended recipient, please inform us.
Any unauthorised dissemination, distribution or copying hereof is prohibited.

Formicary Limited registered office in England and Wales, address 1 Taillar
Road, Hedon, East Yorkshire HU12 8GU, registration number 3894343, VAT number
747644304, does not guarantee that the integrity of this communication has been
maintained nor that this communication is free of viruses, interceptions or
interference.
----------------------------------------------------------------------------

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to