sfelsheim
Posts: 3
Joined: Mon May 19, 2025 3:16 pm

create user not using property for password

Hello,

I am using AdvancedInstaller Enterprise edition version 22.2.

In my project I am creating a windows service with a property [SP] for the service user password. The project also creates the user if it does not already exist using the same [SP].

I read the value for [SP] from the Windows Credential Manager using a custom action inline powershell script.

Code: Select all

# get the WCM entry for the service user
$wcmServiceUser = Get-StoredCredential -Target "service_user"
	
# set the installer proprties
AI_SetMsiProperty SP $wcmServiceUser.GetNetworkCredential().Password

$propValue = AI_GetMsiProperty SP

Write-Output $propValue
The installer is failing when it tries to create the user with the following error.
Image

In the installer log, and when I run the script in AdvancedInstaller, I see script is execute properly and setting the correct value for SP
Return code: 0

Script output: "@PlanDataService2023"

Modified properties:
SP changed value to "@PlanDataService2023"
The default value for the property SP is a single double quote ("). If I set the default value to @PlanDataService2023, the creation works fine.

I verified I can manually create the user with the specified password.

I have attached my advancedInstaller project and the installer log.

Any input on how I can get this to work would be appreciated.

Thank you
Attachments
PDS_Luna.aip
(354.66 KiB) Downloaded 18 times
out.txt
(96.08 KiB) Downloaded 16 times
Capture2.PNG
Capture2.PNG (30.18 KiB) Viewed 163 times
sfelsheim
Posts: 3
Joined: Mon May 19, 2025 3:16 pm

Re: create user not using property for password

Any ideas on why my inline powershell script looks like its updating the property for the service users password, but it does not?
Liviu
Posts: 1280
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: create user not using property for password

Hello and welcome to our forums,

Can you please move your PowerShell script before the Preparing action group? The user is created during the AI_ProcessAccounts action.

In your project the script is executed after the above stage, when the user is already created.
PS.png
PS.png (16.89 KiB) Viewed 121 times
AI_ProcessAccounts.png
AI_ProcessAccounts.png (97.27 KiB) Viewed 121 times

Hope this helps!

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sfelsheim
Posts: 3
Joined: Mon May 19, 2025 3:16 pm

Re: create user not using property for password

Fantastic. As you can tell I am new to Advanced Installer. This worked great!

Thank you Liviu
Liviu wrote: Wed May 21, 2025 1:47 pm Hello and welcome to our forums,

Can you please move your PowerShell script before the Preparing action group? The user is created during the AI_ProcessAccounts action.

In your project the script is executed after the above stage, when the user is already created.

PS.png

AI_ProcessAccounts.png


Hope this helps!

Best regards,
Liviu
Liviu
Posts: 1280
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: create user not using property for password

You're always welcome!

Let us know if you have any other questions.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”