Skip to content
Open
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
9 changes: 8 additions & 1 deletion scripts/installer.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,11 @@
FileClose $0
Delete "$APPDATA\ComfyUI\extra_models_config.yaml"
${endIf}
!macroend
!macroend

Section "Visual Studio Runtime"
SetOutPath "$INSTDIR"
File "$%TEMP%\VC_redist.x64.exe"
ExecWait "$INSTDIR\VC_redist.x64.exe /install /quiet /norestart"
Delete "$INSTDIR\VC_redist.x64.exe"
SectionEnd
3 changes: 3 additions & 0 deletions scripts/todesktop/beforeInstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@ 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 Visual C Redistributable depedency for Pytorch (-L sets to follow redirects) into %TEMP% (will be picked up by installer.nsh)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Download Visual C Redistributable depedency for Pytorch (-L sets to follow redirects) into %TEMP% (will be picked up by installer.nsh)
// Download Visual C Redistributable dependency for Pytorch (-L sets to follow redirects) into %TEMP% (will be picked up by installer.nsh)

const result3 = spawnSync('curl', ['-s', '-L', 'https://aka.ms/vs/16/release/vc_redist.x64.exe', '-o', '%TEMP%/vc_redist.x64.exe'],{shell:true,stdio: 'ignore'}).toString();
Comment on lines +22 to +24
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question on this, what does the TEMP directory mean here?

Ideally I want to move most things outside of beforeInstall because ToDesktop logs are not very reliable. For example for uv we pre-download everything on Github actions and upload everything to ToDestkop.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since I'm including the redistributable in the installer I need to point NSIS file to location where it can grab it; unfortunately the location of installer build is ephemeral and I need full path so I opted to use official Windows temporary directory to download the installer into (see beforeInstall.js parameters '-o', '%TEMP%/vc_redist.x64.exe') and then NSIS can pick it up from there.

}
};