Skip to content

Commit

Permalink
Add git download & install to install scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
webfiltered committed Nov 27, 2024
1 parent 4692c77 commit ee9aaa4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
20 changes: 19 additions & 1 deletion scripts/installer.nsh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
!include 'LogicLib.nsh'

# electron-build documentation: https://www.electron.build/nsis.html#custom-nsis-script
# NSIS reference: https://nsis.sourceforge.io/Docs/
#
# Hooks: customHeader, preInit, customInit, customUnInit, customInstall, customUnInstall, customRemoveFiles, customInstallMode, customWelcomePage, customUnWelcomePage

; The following is used to add the "/SD" flag to MessageBox so that the
; machine can restart if the uninstaller fails.
!macro customUnInstallCheckCommon
Expand Down Expand Up @@ -79,4 +84,17 @@
FileClose $0
Delete "$APPDATA\ComfyUI\extra_models_config.yaml"
${endIf}
!macroend
!macroend

# Checks for git and installs it if not present.
Section "Git for Windows"
IfErrors gitClearErrors
gitClearErrors:
ExecWait "where.exe git"
IfErrors installGit gitInstalled
installGit:
SetOutPath "$INSTDIR"
ExecWait "$INSTDIR\Git-2.47.1-64-bit.exe /verysilent /suppressmsgboxes /log /norestart /restartapplications"
Delete "$INSTDIR\Git-2.47.1-64-bit.exe"
gitInstalled:
SectionEnd
7 changes: 6 additions & 1 deletion scripts/todesktop/beforeInstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,10 @@ module.exports = async ({ pkgJsonPath, pkgJson, appDir, hookName }) => {
// Change stdio to get back the logs if there are issues.
const result1 = spawnSync('curl' ,['-s', 'https://www.python.org/ftp/python/3.12.7/python-3.12.7-amd64.exe'],{shell:true,stdio: 'ignore'}).toString();
const result2 = spawnSync('python-3.12.7-amd64.exe', ['/quiet', 'InstallAllUsers=1','PrependPath=1', 'Include_test=0'],{shell:true,stdio: 'ignore'}).toString();

// Download git
// TODO: Move to the installer, if current dist infra permits it
const res = spawnSync('where.exe', 'git')
if (res.status !== 0) spawnSync('curl', ['-s', 'https://github.com/git-for-windows/git/releases/download/v2.47.1.windows.1/Git-2.47.1-64-bit.exe'], { shell:true, stdio: 'ignore' }).toString();
}
};
};

0 comments on commit ee9aaa4

Please sign in to comment.