Single-file installer - Include all the dependencies from an installed folder; Download the default models using the NSCurl plugin

This commit is contained in:
cmdr2 2023-03-04 18:02:30 +05:30
parent 9dd819e193
commit 2a597fcad7
2 changed files with 35 additions and 11 deletions

View File

@ -1,14 +1,16 @@
; Script generated by the HM NIS Edit Script Wizard. ; Script generated by the HM NIS Edit Script Wizard.
Target x86-unicode Target amd64-unicode
Unicode True Unicode True
!AddPluginDir /x86-unicode "." SetCompressor /SOLID /FINAL lzma
RequestExecutionLevel user
!AddPluginDir /amd64-unicode "."
; HM NIS Edit Wizard helper defines ; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "Stable Diffusion UI" !define PRODUCT_NAME "Easy Diffusion"
!define PRODUCT_VERSION "Installer 2.35" !define PRODUCT_VERSION "2.5"
!define PRODUCT_PUBLISHER "cmdr2 and contributors" !define PRODUCT_PUBLISHER "cmdr2 and contributors"
!define PRODUCT_WEB_SITE "https://stable-diffusion-ui.github.io" !define PRODUCT_WEB_SITE "https://stable-diffusion-ui.github.io"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Cmdr2\App Paths\installer.exe" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Easy Diffusion\App Paths\installer.exe"
; MUI 1.67 compatible ------ ; MUI 1.67 compatible ------
!include "MUI.nsh" !include "MUI.nsh"
@ -106,7 +108,7 @@ Function DirectoryLeave
StrCpy $5 $INSTDIR 3 StrCpy $5 $INSTDIR 3
System::Call 'Kernel32::GetVolumeInformation(t "$5",t,i ${NSIS_MAX_STRLEN},*i,*i,*i,t.r1,i ${NSIS_MAX_STRLEN})i.r0' System::Call 'Kernel32::GetVolumeInformation(t "$5",t,i ${NSIS_MAX_STRLEN},*i,*i,*i,t.r1,i ${NSIS_MAX_STRLEN})i.r0'
${If} $0 <> 0 ${If} $0 <> 0
${AndIf} $1 == "NTFS" ${AndIf} $1 != "NTFS"
MessageBox mb_ok "$5 has filesystem type '$1'.$\nOnly NTFS filesystems are supported.$\nPlease choose a different drive." MessageBox mb_ok "$5 has filesystem type '$1'.$\nOnly NTFS filesystems are supported.$\nPlease choose a different drive."
Abort Abort
${EndIf} ${EndIf}
@ -188,8 +190,8 @@ Page custom MediaPackDialog
;--------------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "Install Stable Diffusion UI.exe" OutFile "Install Easy Diffusion.exe"
InstallDir "C:\Stable-Diffusion-UI\" InstallDir "C:\EasyDiffusion\"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" "" InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show ShowInstDetails show
@ -200,15 +202,37 @@ Section "MainSection" SEC01
File "..\CreativeML Open RAIL-M License" File "..\CreativeML Open RAIL-M License"
File "..\How to install and run.txt" File "..\How to install and run.txt"
File "..\LICENSE" File "..\LICENSE"
File "..\Start Stable Diffusion UI.cmd" File "..\scripts\Start Stable Diffusion UI.cmd"
File /r "D:\path\to\installed\folder\installer_files"
SetOutPath "$INSTDIR\scripts" SetOutPath "$INSTDIR\scripts"
File "..\scripts\bootstrap.bat" File "..\scripts\bootstrap.bat"
File "..\scripts\install_status.txt" File "..\scripts\install_status.txt"
File "..\scripts\on_env_start.bat" File "..\scripts\on_env_start.bat"
File "C:\windows\system32\curl.exe" File "C:\windows\system32\curl.exe"
CreateDirectory "$INSTDIR\profile" CreateDirectory "$INSTDIR\profile"
CreateDirectory "$SMPROGRAMS\Stable Diffusion UI" CreateDirectory "$INSTDIR\models"
CreateShortCut "$SMPROGRAMS\Stable Diffusion UI\Start Stable Diffusion UI.lnk" "$INSTDIR\Start Stable Diffusion UI.cmd" CreateDirectory "$INSTDIR\models\stable-diffusion"
CreateDirectory "$INSTDIR\models\gfpgan"
CreateDirectory "$INSTDIR\models\realesrgan"
CreateDirectory "$INSTDIR\models\vae"
CreateDirectory "$SMPROGRAMS\Easy Diffusion"
CreateShortCut "$SMPROGRAMS\Easy Diffusion\Easy Diffusion.lnk" "$INSTDIR\Start Stable Diffusion UI.cmd"
DetailPrint 'Downloading the Stable Diffusion 1.4 model...'
NScurl::http get "https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt" "$INSTDIR\models\stable-diffusion\sd-v1-4.ckpt" /CANCEL /INSIST /END
DetailPrint 'Downloading the GFPGAN model...'
NScurl::http get "https://github.com/TencentARC/GFPGAN/releases/download/v1.3.0/GFPGANv1.3.pth" "$INSTDIR\models\gfpgan\GFPGANv1.3.pth" /CANCEL /INSIST /END
DetailPrint 'Downloading the RealESRGAN_x4plus model...'
NScurl::http get "https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth" "$INSTDIR\models\realesrgan\RealESRGAN_x4plus.pth" /CANCEL /INSIST /END
DetailPrint 'Downloading the RealESRGAN_x4plus_anime model...'
NScurl::http get "https://github.com/xinntao/Real-ESRGAN/releases/download/v0.2.2.4/RealESRGAN_x4plus_anime_6B.pth" "$INSTDIR\models\realesrgan\RealESRGAN_x4plus_anime_6B.pth" /CANCEL /INSIST /END
DetailPrint 'Downloading the default VAE (sd-vae-ft-mse-original) model...'
NScurl::http get "https://huggingface.co/stabilityai/sd-vae-ft-mse-original/resolve/main/vae-ft-mse-840000-ema-pruned.ckpt" "$INSTDIR\models\vae\vae-ft-mse-840000-ema-pruned.ckpt" /CANCEL /INSIST /END
SectionEnd SectionEnd
;--------------------------------------------------------------------------------------------------------- ;---------------------------------------------------------------------------------------------------------

View File