Files
batchtube/installer.nsi

62 lines
2.6 KiB
NSIS

; BatchTube NSIS Installer Script - Updated for backend/ structure
; Requires NSIS 3.x - https://nsis.sourceforge.io/
!define APP_NAME "BatchTube"
!define APP_VERSION "1.0.0"
!define APP_PUBLISHER "Intentures LLC"
!define APP_URL "https://batchtube.com"
!define APP_EXE "BatchTube.exe"
!define INSTALL_DIR "$PROGRAMFILES64\BatchTube"
Name "${APP_NAME} ${APP_VERSION}"
OutFile "BatchTube-Setup-${APP_VERSION}.exe"
InstallDir "${INSTALL_DIR}"
InstallDirRegKey HKLM "Software\${APP_NAME}" "Install_Dir"
RequestExecutionLevel admin
!include "MUI2.nsh"
!define MUI_ABORTWARNING
!define MUI_ICON "..\src-tauri\icons\icon.ico"
!define MUI_UNICON "..\src-tauri\icons\icon.ico"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "..\LICENSE.txt"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_RUN "$INSTDIR\${APP_EXE}"
!define MUI_FINISHPAGE_RUN_TEXT "Launch BatchTube now"
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
Section "BatchTube" SecMain
SetOutPath "$INSTDIR"
File "backend\dist\BatchTube.exe"
; Optional: bundle yt-dlp
; File "tools\yt-dlp.exe"
; Optional: bundle ffmpeg
; File /r "tools\ffmpeg"
WriteRegStr HKLM "Software\${APP_NAME}" "Install_Dir" "$INSTDIR"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "DisplayName" "${APP_NAME}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "UninstallString" '"$INSTDIR\Uninstall.exe"'
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "DisplayVersion" "${APP_VERSION}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "Publisher" "${APP_PUBLISHER}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "URLInfoAbout" "${APP_URL}"
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}" "NoRepair" 1
WriteUninstaller "$INSTDIR\Uninstall.exe"
CreateShortcut "$DESKTOP\BatchTube.lnk" "$INSTDIR\${APP_EXE}"
CreateDirectory "$SMPROGRAMS\BatchTube"
CreateShortcut "$SMPROGRAMS\BatchTube\BatchTube.lnk" "$INSTDIR\${APP_EXE}"
CreateShortcut "$SMPROGRAMS\BatchTube\Uninstall BatchTube.lnk" "$INSTDIR\Uninstall.exe"
SectionEnd
Section "Uninstall"
RMDir /r "$INSTDIR"
Delete "$DESKTOP\BatchTube.lnk"
RMDir /r "$SMPROGRAMS\BatchTube"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}"
DeleteRegKey HKLM "Software\${APP_NAME}"
SectionEnd