Skip to content

Commit

Permalink
Add Chocolatey mode
Browse files Browse the repository at this point in the history
This patch adds a special Chocolatey mode which will perform like the GUI installer but silent. So some additional tools are installed.
  • Loading branch information
gilbertsoft committed Nov 11, 2019
1 parent dd1e2e0 commit 503093b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion winpkg/chocolatey/tools/chocolateyinstall.ps1
Expand Up @@ -15,7 +15,7 @@ $packageArgs = @{
checksumType64= 'sha256'

validExitCodes= @(0, 3010, 1641)
silentArgs = '/S'
silentArgs = '/S /C'
}

Install-ChocolateyPackage @packageArgs
Expand Down
26 changes: 26 additions & 0 deletions winpkg/ddev.nsi
Expand Up @@ -126,6 +126,7 @@ InstType "Minimal"
* Include Headers
*/
!include "MUI2.nsh"
!include "FileFunc.nsh"
!include "LogicLib.nsh"
;!include "Memento.nsh"
!include "Sections.nsh"
Expand All @@ -139,6 +140,17 @@ InstType "Minimal"



/**
* Local macros
*/
Var ChocolateyMode
!macro _Chocolatey _a _b _t _f
!insertmacro _== $ChocolateyMode `1` `${_t}` `${_f}`
!macroend
!define Chocolatey `"" Chocolatey ""`



/**
* Names
*/
Expand Down Expand Up @@ -457,6 +469,7 @@ SectionGroup /e "mkcert"
Section "mkcert" SecMkcert
; Install in non silent mode only
${IfNot} ${Silent}
${AndIfNot} ${Chocolatey}
SectionIn 1 2
SetOutPath "$INSTDIR"
SetOverwrite try
Expand Down Expand Up @@ -489,6 +502,7 @@ SectionGroup /e "mkcert"
Section "Setup mkcert" SecMkcertSetup
; Install in non silent mode only
${IfNot} ${Silent}
${AndIfNot} ${Chocolatey}
MessageBox MB_ICONINFORMATION|MB_OK "Now running mkcert to enable trusted https. Please accept the mkcert dialog box that may follow."

; Run setup
Expand Down Expand Up @@ -527,6 +541,7 @@ SectionGroup /e "WinNFSd"
Section "NSSM" SecNSSM
; Install in non silent mode only
${IfNot} ${Silent}
${AndIfNot} ${Chocolatey}
SectionIn 1
SetOutPath "$INSTDIR"
SetOverwrite try
Expand Down Expand Up @@ -690,6 +705,16 @@ Function .onInit
StrCpy $DockerSelected ""
!endif ; DOCKER_NSH
StrCpy $mkcertSetup ""

; Check parameters
${GetParameters} $R0
ClearErrors
${GetOptions} $R0 "/C" $0
${IfNot} ${Errors}
StrCpy $ChocolateyMode "1"
${Else}
StrCpy $ChocolateyMode "0"
${EndIf}
FunctionEnd

/**
Expand Down Expand Up @@ -859,6 +884,7 @@ FunctionEnd
!ifdef DOCKER_NSH
Function checkDocker
${IfNot} ${Silent}
${AndIfNot} ${Chocolatey}
Var /GLOBAL DockerIgnore

; Read setup status from registry
Expand Down

0 comments on commit 503093b

Please sign in to comment.