1
0
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:
Anthony Bilinski 2022-03-07 13:42:31 -08:00
commit e100f81ba9
No known key found for this signature in database
GPG Key ID: 2AA8E0DA1B31FB3C
8 changed files with 184 additions and 167 deletions

View File

@ -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> <a name="v1.17.4"></a>
## v1.17.14 (2021-12-14) ## v1.17.14 (2021-12-14)

View File

@ -406,7 +406,7 @@ make install clean
## OS X ## 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: Compiling qTox on OS X for development requires 2 tools:
[Xcode](https://developer.apple.com/xcode/) and [homebrew](https://brew.sh). [Xcode](https://developer.apple.com/xcode/) and [homebrew](https://brew.sh).

View File

@ -154,20 +154,20 @@ AED3 1134 9C23 A123 E5C4 AA4B 139C A045 3DA2 D773
``` ```
[#qtox@libera.chat]: https://web.libera.chat/#qtox [#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 [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.4/setup-qtox-i686-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 [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 [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 [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 [AppImage nightly]: https://github.com/qTox/qTox-nightly-releases/releases/tag/ci-master-latest
[Arch]: /INSTALL.md#arch [Arch]: /INSTALL.md#arch
[Building instructions]: /INSTALL.md#os-x [Building instructions]: /INSTALL.md#os-x
[Contributing]: /CONTRIBUTING.md#how-to-start-contributing [Contributing]: /CONTRIBUTING.md#how-to-start-contributing
[Debian]: https://packages.debian.org/search?keywords=qtox [Debian]: https://packages.debian.org/search?keywords=qtox
[easy issues]: https://github.com/qTox/qTox/labels/E-easy [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 [Latest nightly]: https://github.com/qTox/qTox-nightly-releases/releases/download/ci-master-latest/qTox.dmg
[Fedora]: /INSTALL.md#fedora [Fedora]: /INSTALL.md#fedora
[Gentoo]: /INSTALL.md#gentoo [Gentoo]: /INSTALL.md#gentoo

View File

@ -8,4 +8,4 @@ set -euo pipefail
"$(dirname "$0")"/download/download_nsisshellexecasuser.sh "$(dirname "$0")"/download/download_nsisshellexecasuser.sh
cp ShellExecAsUser.dll /usr/share/nsis/Plugins/x86-ansi cp ShellExecAsUser.dll /usr/share/nsis/Plugins/x86-unicode

View File

@ -65,7 +65,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.17.4</string> <string>1.17.6</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>toxq</string> <string>toxq</string>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
@ -84,7 +84,7 @@
</dict> </dict>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.17.4</string> <string>1.17.6</string>
<key>NSPrincipalClass</key> <key>NSPrincipalClass</key>
<string>NSApplication</string> <string>NSApplication</string>
<key>NSCameraUsageDescription</key> <key>NSCameraUsageDescription</key>

View File

@ -68,7 +68,7 @@
<content_attribute id="social-audio">intense</content_attribute> <content_attribute id="social-audio">intense</content_attribute>
</content_rating> </content_rating>
<releases> <releases>
<release version="1.17.4" date="2021-12-14"/> <release version="1.17.6" date="2022-03-05"/>
</releases> </releases>
</component> </component>

View File

@ -1,3 +1,4 @@
Unicode True
################### ###################
#META #META
################### ###################
@ -30,76 +31,90 @@ VIAddVersionKey "FileDescription" "${DESCRIPTION}"
VIAddVersionKey "FileVersion" "${VERSION}" VIAddVersionKey "FileVersion" "${VERSION}"
############## ##############
#UNINSTALL LOG #DEFINE MACROS
############## ##############
;Set the name of the uninstall log
!define UninstLog "uninstall.log"
Var UninstLog
;AddItem macro ;AddItem macro
!macro AddItem Path !macro AddItem Path
FileWrite $UninstLog "${Path}$\r$\n" FileWriteUTF16LE $UninstLog "${Path}$\r$\n"
!macroend !macroend
!define AddItem "!insertmacro AddItem"
;File macro ;File macro
!macro File FileName !macro File FileName
IfFileExists "$OUTDIR\${FileName}" +2 IfFileExists "$OUTDIR\${FileName}" +2
FileWrite $UninstLog "$OUTDIR\${FileName}$\r$\n" FileWriteUTF16LE $UninstLog "$OUTDIR\${FileName}$\r$\n"
File "${FileName}" File "${FileName}"
!macroend !macroend
!define File "!insertmacro File"
;CreateShortcut macro ;CreateShortcut macro
!macro CreateShortcut FilePath FilePointer Pamameters Icon IconIndex !macro CreateShortcut FilePath FilePointer Pamameters Icon IconIndex
FileWrite $UninstLog "${FilePath}$\r$\n" FileWriteUTF16LE $UninstLog "${FilePath}$\r$\n"
CreateShortcut "${FilePath}" "${FilePointer}" "${Pamameters}" "${Icon}" "${IconIndex}" CreateShortcut "${FilePath}" "${FilePointer}" "${Pamameters}" "${Icon}" "${IconIndex}"
!macroend !macroend
!define CreateShortcut "!insertmacro CreateShortcut"
;Copy files macro ;Copy files macro
!macro CopyFiles SourcePath DestPath !macro CopyFiles SourcePath DestPath
IfFileExists "${DestPath}" +2 IfFileExists "${DestPath}" +2
FileWrite $UninstLog "${DestPath}$\r$\n" FileWriteUTF16LE $UninstLog "${DestPath}$\r$\n"
CopyFiles "${SourcePath}" "${DestPath}" CopyFiles "${SourcePath}" "${DestPath}"
!macroend !macroend
!define CopyFiles "!insertmacro CopyFiles"
;Rename macro ;Rename macro
!macro Rename SourcePath DestPath !macro Rename SourcePath DestPath
IfFileExists "${DestPath}" +2 IfFileExists "${DestPath}" +2
FileWrite $UninstLog "${DestPath}$\r$\n" FileWriteUTF16LE $UninstLog "${DestPath}$\r$\n"
Rename "${SourcePath}" "${DestPath}" Rename "${SourcePath}" "${DestPath}"
!macroend !macroend
!define Rename "!insertmacro Rename"
;CreateDirectory macro ;CreateDirectory macro
!macro CreateDirectory Path !macro CreateDirectory Path
CreateDirectory "${Path}" CreateDirectory "${Path}"
FileWrite $UninstLog "${Path}$\r$\n" FileWriteUTF16LE $UninstLog "${Path}$\r$\n"
!macroend !macroend
!define CreateDirectory "!insertmacro CreateDirectory"
;SetOutPath macro ;SetOutPath macro
!macro SetOutPath Path !macro SetOutPath Path
SetOutPath "${Path}" SetOutPath "${Path}"
FileWrite $UninstLog "${Path}$\r$\n" FileWriteUTF16LE $UninstLog "${Path}$\r$\n"
!macroend !macroend
!define SetOutPath "!insertmacro SetOutPath"
;WriteUninstaller macro ;WriteUninstaller macro
!macro WriteUninstaller Path !macro WriteUninstaller Path
WriteUninstaller "${Path}" WriteUninstaller "${Path}"
FileWrite $UninstLog "${Path}$\r$\n" FileWriteUTF16LE $UninstLog "${Path}$\r$\n"
!macroend !macroend
!define WriteUninstaller "!insertmacro WriteUninstaller"
;WriteIniStr macro ;WriteIniStr macro
!macro WriteIniStr IniFile SectionName EntryName NewValue !macro WriteIniStr IniFile SectionName EntryName NewValue
IfFileExists "${IniFile}" +2 IfFileExists "${IniFile}" +2
FileWrite $UninstLog "${IniFile}$\r$\n" FileWriteUTF16LE $UninstLog "${IniFile}$\r$\n"
WriteIniStr "${IniFile}" "${SectionName}" "${EntryName}" "${NewValue}" WriteIniStr "${IniFile}" "${SectionName}" "${EntryName}" "${NewValue}"
!macroend !macroend
;WriteRegStr macro ;WriteRegStr macro
!macro WriteRegStr RegRoot UnInstallPath Key Value !macro WriteRegStr RegRoot UnInstallPath Key Value
FileWrite $UninstLog "${RegRoot} ${UnInstallPath}$\r$\n" FileWriteUTF16LE $UninstLog "${RegRoot} ${UnInstallPath}$\r$\n"
WriteRegStr "${RegRoot}" "${UnInstallPath}" "${Key}" "${Value}" WriteRegStr "${RegRoot}" "${UnInstallPath}" "${Key}" "${Value}"
!macroend !macroend
!define WriteRegStr "!insertmacro WriteRegStr"
;WriteRegDWORD macro ;WriteRegDWORD macro
!macro WriteRegDWORD RegRoot UnInstallPath Key Value !macro WriteRegDWORD RegRoot UnInstallPath Key Value
FileWrite $UninstLog "${RegRoot} ${UnInstallPath}$\r$\n" FileWriteUTF16LE $UninstLog "${RegRoot} ${UnInstallPath}$\r$\n"
WriteRegDWORD "${RegRoot}" "${UnInstallPath}" "${Key}" "${Value}" WriteRegDWORD "${RegRoot}" "${UnInstallPath}" "${Key}" "${Value}"
!macroend !macroend
!define WriteRegDWORD "!insertmacro WriteRegDWORD"
;BackupFile macro ;BackupFile macro
!macro BackupFile FILE_DIR FILE BACKUP_TO !macro BackupFile FILE_DIR FILE BACKUP_TO
@ -108,94 +123,36 @@ VIAddVersionKey "FileVersion" "${VERSION}"
IfFileExists "${FILE_DIR}\${FILE}" 0 +2 IfFileExists "${FILE_DIR}\${FILE}" 0 +2
Rename "${FILE_DIR}\${FILE}" "${BACKUP_TO}\${FILE}" Rename "${FILE_DIR}\${FILE}" "${BACKUP_TO}\${FILE}"
!macroend !macroend
!define BackupFile "!insertmacro BackupFile"
;RestoreFile macro ;RestoreFile macro
!macro RestoreFile BUP_DIR FILE RESTORE_TO !macro RestoreFile BUP_DIR FILE RESTORE_TO
IfFileExists "${BUP_DIR}\${FILE}" 0 +2 IfFileExists "${BUP_DIR}\${FILE}" 0 +2
Rename "${BUP_DIR}\${FILE}" "${RESTORE_TO}\${FILE}" Rename "${BUP_DIR}\${FILE}" "${RESTORE_TO}\${FILE}"
!macroend !macroend
!define RestoreFile "!insertmacro RestoreFile"
;BackupFiles macro ;BackupFiles macro
!macro BackupFiles FILE_DIR FILE BACKUP_TO !macro BackupFiles FILE_DIR FILE BACKUP_TO
IfFileExists "${BACKUP_TO}\*.*" +2 IfFileExists "${BACKUP_TO}\*.*" +2
CreateDirectory "22222" CreateDirectory "22222"
IfFileExists "${FILE_DIR}\${FILE}" 0 +7 IfFileExists "${FILE_DIR}\${FILE}" 0 +7
FileWrite $UninstLog "${FILE_DIR}\${FILE}$\r$\n" FileWriteUTF16LE $UninstLog "${FILE_DIR}\${FILE}$\r$\n"
FileWrite $UninstLog "${BACKUP_TO}\${FILE}$\r$\n" FileWriteUTF16LE $UninstLog "${BACKUP_TO}\${FILE}$\r$\n"
FileWrite $UninstLog "FileBackup$\r$\n" FileWriteUTF16LE $UninstLog "FileBackup$\r$\n"
Rename "${FILE_DIR}\${FILE}" "${BACKUP_TO}\${FILE}" Rename "${FILE_DIR}\${FILE}" "${BACKUP_TO}\${FILE}"
SetOutPath "${FILE_DIR}" SetOutPath "${FILE_DIR}"
File "${FILE}" #After the Original file is backed up write the new file. File "${FILE}" #After the Original file is backed up write the new file.
!macroend !macroend
!define BackupFiles "!insertmacro BackupFiles"
;RestoreFiles macro ;RestoreFiles macro
!macro RestoreFiles BUP_FILE RESTORE_FILE !macro RestoreFiles BUP_FILE RESTORE_FILE
IfFileExists "${BUP_FILE}" 0 +2 IfFileExists "${BUP_FILE}" 0 +2
CopyFiles "${BUP_FILE}" "${RESTORE_FILE}" CopyFiles "${BUP_FILE}" "${RESTORE_FILE}"
!macroend !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" !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 #MODERN UI
############## ##############
@ -243,6 +200,42 @@ FunctionEnd
!insertmacro MUI_LANGUAGE "English" !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 #INSTALL
################# #################
@ -285,7 +278,7 @@ Section "Install"
${WriteRegStr} "${REG_ROOT}" "${REG_APP_PATH}" "" "$INSTDIR\${MAIN_APP_EXE}" ${WriteRegStr} "${REG_ROOT}" "${REG_APP_PATH}" "" "$INSTDIR\${MAIN_APP_EXE}"
${WriteRegStr} "${REG_ROOT}" "${REG_APP_PATH}" "Path" "$INSTDIR\bin\" ${WriteRegStr} "${REG_ROOT}" "${REG_APP_PATH}" "Path" "$INSTDIR\bin\"
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayName" "qTox" ${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}" "Publisher" "The qTox Project"
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "UninstallString" "$INSTDIR\uninstall.exe" ${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "UninstallString" "$INSTDIR\uninstall.exe"
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "URLInfoAbout" "https://qtox.github.io" ${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "URLInfoAbout" "https://qtox.github.io"
@ -322,7 +315,7 @@ Section Uninstall
GetLineCount: GetLineCount:
ClearErrors ClearErrors
FileRead $UninstLog $R0 FileReadUTF16LE $UninstLog $R0
IntOp $R1 $R1 + 1 IntOp $R1 $R1 + 1
StrCpy $R0 $R0 -2 StrCpy $R0 $R0 -2
Push $R0 Push $R0

View File

@ -1,3 +1,4 @@
Unicode True
################### ###################
#META #META
################### ###################
@ -30,76 +31,90 @@ VIAddVersionKey "FileDescription" "${DESCRIPTION}"
VIAddVersionKey "FileVersion" "${VERSION}" VIAddVersionKey "FileVersion" "${VERSION}"
############## ##############
#UNINSTALL LOG #DEFINE MACROS
############## ##############
;Set the name of the uninstall log
!define UninstLog "uninstall.log"
Var UninstLog
;AddItem macro ;AddItem macro
!macro AddItem Path !macro AddItem Path
FileWrite $UninstLog "${Path}$\r$\n" FileWriteUTF16LE $UninstLog "${Path}$\r$\n"
!macroend !macroend
!define AddItem "!insertmacro AddItem"
;File macro ;File macro
!macro File FileName !macro File FileName
IfFileExists "$OUTDIR\${FileName}" +2 IfFileExists "$OUTDIR\${FileName}" +2
FileWrite $UninstLog "$OUTDIR\${FileName}$\r$\n" FileWriteUTF16LE $UninstLog "$OUTDIR\${FileName}$\r$\n"
File "${FileName}" File "${FileName}"
!macroend !macroend
!define File "!insertmacro File"
;CreateShortcut macro ;CreateShortcut macro
!macro CreateShortcut FilePath FilePointer Pamameters Icon IconIndex !macro CreateShortcut FilePath FilePointer Pamameters Icon IconIndex
FileWrite $UninstLog "${FilePath}$\r$\n" FileWriteUTF16LE $UninstLog "${FilePath}$\r$\n"
CreateShortcut "${FilePath}" "${FilePointer}" "${Pamameters}" "${Icon}" "${IconIndex}" CreateShortcut "${FilePath}" "${FilePointer}" "${Pamameters}" "${Icon}" "${IconIndex}"
!macroend !macroend
!define CreateShortcut "!insertmacro CreateShortcut"
;Copy files macro ;Copy files macro
!macro CopyFiles SourcePath DestPath !macro CopyFiles SourcePath DestPath
IfFileExists "${DestPath}" +2 IfFileExists "${DestPath}" +2
FileWrite $UninstLog "${DestPath}$\r$\n" FileWriteUTF16LE $UninstLog "${DestPath}$\r$\n"
CopyFiles "${SourcePath}" "${DestPath}" CopyFiles "${SourcePath}" "${DestPath}"
!macroend !macroend
!define CopyFiles "!insertmacro CopyFiles"
;Rename macro ;Rename macro
!macro Rename SourcePath DestPath !macro Rename SourcePath DestPath
IfFileExists "${DestPath}" +2 IfFileExists "${DestPath}" +2
FileWrite $UninstLog "${DestPath}$\r$\n" FileWriteUTF16LE $UninstLog "${DestPath}$\r$\n"
Rename "${SourcePath}" "${DestPath}" Rename "${SourcePath}" "${DestPath}"
!macroend !macroend
!define Rename "!insertmacro Rename"
;CreateDirectory macro ;CreateDirectory macro
!macro CreateDirectory Path !macro CreateDirectory Path
CreateDirectory "${Path}" CreateDirectory "${Path}"
FileWrite $UninstLog "${Path}$\r$\n" FileWriteUTF16LE $UninstLog "${Path}$\r$\n"
!macroend !macroend
!define CreateDirectory "!insertmacro CreateDirectory"
;SetOutPath macro ;SetOutPath macro
!macro SetOutPath Path !macro SetOutPath Path
SetOutPath "${Path}" SetOutPath "${Path}"
FileWrite $UninstLog "${Path}$\r$\n" FileWriteUTF16LE $UninstLog "${Path}$\r$\n"
!macroend !macroend
!define SetOutPath "!insertmacro SetOutPath"
;WriteUninstaller macro ;WriteUninstaller macro
!macro WriteUninstaller Path !macro WriteUninstaller Path
WriteUninstaller "${Path}" WriteUninstaller "${Path}"
FileWrite $UninstLog "${Path}$\r$\n" FileWriteUTF16LE $UninstLog "${Path}$\r$\n"
!macroend !macroend
!define WriteUninstaller "!insertmacro WriteUninstaller"
;WriteIniStr macro ;WriteIniStr macro
!macro WriteIniStr IniFile SectionName EntryName NewValue !macro WriteIniStr IniFile SectionName EntryName NewValue
IfFileExists "${IniFile}" +2 IfFileExists "${IniFile}" +2
FileWrite $UninstLog "${IniFile}$\r$\n" FileWriteUTF16LE $UninstLog "${IniFile}$\r$\n"
WriteIniStr "${IniFile}" "${SectionName}" "${EntryName}" "${NewValue}" WriteIniStr "${IniFile}" "${SectionName}" "${EntryName}" "${NewValue}"
!macroend !macroend
;WriteRegStr macro ;WriteRegStr macro
!macro WriteRegStr RegRoot UnInstallPath Key Value !macro WriteRegStr RegRoot UnInstallPath Key Value
FileWrite $UninstLog "${RegRoot} ${UnInstallPath}$\r$\n" FileWriteUTF16LE $UninstLog "${RegRoot} ${UnInstallPath}$\r$\n"
WriteRegStr "${RegRoot}" "${UnInstallPath}" "${Key}" "${Value}" WriteRegStr "${RegRoot}" "${UnInstallPath}" "${Key}" "${Value}"
!macroend !macroend
!define WriteRegStr "!insertmacro WriteRegStr"
;WriteRegDWORD macro ;WriteRegDWORD macro
!macro WriteRegDWORD RegRoot UnInstallPath Key Value !macro WriteRegDWORD RegRoot UnInstallPath Key Value
FileWrite $UninstLog "${RegRoot} ${UnInstallPath}$\r$\n" FileWriteUTF16LE $UninstLog "${RegRoot} ${UnInstallPath}$\r$\n"
WriteRegDWORD "${RegRoot}" "${UnInstallPath}" "${Key}" "${Value}" WriteRegDWORD "${RegRoot}" "${UnInstallPath}" "${Key}" "${Value}"
!macroend !macroend
!define WriteRegDWORD "!insertmacro WriteRegDWORD"
;BackupFile macro ;BackupFile macro
!macro BackupFile FILE_DIR FILE BACKUP_TO !macro BackupFile FILE_DIR FILE BACKUP_TO
@ -108,94 +123,36 @@ VIAddVersionKey "FileVersion" "${VERSION}"
IfFileExists "${FILE_DIR}\${FILE}" 0 +2 IfFileExists "${FILE_DIR}\${FILE}" 0 +2
Rename "${FILE_DIR}\${FILE}" "${BACKUP_TO}\${FILE}" Rename "${FILE_DIR}\${FILE}" "${BACKUP_TO}\${FILE}"
!macroend !macroend
!define BackupFile "!insertmacro BackupFile"
;RestoreFile macro ;RestoreFile macro
!macro RestoreFile BUP_DIR FILE RESTORE_TO !macro RestoreFile BUP_DIR FILE RESTORE_TO
IfFileExists "${BUP_DIR}\${FILE}" 0 +2 IfFileExists "${BUP_DIR}\${FILE}" 0 +2
Rename "${BUP_DIR}\${FILE}" "${RESTORE_TO}\${FILE}" Rename "${BUP_DIR}\${FILE}" "${RESTORE_TO}\${FILE}"
!macroend !macroend
!define RestoreFile "!insertmacro RestoreFile"
;BackupFiles macro ;BackupFiles macro
!macro BackupFiles FILE_DIR FILE BACKUP_TO !macro BackupFiles FILE_DIR FILE BACKUP_TO
IfFileExists "${BACKUP_TO}\*.*" +2 IfFileExists "${BACKUP_TO}\*.*" +2
CreateDirectory "22222" CreateDirectory "22222"
IfFileExists "${FILE_DIR}\${FILE}" 0 +7 IfFileExists "${FILE_DIR}\${FILE}" 0 +7
FileWrite $UninstLog "${FILE_DIR}\${FILE}$\r$\n" FileWriteUTF16LE $UninstLog "${FILE_DIR}\${FILE}$\r$\n"
FileWrite $UninstLog "${BACKUP_TO}\${FILE}$\r$\n" FileWriteUTF16LE $UninstLog "${BACKUP_TO}\${FILE}$\r$\n"
FileWrite $UninstLog "FileBackup$\r$\n" FileWriteUTF16LE $UninstLog "FileBackup$\r$\n"
Rename "${FILE_DIR}\${FILE}" "${BACKUP_TO}\${FILE}" Rename "${FILE_DIR}\${FILE}" "${BACKUP_TO}\${FILE}"
SetOutPath "${FILE_DIR}" SetOutPath "${FILE_DIR}"
File "${FILE}" #After the Original file is backed up write the new file. File "${FILE}" #After the Original file is backed up write the new file.
!macroend !macroend
!define BackupFiles "!insertmacro BackupFiles"
;RestoreFiles macro ;RestoreFiles macro
!macro RestoreFiles BUP_FILE RESTORE_FILE !macro RestoreFiles BUP_FILE RESTORE_FILE
IfFileExists "${BUP_FILE}" 0 +2 IfFileExists "${BUP_FILE}" 0 +2
CopyFiles "${BUP_FILE}" "${RESTORE_FILE}" CopyFiles "${BUP_FILE}" "${RESTORE_FILE}"
!macroend !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" !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 #MODERN UI
############## ##############
@ -243,6 +200,42 @@ FunctionEnd
!insertmacro MUI_LANGUAGE "English" !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 #INSTALL
################# #################
@ -286,7 +279,7 @@ Section "Install"
${WriteRegStr} "${REG_ROOT}" "${REG_APP_PATH}" "" "$INSTDIR\${MAIN_APP_EXE}" ${WriteRegStr} "${REG_ROOT}" "${REG_APP_PATH}" "" "$INSTDIR\${MAIN_APP_EXE}"
${WriteRegStr} "${REG_ROOT}" "${REG_APP_PATH}" "Path" "$INSTDIR\bin\" ${WriteRegStr} "${REG_ROOT}" "${REG_APP_PATH}" "Path" "$INSTDIR\bin\"
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "DisplayName" "qTox" ${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}" "Publisher" "The qTox Project"
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "UninstallString" "$INSTDIR\uninstall.exe" ${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "UninstallString" "$INSTDIR\uninstall.exe"
${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "URLInfoAbout" "https://qtox.github.io" ${WriteRegStr} ${REG_ROOT} "${UNINSTALL_PATH}" "URLInfoAbout" "https://qtox.github.io"