Merge pull request #21852 from jfindlay/bp-21790

backport #21790 to 2014.7
This commit is contained in:
Nicole Thomas 2015-03-20 12:35:31 -06:00
commit ca33da7082
3 changed files with 31 additions and 28 deletions

View File

@ -0,0 +1,2 @@
net stop salt-minion
.\bin\python.exe .\bin\Scripts\salt-minion -l debug -c C:\salt\conf

View File

@ -0,0 +1 @@
net start salt-minion

View File

@ -1,5 +1,5 @@
!define PRODUCT_NAME "Salt Minion" !define PRODUCT_NAME "Salt Minion"
!define PRODUCT_VERSION "2014.1.7" !define PRODUCT_VERSION "2014.7.2"
!define PRODUCT_PUBLISHER "SaltStack, Inc" !define PRODUCT_PUBLISHER "SaltStack, Inc"
!define PRODUCT_WEB_SITE "http://saltstack.org" !define PRODUCT_WEB_SITE "http://saltstack.org"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\salt-minion.exe" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\salt-minion.exe"
@ -142,30 +142,30 @@ ShowUnInstDetails show
; See http://blogs.msdn.com/b/astebner/archive/2009/01/29/9384143.aspx for more info ; See http://blogs.msdn.com/b/astebner/archive/2009/01/29/9384143.aspx for more info
Section -Prerequisites Section -Prerequisites
!define VC_REDIST_X64_GUID "{5FCE6D76-F5DC-37AB-B2B8-22AB8CEDB1D4}" ; !define VC_REDIST_X64_GUID "{5FCE6D76-F5DC-37AB-B2B8-22AB8CEDB1D4}"
!define VC_REDIST_X86_GUID "{9BE518E6-ECC6-35A9-88E4-87755C07200F}" ; !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_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" ; !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 VcRedistGuid
Var /GLOBAL VcRedistUri ; Var /GLOBAL VcRedistUri
${If} ${RunningX64} ; ${If} ${RunningX64}
StrCpy $VcRedistGuid ${VC_REDIST_X64_GUID} ; StrCpy $VcRedistGuid ${VC_REDIST_X64_GUID}
StrCpy $VcRedistUri ${VC_REDIST_X64_URI} ; StrCpy $VcRedistUri ${VC_REDIST_X64_URI}
${Else} ; ${Else}
StrCpy $VcRedistGuid ${VC_REDIST_X86_GUID} ; StrCpy $VcRedistGuid ${VC_REDIST_X86_GUID}
StrCpy $VcRedistUri ${VC_REDIST_X86_URI} ; StrCpy $VcRedistUri ${VC_REDIST_X86_URI}
${EndIf} ; ${EndIf}
Push $VcRedistGuid ; Push $VcRedistGuid
Call MsiQueryProductState ; Call MsiQueryProductState
${If} $NeedVcRedist == "True" ; ${If} $NeedVcRedist == "True"
NSISdl::download /TIMEOUT=30000 $VcRedistUri $TEMP\vcredist.exe ; NSISdl::download /TIMEOUT=30000 $VcRedistUri $TEMP\vcredist.exe
Pop $R0 ; Pop $R0
StrCmp $R0 "success" +2 ; StrCmp $R0 "success" +2
MessageBox MB_OK "VC redist package download failed: $R0" ; just report, do not break installation ; MessageBox MB_OK "VC redist package download failed: $R0" /SD IDOK ; just report, do not break installation
Execwait '"$TEMP\vcredist.exe" /q' ; Execwait '"$TEMP\vcredist.exe" /q'
${EndIf} ; ${EndIf}
SectionEnd SectionEnd
@ -177,14 +177,13 @@ Section "MainSection" SEC01
SetOverwrite try SetOverwrite try
CreateDirectory $INSTDIR\conf\pki\minion CreateDirectory $INSTDIR\conf\pki\minion
File /r "..\buildenv\" File /r "..\buildenv\"
Exec 'icacls c:\salt /inheritance:r /grant:r "BUILTIN\Administrators":(OI)(CI)F /grant:r "NT AUTHORITY\SYSTEM":(OI)(CI)F' Exec 'icacls c:\salt /inheritance:r /grant:r "BUILTIN\Administrators":(OI)(CI)F /grant:r "NT AUTHORITY\SYSTEM":(OI)(CI)F'
SectionEnd SectionEnd
Section -Post Section -Post
WriteUninstaller "$INSTDIR\uninst.exe" WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\salt-minion.exe" WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\bin\Scripts\salt-minion.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\salt.ico" WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\salt.ico"
@ -196,7 +195,7 @@ Section -Post
SectionEnd SectionEnd
Function .onInstSuccess Function .onInstSuccess
Exec "nssm.exe install salt-minion $INSTDIR\salt-minion.exe -c $INSTDIR\conf -l quiet" Exec "nssm.exe install salt-minion $INSTDIR\bin\python.exe $INSTDIR\bin\Scripts\salt-minion -c $INSTDIR\conf -l quiet"
RMDir /R "$INSTDIR\var\cache\salt" ; removing cache from old version RMDir /R "$INSTDIR\var\cache\salt" ; removing cache from old version
ExecWait "net start salt-minion" ExecWait "net start salt-minion"
FunctionEnd FunctionEnd
@ -238,7 +237,8 @@ Section Uninstall
ExecWait "sc delete salt-minion" ExecWait "sc delete salt-minion"
Delete "$INSTDIR\uninst.exe" Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\nssm.exe" Delete "$INSTDIR\nssm.exe"
Delete "$INSTDIR\python*" Delete "$INSTDIR\salt*"
Delete "$INSTDIR\bin"
#Delete "$SMPROGRAMS\Salt Minion\Uninstall.lnk" #Delete "$SMPROGRAMS\Salt Minion\Uninstall.lnk"
#RMDir /r "$SMPROGRAMS\Salt Minion" #RMDir /r "$SMPROGRAMS\Salt Minion"