Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added files for the New Portable Salt Installer #21790

Merged
merged 1 commit into from
Mar 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added files for the New Portable Salt Installer
  • Loading branch information
twangboy committed Mar 18, 2015
commit 43b560e2ee48e452ec589d6770a53aa132b05a5d
2 changes: 2 additions & 0 deletions pkg/windows/buildenv/salt-minion-debug.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
net stop salt-minion
.\bin\python.exe .\bin\Scripts\salt-minion -l debug -c C:\salt\conf
1 change: 1 addition & 0 deletions pkg/windows/buildenv/salt-minion-start-service.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
net start salt-minion
60 changes: 30 additions & 30 deletions pkg/windows/installer/Salt-Minion-Setup.nsi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
!define PRODUCT_NAME "Salt Minion"
!define PRODUCT_VERSION "{{ salt_version }}"
!define PRODUCT_VERSION "2015.2.0rc1"
!define PRODUCT_PUBLISHER "SaltStack, Inc"
!define PRODUCT_WEB_SITE "http://saltstack.org"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\salt-minion.exe"
Expand Down Expand Up @@ -142,30 +142,30 @@ ShowUnInstDetails show
; 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}
; !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

Expand All @@ -177,14 +177,13 @@ Section "MainSection" SEC01
SetOverwrite try
CreateDirectory $INSTDIR\conf\pki\minion
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

Section -Post
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}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\salt.ico"
Expand All @@ -196,7 +195,7 @@ Section -Post
SectionEnd

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
ExecWait "net start salt-minion"
FunctionEnd
Expand Down Expand Up @@ -238,7 +237,8 @@ Section Uninstall
ExecWait "sc delete salt-minion"
Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\nssm.exe"
Delete "$INSTDIR\python*"
Delete "$INSTDIR\salt*"
Delete "$INSTDIR\bin"

#Delete "$SMPROGRAMS\Salt Minion\Uninstall.lnk"
#RMDir /r "$SMPROGRAMS\Salt Minion"
Expand Down