2022-03-03 12:11:19 +08:00
|
|
|
Unicode True
|
2015-02-02 05:30:13 +08:00
|
|
|
###################
|
|
|
|
#META
|
|
|
|
###################
|
|
|
|
!define APP_NAME "qTox"
|
|
|
|
!define COMP_NAME "Tox"
|
2016-08-04 06:25:50 +08:00
|
|
|
!define WEB_SITE "https://github.com/qTox/qTox"
|
2015-02-02 05:30:13 +08:00
|
|
|
!define VERSION "1.0.0.0"
|
|
|
|
!define DESCRIPTION "qTox Installer"
|
|
|
|
!define COPYRIGHT "The Tox Project"
|
|
|
|
!define INSTALLER_NAME "setup-qtox.exe"
|
|
|
|
!define MAIN_APP_EXE "bin\qtox.exe"
|
2015-06-03 06:11:36 +08:00
|
|
|
!define REG_ROOT "HKLM"
|
2015-02-02 05:30:13 +08:00
|
|
|
!define REG_APP_PATH "Software\Microsoft\Windows\CurrentVersion\App Paths\qtox.exe"
|
|
|
|
!define UNINSTALL_PATH "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}"
|
|
|
|
!define REG_START_MENU "Start Menu Folder"
|
|
|
|
var SM_Folder
|
|
|
|
|
|
|
|
Name "${APP_NAME}"
|
|
|
|
Caption "${APP_NAME}"
|
|
|
|
OutFile "${INSTALLER_NAME}"
|
|
|
|
BrandingText "${APP_NAME}"
|
|
|
|
InstallDir "$PROGRAMFILES64\${APP_NAME}"
|
|
|
|
SetCompressor /SOLID lzma
|
|
|
|
|
|
|
|
VIProductVersion "${VERSION}"
|
|
|
|
VIAddVersionKey "ProductName" "${APP_NAME}"
|
|
|
|
VIAddVersionKey "CompanyName" "${COMP_NAME}"
|
|
|
|
VIAddVersionKey "LegalCopyright" "${COPYRIGHT}"
|
|
|
|
VIAddVersionKey "FileDescription" "${DESCRIPTION}"
|
|
|
|
VIAddVersionKey "FileVersion" "${VERSION}"
|
|
|
|
|
|
|
|
##############
|
2022-03-03 12:26:13 +08:00
|
|
|
#DEFINE MACROS
|
2015-02-02 05:30:13 +08:00
|
|
|
##############
|
2022-03-03 12:51:41 +08:00
|
|
|
;Set the name of the uninstall log
|
|
|
|
!define UninstLog "uninstall.log"
|
|
|
|
Var UninstLog
|
2022-03-03 12:26:13 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
;AddItem macro
|
|
|
|
!macro AddItem Path
|
2022-03-03 12:16:16 +08:00
|
|
|
FileWriteUTF16LE $UninstLog "${Path}$\r$\n"
|
2015-02-02 05:30:13 +08:00
|
|
|
!macroend
|
2022-03-03 12:26:13 +08:00
|
|
|
!define AddItem "!insertmacro AddItem"
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
;File macro
|
|
|
|
!macro File FileName
|
|
|
|
IfFileExists "$OUTDIR\${FileName}" +2
|
2022-03-03 12:16:16 +08:00
|
|
|
FileWriteUTF16LE $UninstLog "$OUTDIR\${FileName}$\r$\n"
|
2015-02-02 05:30:13 +08:00
|
|
|
File "${FileName}"
|
|
|
|
!macroend
|
2022-03-03 12:26:13 +08:00
|
|
|
!define File "!insertmacro File"
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
;CreateShortcut macro
|
|
|
|
!macro CreateShortcut FilePath FilePointer Pamameters Icon IconIndex
|
2022-03-03 12:16:16 +08:00
|
|
|
FileWriteUTF16LE $UninstLog "${FilePath}$\r$\n"
|
2015-02-02 05:30:13 +08:00
|
|
|
CreateShortcut "${FilePath}" "${FilePointer}" "${Pamameters}" "${Icon}" "${IconIndex}"
|
|
|
|
!macroend
|
2022-03-03 12:26:13 +08:00
|
|
|
!define CreateShortcut "!insertmacro CreateShortcut"
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
;Copy files macro
|
|
|
|
!macro CopyFiles SourcePath DestPath
|
|
|
|
IfFileExists "${DestPath}" +2
|
2022-03-03 12:16:16 +08:00
|
|
|
FileWriteUTF16LE $UninstLog "${DestPath}$\r$\n"
|
2015-02-02 05:30:13 +08:00
|
|
|
CopyFiles "${SourcePath}" "${DestPath}"
|
|
|
|
!macroend
|
2022-03-03 12:26:13 +08:00
|
|
|
!define CopyFiles "!insertmacro CopyFiles"
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
;Rename macro
|
|
|
|
!macro Rename SourcePath DestPath
|
|
|
|
IfFileExists "${DestPath}" +2
|
2022-03-03 12:16:16 +08:00
|
|
|
FileWriteUTF16LE $UninstLog "${DestPath}$\r$\n"
|
2015-02-02 05:30:13 +08:00
|
|
|
Rename "${SourcePath}" "${DestPath}"
|
|
|
|
!macroend
|
2022-03-03 12:26:13 +08:00
|
|
|
!define Rename "!insertmacro Rename"
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
;CreateDirectory macro
|
|
|
|
!macro CreateDirectory Path
|
|
|
|
CreateDirectory "${Path}"
|
2022-03-03 12:16:16 +08:00
|
|
|
FileWriteUTF16LE $UninstLog "${Path}$\r$\n"
|
2015-02-02 05:30:13 +08:00
|
|
|
!macroend
|
2022-03-03 12:26:13 +08:00
|
|
|
!define CreateDirectory "!insertmacro CreateDirectory"
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
;SetOutPath macro
|
|
|
|
!macro SetOutPath Path
|
|
|
|
SetOutPath "${Path}"
|
2022-03-03 12:16:16 +08:00
|
|
|
FileWriteUTF16LE $UninstLog "${Path}$\r$\n"
|
2015-02-02 05:30:13 +08:00
|
|
|
!macroend
|
2022-03-03 12:26:13 +08:00
|
|
|
!define SetOutPath "!insertmacro SetOutPath"
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
;WriteUninstaller macro
|
|
|
|
!macro WriteUninstaller Path
|
|
|
|
WriteUninstaller "${Path}"
|
2022-03-03 12:16:16 +08:00
|
|
|
FileWriteUTF16LE $UninstLog "${Path}$\r$\n"
|
2015-02-02 05:30:13 +08:00
|
|
|
!macroend
|
2022-03-03 12:26:13 +08:00
|
|
|
!define WriteUninstaller "!insertmacro WriteUninstaller"
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
;WriteIniStr macro
|
|
|
|
!macro WriteIniStr IniFile SectionName EntryName NewValue
|
|
|
|
IfFileExists "${IniFile}" +2
|
2022-03-03 12:16:16 +08:00
|
|
|
FileWriteUTF16LE $UninstLog "${IniFile}$\r$\n"
|
2015-02-02 05:30:13 +08:00
|
|
|
WriteIniStr "${IniFile}" "${SectionName}" "${EntryName}" "${NewValue}"
|
|
|
|
!macroend
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
;WriteRegStr macro
|
|
|
|
!macro WriteRegStr RegRoot UnInstallPath Key Value
|
2022-03-03 12:16:16 +08:00
|
|
|
FileWriteUTF16LE $UninstLog "${RegRoot} ${UnInstallPath}$\r$\n"
|
2015-02-02 05:30:13 +08:00
|
|
|
WriteRegStr "${RegRoot}" "${UnInstallPath}" "${Key}" "${Value}"
|
|
|
|
!macroend
|
2022-03-03 12:26:13 +08:00
|
|
|
!define WriteRegStr "!insertmacro WriteRegStr"
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
;WriteRegDWORD macro
|
|
|
|
!macro WriteRegDWORD RegRoot UnInstallPath Key Value
|
2022-03-03 12:16:16 +08:00
|
|
|
FileWriteUTF16LE $UninstLog "${RegRoot} ${UnInstallPath}$\r$\n"
|
2015-02-02 05:30:13 +08:00
|
|
|
WriteRegDWORD "${RegRoot}" "${UnInstallPath}" "${Key}" "${Value}"
|
|
|
|
!macroend
|
2022-03-03 12:26:13 +08:00
|
|
|
!define WriteRegDWORD "!insertmacro WriteRegDWORD"
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
;BackupFile macro
|
|
|
|
!macro BackupFile FILE_DIR FILE BACKUP_TO
|
|
|
|
IfFileExists "${BACKUP_TO}\*.*" +2
|
|
|
|
CreateDirectory "${BACKUP_TO}"
|
|
|
|
IfFileExists "${FILE_DIR}\${FILE}" 0 +2
|
|
|
|
Rename "${FILE_DIR}\${FILE}" "${BACKUP_TO}\${FILE}"
|
|
|
|
!macroend
|
2022-03-03 12:26:13 +08:00
|
|
|
!define BackupFile "!insertmacro BackupFile"
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
;RestoreFile macro
|
|
|
|
!macro RestoreFile BUP_DIR FILE RESTORE_TO
|
|
|
|
IfFileExists "${BUP_DIR}\${FILE}" 0 +2
|
|
|
|
Rename "${BUP_DIR}\${FILE}" "${RESTORE_TO}\${FILE}"
|
|
|
|
!macroend
|
2022-03-03 12:26:13 +08:00
|
|
|
!define RestoreFile "!insertmacro RestoreFile"
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
;BackupFiles macro
|
|
|
|
!macro BackupFiles FILE_DIR FILE BACKUP_TO
|
|
|
|
IfFileExists "${BACKUP_TO}\*.*" +2
|
|
|
|
CreateDirectory "22222"
|
|
|
|
IfFileExists "${FILE_DIR}\${FILE}" 0 +7
|
2022-03-03 12:16:16 +08:00
|
|
|
FileWriteUTF16LE $UninstLog "${FILE_DIR}\${FILE}$\r$\n"
|
|
|
|
FileWriteUTF16LE $UninstLog "${BACKUP_TO}\${FILE}$\r$\n"
|
|
|
|
FileWriteUTF16LE $UninstLog "FileBackup$\r$\n"
|
2015-02-02 05:30:13 +08:00
|
|
|
Rename "${FILE_DIR}\${FILE}" "${BACKUP_TO}\${FILE}"
|
|
|
|
SetOutPath "${FILE_DIR}"
|
|
|
|
File "${FILE}" #After the Original file is backed up write the new file.
|
|
|
|
!macroend
|
2022-03-03 12:26:13 +08:00
|
|
|
!define BackupFiles "!insertmacro BackupFiles"
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
;RestoreFiles macro
|
|
|
|
!macro RestoreFiles BUP_FILE RESTORE_FILE
|
|
|
|
IfFileExists "${BUP_FILE}" 0 +2
|
|
|
|
CopyFiles "${BUP_FILE}" "${RESTORE_FILE}"
|
|
|
|
!macroend
|
2022-03-03 12:26:13 +08:00
|
|
|
!define RestoreFiles "!insertmacro RestoreFiles"
|
2015-02-02 05:30:13 +08:00
|
|
|
|
|
|
|
##############
|
|
|
|
#MODERN UI
|
|
|
|
##############
|
|
|
|
!include "MUI.nsh"
|
|
|
|
|
|
|
|
!define MUI_ABORTWARNING
|
|
|
|
!define MUI_FINISHPAGE_NOAUTOCLOSE
|
|
|
|
!insertmacro MUI_PAGE_WELCOME
|
|
|
|
!insertmacro MUI_PAGE_DIRECTORY
|
|
|
|
!ifdef REG_START_MENU
|
2020-10-07 07:20:56 +08:00
|
|
|
!define MUI_STARTMENUPAGE_NODISABLE
|
|
|
|
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "qTox"
|
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${REG_ROOT}"
|
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${UNINSTALL_PATH}"
|
|
|
|
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${REG_START_MENU}"
|
|
|
|
!insertmacro MUI_PAGE_STARTMENU Application $SM_Folder
|
2015-02-02 05:30:13 +08:00
|
|
|
!endif
|
|
|
|
!insertmacro MUI_PAGE_INSTFILES
|
|
|
|
|
|
|
|
Function finishpageaction
|
|
|
|
${CreateShortcut} "$DESKTOP\qTox.lnk" "$INSTDIR\${MAIN_APP_EXE}" "" "" ""
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
!define MUI_FINISHPAGE_SHOWREADME ""
|
|
|
|
!define MUI_FINISHPAGE_SHOWREADME_TEXT "Create Desktop Shortcut"
|
|
|
|
!define MUI_FINISHPAGE_SHOWREADME_FUNCTION finishpageaction
|
|
|
|
|
2015-12-15 04:47:45 +08:00
|
|
|
!define MUI_FINISHPAGE_RUN_FUNCTION Launch_qTox_without_Admin
|
|
|
|
!define MUI_FINISHPAGE_RUN
|
2015-02-02 05:30:13 +08:00
|
|
|
!define MUI_FINISHPAGE_LINK "Find qTox on GitHub"
|
2016-08-04 06:25:50 +08:00
|
|
|
!define MUI_FINISHPAGE_LINK_LOCATION "https://github.com/qTox/qTox"
|
2015-02-02 05:30:13 +08:00
|
|
|
!insertmacro MUI_PAGE_FINISH
|
|
|
|
|
2015-12-15 04:47:45 +08:00
|
|
|
Function Launch_qTox_without_Admin
|
|
|
|
SetOutPath $INSTDIR
|
|
|
|
ShellExecAsUser::ShellExecAsUser "" "$INSTDIR\${MAIN_APP_EXE}" ""
|
|
|
|
FunctionEnd
|
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
!define MUI_UNABORTWARNING
|
|
|
|
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
|
|
|
|
!insertmacro MUI_UNPAGE_WELCOME
|
|
|
|
!insertmacro MUI_UNPAGE_CONFIRM
|
|
|
|
!insertmacro MUI_UNPAGE_INSTFILES
|
|
|
|
!insertmacro MUI_UNPAGE_FINISH
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "English"
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2022-03-03 12:51:41 +08:00
|
|
|
###################
|
|
|
|
#PREPARE UNINST LOG
|
|
|
|
###################
|
|
|
|
;Uninstall log file missing.
|
|
|
|
LangString UninstLogMissing ${LANG_ENGLISH} "${UninstLog} not found!$\r$\nUninstallation cannot proceed!"
|
|
|
|
|
2022-03-03 12:20:46 +08:00
|
|
|
Section "Create install directory"
|
|
|
|
CreateDirectory "$INSTDIR"
|
|
|
|
nsExec::ExecToStack 'icacls "$PROGRAMFILES64" /save "$TEMP\program-files-permissions.txt"'
|
|
|
|
Pop $0 # return value/error/timeout
|
|
|
|
Pop $1 # printed text, up to ${NSIS_MAX_STRLEN}
|
|
|
|
FileOpen $0 "$TEMP\program-files-permissions.txt" r
|
|
|
|
FileReadUTF16LE $0 $1 1024
|
|
|
|
FileReadUTF16LE $0 $2 1024
|
|
|
|
FileClose $0
|
|
|
|
FileOpen $0 "$TEMP\qTox-install-file-permissions.txt" w
|
|
|
|
FileWriteUTF16LE $0 "$INSTDIR"
|
|
|
|
FileWriteUTF16LE $0 "$\r$\n"
|
|
|
|
DetailPrint "Writing to file: $2"
|
|
|
|
FileWriteUTF16LE $0 "$2"
|
|
|
|
FileClose $0
|
|
|
|
nsExec::Exec 'icacls "" /restore "$TEMP\qTox-install-file-permissions.txt"'
|
|
|
|
SectionEnd
|
|
|
|
|
2022-03-03 12:51:41 +08:00
|
|
|
Section -openlogfile
|
|
|
|
CreateDirectory "$INSTDIR"
|
|
|
|
IfFileExists "$INSTDIR\${UninstLog}" +3
|
|
|
|
FileOpen $UninstLog "$INSTDIR\${UninstLog}" w
|
|
|
|
Goto +4
|
|
|
|
SetFileAttributes "$INSTDIR\${UninstLog}" NORMAL
|
|
|
|
FileOpen $UninstLog "$INSTDIR\${UninstLog}" a
|
|
|
|
FileSeek $UninstLog 0 END
|
|
|
|
SectionEnd
|
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
#################
|
|
|
|
#INSTALL
|
|
|
|
#################
|
|
|
|
Section "Install"
|
2020-10-07 07:20:56 +08:00
|
|
|
SetShellVarContext all
|
|
|
|
# Install files
|
|
|
|
${SetOutPath} "$INSTDIR"
|
|
|
|
${WriteUninstaller} "uninstall.exe"
|
|
|
|
|
|
|
|
${CreateDirectory} "$INSTDIR\bin"
|
|
|
|
${SetOutPath} "$INSTDIR\bin"
|
|
|
|
${File} "qtox\*.*"
|
|
|
|
|
|
|
|
${CreateDirectory} "$INSTDIR\bin\imageformats"
|
|
|
|
${SetOutPath} "$INSTDIR\bin\imageformats"
|
|
|
|
File /nonfatal "qtox\imageformats\*.*"
|
|
|
|
${SetOutPath} "$INSTDIR\bin"
|
|
|
|
|
2020-10-07 07:28:41 +08:00
|
|
|
${CreateDirectory} "$INSTDIR\bin\iconengines"
|
|
|
|
${SetOutPath} "$INSTDIR\bin\iconengines"
|
|
|
|
File /nonfatal "qtox\iconengines\*.*"
|
|
|
|
${SetOutPath} "$INSTDIR\bin"
|
|
|
|
|
2020-10-07 07:20:56 +08:00
|
|
|
${CreateDirectory} "$INSTDIR\bin\platforms"
|
|
|
|
${SetOutPath} "$INSTDIR\bin\platforms"
|
|
|
|
File /nonfatal "qtox\platforms\*.*"
|
|
|
|
${SetOutPath} "$INSTDIR\bin"
|
|
|
|
|
|
|
|
${CreateDirectory} "$INSTDIR\bin\libsnore-qt5"
|
|
|
|
${SetOutPath} "$INSTDIR\bin\libsnore-qt5"
|
|
|
|
File /nonfatal "qtox\libsnore-qt5\*.*"
|
|
|
|
${SetOutPath} "$INSTDIR\bin"
|
|
|
|
|
|
|
|
# Create shortcuts
|
|
|
|
${CreateDirectory} "$SMPROGRAMS\qTox"
|
|
|
|
${CreateShortCut} "$SMPROGRAMS\qTox\qTox.lnk" "$INSTDIR\${MAIN_APP_EXE}" "" "" ""
|
|
|
|
${CreateShortCut} "$SMPROGRAMS\qTox\Uninstall qTox.lnk" "$INSTDIR\uninstall.exe" "" "" ""
|
|
|
|
|
|
|
|
# Write setup/app info into the registry
|
|
|
|
SetRegView 64
|
|
|
|
${WriteRegStr} "${REG_ROOT}" "${REG_APP_PATH}" "" "$INSTDIR\${MAIN_APP_EXE}"
|
|
|
|
${WriteRegStr} "${REG_ROOT}" "${REG_APP_PATH}" "Path" "$INSTDIR\bin\"
|
|
|
|
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayName" "qTox"
|
2022-03-08 05:42:31 +08:00
|
|
|
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayVersion" "1.17.5"
|
2020-10-07 07:20:56 +08:00
|
|
|
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "Publisher" "The qTox Project"
|
|
|
|
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "UninstallString" "$INSTDIR\uninstall.exe"
|
|
|
|
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "URLInfoAbout" "https://qtox.github.io"
|
|
|
|
|
|
|
|
# Register the tox: protocol
|
|
|
|
${WriteRegStr} HKCR "tox" "" "URL:tox Protocol"
|
|
|
|
${WriteRegStr} HKCR "tox" "URL Protocol" ""
|
|
|
|
${WriteRegStr} HKCR "tox\shell\open\command" "" "$INSTDIR\${MAIN_APP_EXE} %1"
|
|
|
|
|
|
|
|
# Register the .tox file associations
|
|
|
|
${WriteRegStr} "HKCR" "Applications\qtox.exe\SupportedTypes" ".tox" ""
|
|
|
|
${WriteRegStr} HKCR ".tox" "" "toxsave"
|
|
|
|
${WriteRegStr} HKCR "toxsave" "" "Tox save file"
|
|
|
|
${WriteRegStr} HKCR "toxsave\DefaultIcon" "" "$INSTDIR\${MAIN_APP_EXE}"
|
|
|
|
${WriteRegStr} HKCR "toxsave\shell\open\command" "" "$INSTDIR\${MAIN_APP_EXE} %1"
|
2015-02-02 05:30:13 +08:00
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
|
|
|
|
################
|
|
|
|
#UNINSTALL
|
|
|
|
################
|
|
|
|
Section Uninstall
|
2015-12-15 04:56:37 +08:00
|
|
|
SetShellVarContext all
|
2015-02-02 05:30:13 +08:00
|
|
|
;If there's no uninstall log, we'll try anyway to clean what we can
|
|
|
|
IfFileExists "$INSTDIR\${UninstLog}" +3
|
|
|
|
Goto noLog
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
Push $R0
|
|
|
|
Push $R1
|
|
|
|
Push $R2
|
|
|
|
SetFileAttributes "$INSTDIR\${UninstLog}" NORMAL
|
|
|
|
FileOpen $UninstLog "$INSTDIR\${UninstLog}" r
|
|
|
|
StrCpy $R1 -1
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
GetLineCount:
|
|
|
|
ClearErrors
|
|
|
|
FileRead $UninstLog $R0
|
|
|
|
IntOp $R1 $R1 + 1
|
|
|
|
StrCpy $R0 $R0 -2
|
2020-05-02 06:37:47 +08:00
|
|
|
Push $R0
|
2015-02-02 05:30:13 +08:00
|
|
|
IfErrors 0 GetLineCount
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
Pop $R0
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
LoopRead:
|
|
|
|
StrCmp $R1 0 LoopDone
|
|
|
|
Pop $R0
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
IfFileExists "$R0\*.*" 0 +3
|
|
|
|
RMDir $R0 #is dir
|
|
|
|
Goto +9
|
|
|
|
IfFileExists $R0 0 +3
|
|
|
|
Delete $R0 #is file
|
|
|
|
Goto +6
|
|
|
|
StrCmp $R0 "${REG_ROOT} ${REG_APP_PATH}" 0 +3
|
|
|
|
DeleteRegKey ${REG_ROOT} "${REG_APP_PATH}" #is Reg Element
|
|
|
|
Goto +3
|
|
|
|
StrCmp $R0 "${REG_ROOT} ${UNINSTALL_PATH}" 0 +2
|
|
|
|
DeleteRegKey ${REG_ROOT} "${UNINSTALL_PATH}" #is Reg Element
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
IntOp $R1 $R1 - 1
|
|
|
|
Goto LoopRead
|
|
|
|
LoopDone:
|
|
|
|
FileClose $UninstLog
|
|
|
|
Delete "$INSTDIR\${UninstLog}"
|
|
|
|
noLog:
|
|
|
|
Delete /REBOOTOK "$INSTDIR\uninstall.exe"
|
|
|
|
RMDir /r /REBOOTOK "$INSTDIR\bin"
|
|
|
|
RMDir /REBOOTOK "$INSTDIR"
|
|
|
|
Pop $R2
|
|
|
|
Pop $R1
|
|
|
|
Pop $R0
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
;Remove start menu entries
|
|
|
|
RMDir /r /REBOOTOK "$SMPROGRAMS\qTox"
|
2020-05-02 06:37:47 +08:00
|
|
|
|
2015-02-02 05:30:13 +08:00
|
|
|
;Remove registry keys
|
2018-04-24 19:47:47 +08:00
|
|
|
SetRegView 64
|
2015-02-02 05:30:13 +08:00
|
|
|
DeleteRegKey ${REG_ROOT} "${REG_APP_PATH}"
|
|
|
|
DeleteRegKey ${REG_ROOT} "${UNINSTALL_PATH}"
|
|
|
|
DeleteRegKey HKCR "Applications\qtox.exe"
|
|
|
|
DeleteRegKey HKCR ".tox"
|
|
|
|
DeleteRegKey HKCR "tox"
|
|
|
|
DeleteRegKey HKCR "toxsave"
|
|
|
|
SectionEnd
|