Service Creation Function
The below function, only KIND OF works. It installs the service and puts the user name in there, but you have to re-enter the password in order to start it. Can anyone see what I'm doing wrong?
<!-------------------snip-------------------->
Function serviceUtility
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Install Service if not installed ;;
;; ;;
;; Pass to function: ;;
;; $R8 - Service Name ;;
;; $R7 - Path to executable ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
!insertmacro SERVICE "installed" "$R8" 0
pop $0
strCmp $0 'false' createService
!insertmacro SERVICE "stop" "$R8" 0
Goto endServiceUtility
createService:
strCmp $R9 "1" serviceUtility1 ;if we already have userName and password continue to create
strCpy $R9 1 ;note that we've already gotten the user, password, and computername
Dialogs::InputBox "UserID" "Please enter service username to run new service as" "OK" "Cancel" "0" ${VAR_R1}
Dialogs::InputBox "Password" "Please enter the service user password:" "OK" "Cancel" "1" ${VAR_R2}
serviceUtility1:
nsSCM::Install "$R8" "$R8" 16 2 "$R7" "" "" "$R1" "$R2"
endServiceUtility:
FunctionEnd
<!------------------end snip----------------->
Thanks Much,
Eric