Browse Source

trying to preempt windows password requirements

master
forest 1 month ago
parent
commit
5d8e8769f0
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      src/installer/windows/Installer.nsi

+ 5
- 5
src/installer/windows/Installer.nsi View File

@ -121,10 +121,10 @@ Section
DetailPrint "telemetry returned $1 (exit code $0)"
; this would display the greenhouse-service users password. (for debugging)
; MessageBox MB_OK "New random password2: $GREENHOUSE_SERVICE_USER_PASSWORD"
MessageBox MB_OK "New random password: $GREENHOUSE_SERVICE_USER_PASSWORD@A_a1"
; https://nsis.sourceforge.io/UserMgr_plug-in#Example
UserMgr::CreateAccountEx "greenhouse-service" "$GREENHOUSE_SERVICE_USER_PASSWORD" "greenhouse background service user" "" "greenhouse background service user" "UF_DONT_EXPIRE_PASSWD|UF_PASSWD_CANT_CHANGE"
UserMgr::CreateAccountEx "greenhouse-service" "$GREENHOUSE_SERVICE_USER_PASSWORD@A_a1" "greenhouse background service user" "" "greenhouse background service user" "UF_DONT_EXPIRE_PASSWD|UF_PASSWD_CANT_CHANGE"
Pop $0
${If} "$0" == "OK"
DetailPrint "Created the greenhouse-service user"
@ -132,7 +132,7 @@ Section
; 2224 is NERR_UserExists (https://docs.microsoft.com/en-us/windows/win32/netmgmt/network-management-error-codes)
DetailPrint "The greenhouse-service user already exists"
UserMgr::SetUserInfo "greenhouse-service" "PASSWORD" "$GREENHOUSE_SERVICE_USER_PASSWORD"
UserMgr::SetUserInfo "greenhouse-service" "PASSWORD" "$GREENHOUSE_SERVICE_USER_PASSWORD@A_a1"
Pop $0
${If} "$0" == "OK"
DetailPrint "Changed the greenhouse-service user's password"
@ -210,14 +210,14 @@ Section
; SimpleSC::InstallService [name_of_service] [display_name] [service_type] [start_type] [binary_path] [dependencies] [account] [password]
; service_type 16 - SERVICE_WIN32_OWN_PROCESS
; start_type 2 - SERVICE_AUTO_START
SimpleSC::InstallService "GreenhouseBackgroundService" "Greenhouse Background Service" "16" "2" "$InstDir\background-service\greenhouse-windows-service.exe" "" "greenhouse-service" "$GREENHOUSE_SERVICE_USER_PASSWORD"
SimpleSC::InstallService "GreenhouseBackgroundService" "Greenhouse Background Service" "16" "2" "$InstDir\background-service\greenhouse-windows-service.exe" "" "greenhouse-service" "$GREENHOUSE_SERVICE_USER_PASSWORD@A_a1"
Pop $0
${If} "$0" == "0"
DetailPrint "Installed the greenhouse-windows-service "
${ElseIf} "$0" == "1073"
; 1073 is ERROR_SERVICE_EXISTS (https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--1000-1299-)
SimpleSC::SetServiceLogon "GreenhouseBackgroundService" "greenhouse-service" "$GREENHOUSE_SERVICE_USER_PASSWORD"
SimpleSC::SetServiceLogon "GreenhouseBackgroundService" "greenhouse-service" "$GREENHOUSE_SERVICE_USER_PASSWORD@A_a1"
Pop $0
${If} "$0" == "0"
DetailPrint "Updated the greenhouse-windows-service login info"


Loading…
Cancel
Save