mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Merge branch 'v1.17-dev'
This commit is contained in:
commit
e100f81ba9
31
CHANGELOG.md
31
CHANGELOG.md
|
@ -1,3 +1,34 @@
|
|||
<a name="v1.17.6"></a>
|
||||
## v1.17.6 (2022-03-06)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* **Windows:** Correct Program Files directory for 32-bit Windows ([47406e74](https://github.com/qTox/qTox/commit/47406e742297b167a0a6c606ddd9a20823959a06))
|
||||
* **macos:** update deprecated AVFoundation API ([484ea7ce](https://github.com/qTox/qTox/commit/484ea7ce9be971266a890c9bb76b4e23d0c8a622))
|
||||
|
||||
|
||||
|
||||
<a name="v1.17.5"></a>
|
||||
## v1.17.5 (2022-03-05)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* Update video API usage for newer libavcodec ([f5fabc2f](https://github.com/qTox/qTox/commit/f5fabc2fe24b6f01e47a527b982395a5305d31f6))
|
||||
* **Windows:**
|
||||
* Restrict non-default install directory permissions ([553bd47e](https://github.com/qTox/qTox/commit/553bd47e8171fd4f15e062e4faf734e32002f6fb))
|
||||
* Build NSIS installer in Unicode mode ([9f84184b](https://github.com/qTox/qTox/commit/9f84184ba815bfc892691fa611c6756721ba1333))
|
||||
* Define installer language before trying to access it ([1353fc93](https://github.com/qTox/qTox/commit/1353fc934ed70e9bfab3e50e42dba5eb139cd59e))
|
||||
|
||||
#### Features
|
||||
|
||||
* **Settings:** Add setting for hiding group join and leave system messages ([916e797c](https://github.com/qTox/qTox/commit/916e797c10d10ba556e9a3339353f1bd97663d15))
|
||||
* **UI:** Add UI For controlling group join and leave system messages setting ([423049db](https://github.com/qTox/qTox/commit/423049db50ffea14ec222e1a83ee976029a6afaf))
|
||||
* **chatlog:** Disable join and leave system messages based on setting ([ee0334ac](https://github.com/qTox/qTox/commit/ee0334acc55215ed8e94bae8fa4ff8976834af20))
|
||||
|
||||
|
||||
|
||||
<a name="v1.17.4"></a>
|
||||
## v1.17.14 (2021-12-14)
|
||||
|
||||
|
|
|
@ -406,7 +406,7 @@ make install clean
|
|||
|
||||
## OS X
|
||||
|
||||
Supported OS X versions: >=10.13. (NOTE: only 10.13 is tested during CI)
|
||||
Supported OS X versions: >=10.15.
|
||||
|
||||
Compiling qTox on OS X for development requires 2 tools:
|
||||
[Xcode](https://developer.apple.com/xcode/) and [homebrew](https://brew.sh).
|
||||
|
|
10
README.md
10
README.md
|
@ -154,20 +154,20 @@ AED3 1134 9C23 A123 E5C4 AA4B 139C A045 3DA2 D773
|
|||
```
|
||||
|
||||
[#qtox@libera.chat]: https://web.libera.chat/#qtox
|
||||
[64 bit release]: https://github.com/qTox/qTox/releases/download/v1.17.4/setup-qtox-x86_64-release.exe
|
||||
[32 bit release]: https://github.com/qTox/qTox/releases/download/v1.17.4/setup-qtox-i686-release.exe
|
||||
[64 bit release]: https://github.com/qTox/qTox/releases/download/v1.17.6/setup-qtox-x86_64-release.exe
|
||||
[32 bit release]: https://github.com/qTox/qTox/releases/download/v1.17.6/setup-qtox-i686-release.exe
|
||||
[32nightly]: https://github.com/qTox/qTox-nightly-releases/releases/download/ci-master-latest/setup-qtox-i686-release.exe
|
||||
[64nightly]: https://github.com/qTox/qTox-nightly-releases/releases/download/ci-master-latest/setup-qtox-x86_64-release.exe
|
||||
[Flatpak]: https://github.com/qTox/qTox/releases/download/v1.17.4/qTox-v1.17.4.x86_64.flatpak
|
||||
[Flatpak]: https://github.com/qTox/qTox/releases/download/v1.17.6/qTox-v1.17.6.x86_64.flatpak
|
||||
[Flatpak nightly]: https://github.com/qTox/qTox-nightly-releases/releases/download/ci-master-latest/qtox.flatpak
|
||||
[AppImage]: https://github.com/qTox/qTox/releases/download/v1.17.4/qTox-v1.17.4.x86_64.AppImage
|
||||
[AppImage]: https://github.com/qTox/qTox/releases/download/v1.17.6/qTox-v1.17.6.x86_64.AppImage
|
||||
[AppImage nightly]: https://github.com/qTox/qTox-nightly-releases/releases/tag/ci-master-latest
|
||||
[Arch]: /INSTALL.md#arch
|
||||
[Building instructions]: /INSTALL.md#os-x
|
||||
[Contributing]: /CONTRIBUTING.md#how-to-start-contributing
|
||||
[Debian]: https://packages.debian.org/search?keywords=qtox
|
||||
[easy issues]: https://github.com/qTox/qTox/labels/E-easy
|
||||
[Latest release]: https://github.com/qTox/qTox/releases/download/v1.17.4/qTox.dmg
|
||||
[Latest release]: https://github.com/qTox/qTox/releases/download/v1.17.6/qTox.dmg
|
||||
[Latest nightly]: https://github.com/qTox/qTox-nightly-releases/releases/download/ci-master-latest/qTox.dmg
|
||||
[Fedora]: /INSTALL.md#fedora
|
||||
[Gentoo]: /INSTALL.md#gentoo
|
||||
|
|
|
@ -8,4 +8,4 @@ set -euo pipefail
|
|||
|
||||
"$(dirname "$0")"/download/download_nsisshellexecasuser.sh
|
||||
|
||||
cp ShellExecAsUser.dll /usr/share/nsis/Plugins/x86-ansi
|
||||
cp ShellExecAsUser.dll /usr/share/nsis/Plugins/x86-unicode
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.17.4</string>
|
||||
<string>1.17.6</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>toxq</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
|
@ -84,7 +84,7 @@
|
|||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.17.4</string>
|
||||
<string>1.17.6</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
<content_attribute id="social-audio">intense</content_attribute>
|
||||
</content_rating>
|
||||
<releases>
|
||||
<release version="1.17.4" date="2021-12-14"/>
|
||||
<release version="1.17.6" date="2022-03-05"/>
|
||||
</releases>
|
||||
</component>
|
||||
|
||||
|
|
149
windows/qtox.nsi
149
windows/qtox.nsi
|
@ -1,3 +1,4 @@
|
|||
Unicode True
|
||||
###################
|
||||
#META
|
||||
###################
|
||||
|
@ -30,76 +31,90 @@ VIAddVersionKey "FileDescription" "${DESCRIPTION}"
|
|||
VIAddVersionKey "FileVersion" "${VERSION}"
|
||||
|
||||
##############
|
||||
#UNINSTALL LOG
|
||||
#DEFINE MACROS
|
||||
##############
|
||||
;Set the name of the uninstall log
|
||||
!define UninstLog "uninstall.log"
|
||||
Var UninstLog
|
||||
|
||||
;AddItem macro
|
||||
!macro AddItem Path
|
||||
FileWrite $UninstLog "${Path}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${Path}$\r$\n"
|
||||
!macroend
|
||||
!define AddItem "!insertmacro AddItem"
|
||||
|
||||
;File macro
|
||||
!macro File FileName
|
||||
IfFileExists "$OUTDIR\${FileName}" +2
|
||||
FileWrite $UninstLog "$OUTDIR\${FileName}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "$OUTDIR\${FileName}$\r$\n"
|
||||
File "${FileName}"
|
||||
!macroend
|
||||
!define File "!insertmacro File"
|
||||
|
||||
;CreateShortcut macro
|
||||
!macro CreateShortcut FilePath FilePointer Pamameters Icon IconIndex
|
||||
FileWrite $UninstLog "${FilePath}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${FilePath}$\r$\n"
|
||||
CreateShortcut "${FilePath}" "${FilePointer}" "${Pamameters}" "${Icon}" "${IconIndex}"
|
||||
!macroend
|
||||
!define CreateShortcut "!insertmacro CreateShortcut"
|
||||
|
||||
;Copy files macro
|
||||
!macro CopyFiles SourcePath DestPath
|
||||
IfFileExists "${DestPath}" +2
|
||||
FileWrite $UninstLog "${DestPath}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${DestPath}$\r$\n"
|
||||
CopyFiles "${SourcePath}" "${DestPath}"
|
||||
!macroend
|
||||
!define CopyFiles "!insertmacro CopyFiles"
|
||||
|
||||
;Rename macro
|
||||
!macro Rename SourcePath DestPath
|
||||
IfFileExists "${DestPath}" +2
|
||||
FileWrite $UninstLog "${DestPath}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${DestPath}$\r$\n"
|
||||
Rename "${SourcePath}" "${DestPath}"
|
||||
!macroend
|
||||
!define Rename "!insertmacro Rename"
|
||||
|
||||
;CreateDirectory macro
|
||||
!macro CreateDirectory Path
|
||||
CreateDirectory "${Path}"
|
||||
FileWrite $UninstLog "${Path}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${Path}$\r$\n"
|
||||
!macroend
|
||||
!define CreateDirectory "!insertmacro CreateDirectory"
|
||||
|
||||
;SetOutPath macro
|
||||
!macro SetOutPath Path
|
||||
SetOutPath "${Path}"
|
||||
FileWrite $UninstLog "${Path}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${Path}$\r$\n"
|
||||
!macroend
|
||||
!define SetOutPath "!insertmacro SetOutPath"
|
||||
|
||||
;WriteUninstaller macro
|
||||
!macro WriteUninstaller Path
|
||||
WriteUninstaller "${Path}"
|
||||
FileWrite $UninstLog "${Path}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${Path}$\r$\n"
|
||||
!macroend
|
||||
!define WriteUninstaller "!insertmacro WriteUninstaller"
|
||||
|
||||
;WriteIniStr macro
|
||||
!macro WriteIniStr IniFile SectionName EntryName NewValue
|
||||
IfFileExists "${IniFile}" +2
|
||||
FileWrite $UninstLog "${IniFile}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${IniFile}$\r$\n"
|
||||
WriteIniStr "${IniFile}" "${SectionName}" "${EntryName}" "${NewValue}"
|
||||
!macroend
|
||||
|
||||
;WriteRegStr macro
|
||||
!macro WriteRegStr RegRoot UnInstallPath Key Value
|
||||
FileWrite $UninstLog "${RegRoot} ${UnInstallPath}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${RegRoot} ${UnInstallPath}$\r$\n"
|
||||
WriteRegStr "${RegRoot}" "${UnInstallPath}" "${Key}" "${Value}"
|
||||
!macroend
|
||||
!define WriteRegStr "!insertmacro WriteRegStr"
|
||||
|
||||
;WriteRegDWORD macro
|
||||
!macro WriteRegDWORD RegRoot UnInstallPath Key Value
|
||||
FileWrite $UninstLog "${RegRoot} ${UnInstallPath}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${RegRoot} ${UnInstallPath}$\r$\n"
|
||||
WriteRegDWORD "${RegRoot}" "${UnInstallPath}" "${Key}" "${Value}"
|
||||
!macroend
|
||||
!define WriteRegDWORD "!insertmacro WriteRegDWORD"
|
||||
|
||||
;BackupFile macro
|
||||
!macro BackupFile FILE_DIR FILE BACKUP_TO
|
||||
|
@ -108,94 +123,36 @@ VIAddVersionKey "FileVersion" "${VERSION}"
|
|||
IfFileExists "${FILE_DIR}\${FILE}" 0 +2
|
||||
Rename "${FILE_DIR}\${FILE}" "${BACKUP_TO}\${FILE}"
|
||||
!macroend
|
||||
!define BackupFile "!insertmacro BackupFile"
|
||||
|
||||
;RestoreFile macro
|
||||
!macro RestoreFile BUP_DIR FILE RESTORE_TO
|
||||
IfFileExists "${BUP_DIR}\${FILE}" 0 +2
|
||||
Rename "${BUP_DIR}\${FILE}" "${RESTORE_TO}\${FILE}"
|
||||
!macroend
|
||||
!define RestoreFile "!insertmacro RestoreFile"
|
||||
|
||||
;BackupFiles macro
|
||||
!macro BackupFiles FILE_DIR FILE BACKUP_TO
|
||||
IfFileExists "${BACKUP_TO}\*.*" +2
|
||||
CreateDirectory "22222"
|
||||
IfFileExists "${FILE_DIR}\${FILE}" 0 +7
|
||||
FileWrite $UninstLog "${FILE_DIR}\${FILE}$\r$\n"
|
||||
FileWrite $UninstLog "${BACKUP_TO}\${FILE}$\r$\n"
|
||||
FileWrite $UninstLog "FileBackup$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${FILE_DIR}\${FILE}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${BACKUP_TO}\${FILE}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "FileBackup$\r$\n"
|
||||
Rename "${FILE_DIR}\${FILE}" "${BACKUP_TO}\${FILE}"
|
||||
SetOutPath "${FILE_DIR}"
|
||||
File "${FILE}" #After the Original file is backed up write the new file.
|
||||
!macroend
|
||||
!define BackupFiles "!insertmacro BackupFiles"
|
||||
|
||||
;RestoreFiles macro
|
||||
!macro RestoreFiles BUP_FILE RESTORE_FILE
|
||||
IfFileExists "${BUP_FILE}" 0 +2
|
||||
CopyFiles "${BUP_FILE}" "${RESTORE_FILE}"
|
||||
!macroend
|
||||
|
||||
###################
|
||||
#PREPARE UNINST LOG
|
||||
###################
|
||||
;Set the name of the uninstall log
|
||||
!define UninstLog "uninstall.log"
|
||||
Var UninstLog
|
||||
|
||||
;Uninstall log file missing.
|
||||
LangString UninstLogMissing ${LANG_ENGLISH} "${UninstLog} not found!$\r$\nUninstallation cannot proceed!"
|
||||
|
||||
;AddItem macro
|
||||
!define AddItem "!insertmacro AddItem"
|
||||
|
||||
;BackupFile macro
|
||||
!define BackupFile "!insertmacro BackupFile"
|
||||
|
||||
;BackupFiles macro
|
||||
!define BackupFiles "!insertmacro BackupFiles"
|
||||
|
||||
;Copy files macro
|
||||
!define CopyFiles "!insertmacro CopyFiles"
|
||||
|
||||
;CreateDirectory macro
|
||||
!define CreateDirectory "!insertmacro CreateDirectory"
|
||||
|
||||
;CreateShortcut macro
|
||||
!define CreateShortcut "!insertmacro CreateShortcut"
|
||||
|
||||
;File macro
|
||||
!define File "!insertmacro File"
|
||||
|
||||
;Rename macro
|
||||
!define Rename "!insertmacro Rename"
|
||||
|
||||
;RestoreFile macro
|
||||
!define RestoreFile "!insertmacro RestoreFile"
|
||||
|
||||
;RestoreFiles macro
|
||||
!define RestoreFiles "!insertmacro RestoreFiles"
|
||||
|
||||
;SetOutPath macro
|
||||
!define SetOutPath "!insertmacro SetOutPath"
|
||||
|
||||
;WriteRegDWORD macro
|
||||
!define WriteRegDWORD "!insertmacro WriteRegDWORD"
|
||||
|
||||
;WriteRegStr macro
|
||||
!define WriteRegStr "!insertmacro WriteRegStr"
|
||||
|
||||
;WriteUninstaller macro
|
||||
!define WriteUninstaller "!insertmacro WriteUninstaller"
|
||||
|
||||
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
|
||||
|
||||
##############
|
||||
#MODERN UI
|
||||
##############
|
||||
|
@ -243,6 +200,42 @@ FunctionEnd
|
|||
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
|
||||
###################
|
||||
#PREPARE UNINST LOG
|
||||
###################
|
||||
;Uninstall log file missing.
|
||||
LangString UninstLogMissing ${LANG_ENGLISH} "${UninstLog} not found!$\r$\nUninstallation cannot proceed!"
|
||||
|
||||
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
|
||||
DetailPrint "First read line is: $1"
|
||||
DetailPrint "Second read line is: $2"
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
#################
|
||||
#INSTALL
|
||||
#################
|
||||
|
@ -285,7 +278,7 @@ Section "Install"
|
|||
${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"
|
||||
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayVersion" "1.17.4"
|
||||
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayVersion" "1.17.5"
|
||||
${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"
|
||||
|
@ -322,7 +315,7 @@ Section Uninstall
|
|||
|
||||
GetLineCount:
|
||||
ClearErrors
|
||||
FileRead $UninstLog $R0
|
||||
FileReadUTF16LE $UninstLog $R0
|
||||
IntOp $R1 $R1 + 1
|
||||
StrCpy $R0 $R0 -2
|
||||
Push $R0
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
Unicode True
|
||||
###################
|
||||
#META
|
||||
###################
|
||||
|
@ -30,76 +31,90 @@ VIAddVersionKey "FileDescription" "${DESCRIPTION}"
|
|||
VIAddVersionKey "FileVersion" "${VERSION}"
|
||||
|
||||
##############
|
||||
#UNINSTALL LOG
|
||||
#DEFINE MACROS
|
||||
##############
|
||||
;Set the name of the uninstall log
|
||||
!define UninstLog "uninstall.log"
|
||||
Var UninstLog
|
||||
|
||||
;AddItem macro
|
||||
!macro AddItem Path
|
||||
FileWrite $UninstLog "${Path}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${Path}$\r$\n"
|
||||
!macroend
|
||||
!define AddItem "!insertmacro AddItem"
|
||||
|
||||
;File macro
|
||||
!macro File FileName
|
||||
IfFileExists "$OUTDIR\${FileName}" +2
|
||||
FileWrite $UninstLog "$OUTDIR\${FileName}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "$OUTDIR\${FileName}$\r$\n"
|
||||
File "${FileName}"
|
||||
!macroend
|
||||
!define File "!insertmacro File"
|
||||
|
||||
;CreateShortcut macro
|
||||
!macro CreateShortcut FilePath FilePointer Pamameters Icon IconIndex
|
||||
FileWrite $UninstLog "${FilePath}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${FilePath}$\r$\n"
|
||||
CreateShortcut "${FilePath}" "${FilePointer}" "${Pamameters}" "${Icon}" "${IconIndex}"
|
||||
!macroend
|
||||
!define CreateShortcut "!insertmacro CreateShortcut"
|
||||
|
||||
;Copy files macro
|
||||
!macro CopyFiles SourcePath DestPath
|
||||
IfFileExists "${DestPath}" +2
|
||||
FileWrite $UninstLog "${DestPath}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${DestPath}$\r$\n"
|
||||
CopyFiles "${SourcePath}" "${DestPath}"
|
||||
!macroend
|
||||
!define CopyFiles "!insertmacro CopyFiles"
|
||||
|
||||
;Rename macro
|
||||
!macro Rename SourcePath DestPath
|
||||
IfFileExists "${DestPath}" +2
|
||||
FileWrite $UninstLog "${DestPath}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${DestPath}$\r$\n"
|
||||
Rename "${SourcePath}" "${DestPath}"
|
||||
!macroend
|
||||
!define Rename "!insertmacro Rename"
|
||||
|
||||
;CreateDirectory macro
|
||||
!macro CreateDirectory Path
|
||||
CreateDirectory "${Path}"
|
||||
FileWrite $UninstLog "${Path}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${Path}$\r$\n"
|
||||
!macroend
|
||||
!define CreateDirectory "!insertmacro CreateDirectory"
|
||||
|
||||
;SetOutPath macro
|
||||
!macro SetOutPath Path
|
||||
SetOutPath "${Path}"
|
||||
FileWrite $UninstLog "${Path}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${Path}$\r$\n"
|
||||
!macroend
|
||||
!define SetOutPath "!insertmacro SetOutPath"
|
||||
|
||||
;WriteUninstaller macro
|
||||
!macro WriteUninstaller Path
|
||||
WriteUninstaller "${Path}"
|
||||
FileWrite $UninstLog "${Path}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${Path}$\r$\n"
|
||||
!macroend
|
||||
!define WriteUninstaller "!insertmacro WriteUninstaller"
|
||||
|
||||
;WriteIniStr macro
|
||||
!macro WriteIniStr IniFile SectionName EntryName NewValue
|
||||
IfFileExists "${IniFile}" +2
|
||||
FileWrite $UninstLog "${IniFile}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${IniFile}$\r$\n"
|
||||
WriteIniStr "${IniFile}" "${SectionName}" "${EntryName}" "${NewValue}"
|
||||
!macroend
|
||||
|
||||
;WriteRegStr macro
|
||||
!macro WriteRegStr RegRoot UnInstallPath Key Value
|
||||
FileWrite $UninstLog "${RegRoot} ${UnInstallPath}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${RegRoot} ${UnInstallPath}$\r$\n"
|
||||
WriteRegStr "${RegRoot}" "${UnInstallPath}" "${Key}" "${Value}"
|
||||
!macroend
|
||||
!define WriteRegStr "!insertmacro WriteRegStr"
|
||||
|
||||
;WriteRegDWORD macro
|
||||
!macro WriteRegDWORD RegRoot UnInstallPath Key Value
|
||||
FileWrite $UninstLog "${RegRoot} ${UnInstallPath}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${RegRoot} ${UnInstallPath}$\r$\n"
|
||||
WriteRegDWORD "${RegRoot}" "${UnInstallPath}" "${Key}" "${Value}"
|
||||
!macroend
|
||||
!define WriteRegDWORD "!insertmacro WriteRegDWORD"
|
||||
|
||||
;BackupFile macro
|
||||
!macro BackupFile FILE_DIR FILE BACKUP_TO
|
||||
|
@ -108,94 +123,36 @@ VIAddVersionKey "FileVersion" "${VERSION}"
|
|||
IfFileExists "${FILE_DIR}\${FILE}" 0 +2
|
||||
Rename "${FILE_DIR}\${FILE}" "${BACKUP_TO}\${FILE}"
|
||||
!macroend
|
||||
!define BackupFile "!insertmacro BackupFile"
|
||||
|
||||
;RestoreFile macro
|
||||
!macro RestoreFile BUP_DIR FILE RESTORE_TO
|
||||
IfFileExists "${BUP_DIR}\${FILE}" 0 +2
|
||||
Rename "${BUP_DIR}\${FILE}" "${RESTORE_TO}\${FILE}"
|
||||
!macroend
|
||||
!define RestoreFile "!insertmacro RestoreFile"
|
||||
|
||||
;BackupFiles macro
|
||||
!macro BackupFiles FILE_DIR FILE BACKUP_TO
|
||||
IfFileExists "${BACKUP_TO}\*.*" +2
|
||||
CreateDirectory "22222"
|
||||
IfFileExists "${FILE_DIR}\${FILE}" 0 +7
|
||||
FileWrite $UninstLog "${FILE_DIR}\${FILE}$\r$\n"
|
||||
FileWrite $UninstLog "${BACKUP_TO}\${FILE}$\r$\n"
|
||||
FileWrite $UninstLog "FileBackup$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${FILE_DIR}\${FILE}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "${BACKUP_TO}\${FILE}$\r$\n"
|
||||
FileWriteUTF16LE $UninstLog "FileBackup$\r$\n"
|
||||
Rename "${FILE_DIR}\${FILE}" "${BACKUP_TO}\${FILE}"
|
||||
SetOutPath "${FILE_DIR}"
|
||||
File "${FILE}" #After the Original file is backed up write the new file.
|
||||
!macroend
|
||||
!define BackupFiles "!insertmacro BackupFiles"
|
||||
|
||||
;RestoreFiles macro
|
||||
!macro RestoreFiles BUP_FILE RESTORE_FILE
|
||||
IfFileExists "${BUP_FILE}" 0 +2
|
||||
CopyFiles "${BUP_FILE}" "${RESTORE_FILE}"
|
||||
!macroend
|
||||
|
||||
###################
|
||||
#PREPARE UNINST LOG
|
||||
###################
|
||||
;Set the name of the uninstall log
|
||||
!define UninstLog "uninstall.log"
|
||||
Var UninstLog
|
||||
|
||||
;Uninstall log file missing.
|
||||
LangString UninstLogMissing ${LANG_ENGLISH} "${UninstLog} not found!$\r$\nUninstallation cannot proceed!"
|
||||
|
||||
;AddItem macro
|
||||
!define AddItem "!insertmacro AddItem"
|
||||
|
||||
;BackupFile macro
|
||||
!define BackupFile "!insertmacro BackupFile"
|
||||
|
||||
;BackupFiles macro
|
||||
!define BackupFiles "!insertmacro BackupFiles"
|
||||
|
||||
;Copy files macro
|
||||
!define CopyFiles "!insertmacro CopyFiles"
|
||||
|
||||
;CreateDirectory macro
|
||||
!define CreateDirectory "!insertmacro CreateDirectory"
|
||||
|
||||
;CreateShortcut macro
|
||||
!define CreateShortcut "!insertmacro CreateShortcut"
|
||||
|
||||
;File macro
|
||||
!define File "!insertmacro File"
|
||||
|
||||
;Rename macro
|
||||
!define Rename "!insertmacro Rename"
|
||||
|
||||
;RestoreFile macro
|
||||
!define RestoreFile "!insertmacro RestoreFile"
|
||||
|
||||
;RestoreFiles macro
|
||||
!define RestoreFiles "!insertmacro RestoreFiles"
|
||||
|
||||
;SetOutPath macro
|
||||
!define SetOutPath "!insertmacro SetOutPath"
|
||||
|
||||
;WriteRegDWORD macro
|
||||
!define WriteRegDWORD "!insertmacro WriteRegDWORD"
|
||||
|
||||
;WriteRegStr macro
|
||||
!define WriteRegStr "!insertmacro WriteRegStr"
|
||||
|
||||
;WriteUninstaller macro
|
||||
!define WriteUninstaller "!insertmacro WriteUninstaller"
|
||||
|
||||
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
|
||||
|
||||
##############
|
||||
#MODERN UI
|
||||
##############
|
||||
|
@ -243,6 +200,42 @@ FunctionEnd
|
|||
|
||||
!insertmacro MUI_LANGUAGE "English"
|
||||
|
||||
###################
|
||||
#PREPARE UNINST LOG
|
||||
###################
|
||||
;Uninstall log file missing.
|
||||
LangString UninstLogMissing ${LANG_ENGLISH} "${UninstLog} not found!$\r$\nUninstallation cannot proceed!"
|
||||
|
||||
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
|
||||
DetailPrint "First read line is: $1"
|
||||
DetailPrint "Second read line is: $2"
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
#################
|
||||
#INSTALL
|
||||
#################
|
||||
|
@ -286,7 +279,7 @@ Section "Install"
|
|||
${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"
|
||||
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayVersion" "1.17.4"
|
||||
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayVersion" "1.17.5"
|
||||
${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"
|
||||
|
|
Loading…
Reference in New Issue
Block a user