Merge pull request #24530 from twangboy/fix_24427

Start Minion Service on Silent Install
This commit is contained in:
Justin Findlay 2015-06-09 15:30:08 -06:00
commit d376390f76
2 changed files with 8 additions and 46 deletions

View File

@ -41,6 +41,7 @@ Var MinionName_State
!define MUI_ABORTWARNING
!define MUI_ICON "salt.ico"
!define MUI_UNICON "salt.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP "panel.bmp"
; Welcome page
!insertmacro MUI_PAGE_WELCOME
@ -141,19 +142,6 @@ Function updateMinionConfig
FunctionEnd
Function MsiQueryProductState
!define INSTALLSTATE_DEFAULT "5"
Var /GLOBAL NeedVcRedist ; used as a return value
Pop $R0
StrCpy $NeedVcRedist "False"
System::Call "msi::MsiQueryProductStateA(t '$R0') i.r0"
StrCmp $0 ${INSTALLSTATE_DEFAULT} +2 0
StrCpy $NeedVcRedist "True"
FunctionEnd
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "Salt-Minion-${PRODUCT_VERSION}-${CPUARCH}-Setup.exe"
InstallDir "c:\salt"
@ -161,37 +149,6 @@ InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show
; Check and install Visual C++ 2008 SP1 MFC Security Update redist packages
; See http://blogs.msdn.com/b/astebner/archive/2009/01/29/9384143.aspx for more info
Section -Prerequisites
; !define VC_REDIST_X64_GUID "{5FCE6D76-F5DC-37AB-B2B8-22AB8CEDB1D4}"
; !define VC_REDIST_X86_GUID "{9BE518E6-ECC6-35A9-88E4-87755C07200F}"
; !define VC_REDIST_X64_URI "http://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x64.exe"
; !define VC_REDIST_X86_URI "http://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x86.exe"
; Var /GLOBAL VcRedistGuid
; Var /GLOBAL VcRedistUri
; ${If} ${RunningX64}
; StrCpy $VcRedistGuid ${VC_REDIST_X64_GUID}
; StrCpy $VcRedistUri ${VC_REDIST_X64_URI}
; ${Else}
; StrCpy $VcRedistGuid ${VC_REDIST_X86_GUID}
; StrCpy $VcRedistUri ${VC_REDIST_X86_URI}
; ${EndIf}
; Push $VcRedistGuid
Call MsiQueryProductState
; ${If} $NeedVcRedist == "True"
; NSISdl::download /TIMEOUT=30000 $VcRedistUri $TEMP\vcredist.exe
; Pop $R0
; StrCmp $R0 "success" +2
; MessageBox MB_OK "VC redist package download failed: $R0" /SD IDOK ; just report, do not break installation
; Execwait '"$TEMP\vcredist.exe" /q'
; ${EndIf}
SectionEnd
Section "MainSection" SEC01
; Remove previous version of salt, but don't remove conf and key
@ -248,11 +205,18 @@ Section -Post
WriteRegStr HKLM "SYSTEM\CurrentControlSet\services\salt-minion" "DependOnService" "nsi"
ExecWait "nssm.exe install salt-minion $INSTDIR\bin\python.exe $INSTDIR\bin\Scripts\salt-minion -c $INSTDIR\conf -l quiet"
ExecWait "nssm.exe set salt-minion AppEnvironmentExtra PYTHONHOME="
RMDir /R "$INSTDIR\var\cache\salt" ; removing cache from old version
Call updateMinionConfig
SectionEnd
Function .onInstSuccess
; If the installer is running Silently, start the service
IfSilent 0 +2
Exec 'net start salt-minion'
FunctionEnd
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer." /SD IDOK
@ -365,8 +329,6 @@ Section Uninstall
Delete "$INSTDIR\salt*"
Delete "$INSTDIR\bin"
#Delete "$SMPROGRAMS\Salt Minion\Uninstall.lnk"
#RMDir /r "$SMPROGRAMS\Salt Minion"
${If} $INSTDIR != 'Program Files'
${AndIf} $INSTDIR != 'Program Files (x86)'
RMDir /r "$INSTDIR"

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB