Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package qtox for openSUSE:Factory checked in at 2022-06-27 11:25:31 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/qtox (Old) and /work/SRC/openSUSE:Factory/.qtox.new.1548 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "qtox" Mon Jun 27 11:25:31 2022 rev:10 rq:985141 version:1.17.6 Changes: -------- --- /work/SRC/openSUSE:Factory/qtox/qtox.changes 2022-02-14 22:37:23.721605100 +0100 +++ /work/SRC/openSUSE:Factory/.qtox.new.1548/qtox.changes 2022-06-27 11:25:32.994589617 +0200 @@ -1,0 +2,19 @@ +Sun Jun 26 13:01:27 UTC 2022 - ecsos <[email protected]> + +- Update to 1.17.6 + * Bug Fixes + - Windows: Correct Program Files directory for 32-bit Windows (47406e74) + - macos: update deprecated AVFoundation API (484ea7ce) +- Changes from 1.17.5 + * Bug Fixes + - Update video API usage for newer libavcodec (f5fabc2f) + + Windows: + - Restrict non-default install directory permissions (553bd47e) + - Build NSIS installer in Unicode mode (9f84184b) + - Define installer language before trying to access it (1353fc93) + * Features + - Settings: Add setting for hiding group join and leave system messages (916e797c) + - UI: Add UI For controlling group join and leave system messages setting (423049db) + - chatlog: Disable join and leave system messages based on setting (ee0334ac) + +------------------------------------------------------------------- Old: ---- v1.17.4.tar.gz v1.17.4.tar.gz.asc New: ---- v1.17.6.tar.gz v1.17.6.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ qtox.spec ++++++ --- /var/tmp/diff_new_pack.om7XIg/_old 2022-06-27 11:25:33.926590997 +0200 +++ /var/tmp/diff_new_pack.om7XIg/_new 2022-06-27 11:25:33.930591003 +0200 @@ -19,7 +19,7 @@ %define realname qTox Name: qtox -Version: 1.17.4 +Version: 1.17.6 Release: 0 Summary: Tox client License: GPL-3.0-only ++++++ v1.17.4.tar.gz -> v1.17.6.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/CHANGELOG.md new/qTox/CHANGELOG.md --- old/qTox/CHANGELOG.md 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/CHANGELOG.md 2022-03-06 15:31:31.000000000 +0100 @@ -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) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/CMakeLists.txt new/qTox/CMakeLists.txt --- old/qTox/CMakeLists.txt 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/CMakeLists.txt 2022-03-06 15:31:31.000000000 +0100 @@ -614,6 +614,17 @@ endif() if(AVFOUNDATION_FOUND) + # used for AVFoundation compile time deprecation check + execute_process( + COMMAND sw_vers -productVersion + OUTPUT_VARIABLE MACOS_VER + ) + string(REPLACE "." ";" VERSION_LIST ${MACOS_VER}) + list(GET VERSION_LIST 0 MACOS_VERSION_MAJOR) + list(GET VERSION_LIST 1 MACOS_VERSION_MINOR) + add_definitions(-DMACOS_VERSION_MAJOR=${MACOS_VERSION_MAJOR}) + add_definitions(-DMACOS_VERSION_MINOR=${MACOS_VERSION_MINOR}) + set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES} src/platform/camera/avfoundation.mm src/platform/camera/avfoundation.h) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/INSTALL.md new/qTox/INSTALL.md --- old/qTox/INSTALL.md 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/INSTALL.md 2022-03-06 15:31:31.000000000 +0100 @@ -566,7 +566,7 @@ ## OS X -Supported OS X versions: >=10.8. (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). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/README.md new/qTox/README.md --- old/qTox/README.md 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/README.md 2022-03-06 15:31:31.000000000 +0100 @@ -158,18 +158,18 @@ ``` [#qtox@freenode]: https://webchat.freenode.net/?channels=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://build.tox.chat/view/qtox/job/qTox-cmake-nightly_build_windows_x86_release/lastSuccessfulBuild/artifact/qTox-cmake-nightly_build_windows_x86_release.zip [64nightly]: https://build.tox.chat/view/qtox/job/qTox-cmake-nightly_build_windows_x86-64_release/lastSuccessfulBuild/artifact/qTox-cmake-nightly_build_windows_x86-64_release.zip -[Flatpak]: https://github.com/qTox/qTox/releases/download/v1.17.4/qTox-v1.17.4.x86_64.flatpak -[AppImage]: https://github.com/qTox/qTox/releases/download/v1.17.4/qTox-v1.17.4.x86_64.AppImage +[Flatpak]: https://github.com/qTox/qTox/releases/download/v1.17.6/qTox-v1.17.6.x86_64.flatpak +[AppImage]: https://github.com/qTox/qTox/releases/download/v1.17.6/qTox-v1.17.6.x86_64.AppImage [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 [Fedora]: /INSTALL.md#fedora [Gentoo]: /INSTALL.md#gentoo [openSUSE]: /INSTALL.md#opensuse diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/osx/info.plist new/qTox/osx/info.plist --- old/qTox/osx/info.plist 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/osx/info.plist 2022-03-06 15:31:31.000000000 +0100 @@ -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> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/osx/qTox-Mac-Deployer-ULTIMATE.sh new/qTox/osx/qTox-Mac-Deployer-ULTIMATE.sh --- old/qTox/osx/qTox-Mac-Deployer-ULTIMATE.sh 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/osx/qTox-Mac-Deployer-ULTIMATE.sh 2022-03-06 15:31:31.000000000 +0100 @@ -35,10 +35,6 @@ MAIN_DIR="$(dirname $(readlink -f $0))/../.." QTOX_DIR="${MAIN_DIR}/qTox${SUBGIT}" fi -QT_DIR="/usr/local/Cellar/qt5" # Folder name of QT install -# Figure out latest version -QT_VER=($(ls ${QT_DIR} | sed -n -e 's/^\([0-9]*\.([0-9]*\.([0-9]*\).*/\1/' -e '1p;$p')) -QT_DIR_VER="${QT_DIR}/${QT_VER[1]}" TOXCORE_DIR="${MAIN_DIR}/toxcore" # Change to Git location diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/res/io.github.qtox.qTox.appdata.xml new/qTox/res/io.github.qtox.qTox.appdata.xml --- old/qTox/res/io.github.qtox.qTox.appdata.xml 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/res/io.github.qtox.qTox.appdata.xml 2022-03-06 15:31:31.000000000 +0100 @@ -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> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/src/persistence/igroupsettings.h new/qTox/src/persistence/igroupsettings.h --- old/qTox/src/persistence/igroupsettings.h 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/src/persistence/igroupsettings.h 2022-03-06 15:31:31.000000000 +0100 @@ -20,6 +20,8 @@ #ifndef IGROUP_SETTINGS_H #define IGROUP_SETTINGS_H +#include "src/model/interface.h" + #include <QStringList> class IGroupSettings @@ -30,6 +32,12 @@ virtual void setBlackList(const QStringList& blist) = 0; virtual bool getGroupAlwaysNotify() const = 0; virtual void setGroupAlwaysNotify(bool newValue) = 0; + + virtual bool getShowGroupJoinLeaveMessages() const = 0; + virtual void setShowGroupJoinLeaveMessages(bool newValue) = 0; + + DECLARE_SIGNAL(blackListChanged, QStringList const& blist); + DECLARE_SIGNAL(showGroupJoinLeaveMessagesChanged, bool show); }; #endif /*IGROUP_SETTINGS_H*/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/src/persistence/settings.cpp new/qTox/src/persistence/settings.cpp --- old/qTox/src/persistence/settings.cpp 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/src/persistence/settings.cpp 2022-03-06 15:31:31.000000000 +0100 @@ -203,6 +203,7 @@ lightTrayIcon = s.value("lightTrayIcon", false).toBool(); useEmoticons = s.value("useEmoticons", true).toBool(); statusChangeNotificationEnabled = s.value("statusChangeNotificationEnabled", false).toBool(); + showGroupJoinLeaveMessages = s.value("showGroupJoinLeaveMessages", false).toBool(); spellCheckingEnabled = s.value("spellCheckingEnabled", true).toBool(); themeColor = s.value("themeColor", 0).toInt(); style = s.value("style", "").toString(); @@ -680,6 +681,7 @@ s.setValue("style", style); s.setValue("nameColors", nameColors); s.setValue("statusChangeNotificationEnabled", statusChangeNotificationEnabled); + s.setValue("showGroupJoinLeaveMessages", showGroupJoinLeaveMessages); s.setValue("spellCheckingEnabled", spellCheckingEnabled); } s.endGroup(); @@ -1155,6 +1157,21 @@ } } +bool Settings::getShowGroupJoinLeaveMessages() const +{ + QMutexLocker locker{&bigLock}; + return showGroupJoinLeaveMessages; +} + +void Settings::setShowGroupJoinLeaveMessages(bool newValue) +{ + QMutexLocker locker{&bigLock}; + if (newValue != showGroupJoinLeaveMessages) { + showGroupJoinLeaveMessages = newValue; + emit showGroupJoinLeaveMessagesChanged(showGroupJoinLeaveMessages); + } +} + bool Settings::getSpellCheckingEnabled() const { const QMutexLocker locker{&bigLock}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/src/persistence/settings.h new/qTox/src/persistence/settings.h --- old/qTox/src/persistence/settings.h 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/src/persistence/settings.h 2022-03-06 15:31:31.000000000 +0100 @@ -232,7 +232,6 @@ // Privacy void typingNotificationChanged(bool enabled); void dbSyncTypeChanged(Db::syncType type); - void blackListChanged(QStringList& blist); public: bool applyCommandLineOptions(const QCommandLineParser& parser); @@ -462,8 +461,14 @@ // Privacy bool getTypingNotification() const; void setTypingNotification(bool enabled); + QStringList getBlackList() const override; void setBlackList(const QStringList& blist) override; + SIGNAL_IMPL(Settings, blackListChanged, QStringList const& blist) + + bool getShowGroupJoinLeaveMessages() const override; + void setShowGroupJoinLeaveMessages(bool newValue) override; + SIGNAL_IMPL(Settings, showGroupJoinLeaveMessagesChanged, bool show) // State QByteArray getWindowGeometry() const; @@ -652,6 +657,7 @@ QString timestampFormat; QString dateFormat; bool statusChangeNotificationEnabled; + bool showGroupJoinLeaveMessages; bool spellCheckingEnabled; // Privacy diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/src/platform/camera/avfoundation.mm new/qTox/src/platform/camera/avfoundation.mm --- old/qTox/src/platform/camera/avfoundation.mm 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/src/platform/camera/avfoundation.mm 2022-03-06 15:31:31.000000000 +0100 @@ -27,7 +27,15 @@ { QVector<QPair<QString, QString> > result; +#if MACOS_VERSION_MAJOR > 10 || (MACOS_VERSION_MAJOR == 10 && MACOS_VERSION_MINOR > 14) + AVCaptureDevice* device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; + id objects[] = {device}; + NSUInteger count = sizeof(objects) / sizeof(id); + NSArray* devices = [NSArray arrayWithObjects:objects count:count]; +#else NSArray* devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]; +#endif + for (AVCaptureDevice* device in devices) { result.append({ QString::fromNSString([device uniqueID]), QString::fromNSString([device localizedName]) }); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/src/video/cameradevice.cpp new/qTox/src/video/cameradevice.cpp --- old/qTox/src/video/cameradevice.cpp 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/src/video/cameradevice.cpp 2022-03-06 15:31:31.000000000 +0100 @@ -28,6 +28,9 @@ #include "cameradevice.h" #include "src/persistence/settings.h" +// no longer needed when avformat version < 59 is no longer supported +using AvFindInputFormatRet = decltype(av_find_input_format("")); + #if defined(Q_OS_LINUX) || defined(Q_OS_FREEBSD) #define USING_V4L 1 #else @@ -68,8 +71,8 @@ QHash<QString, CameraDevice*> CameraDevice::openDevices; QMutex CameraDevice::openDeviceLock, CameraDevice::iformatLock; -AVInputFormat* CameraDevice::iformat{nullptr}; -AVInputFormat* CameraDevice::idesktopFormat{nullptr}; +static AvFindInputFormatRet idesktopFormat{nullptr}; +static AvFindInputFormatRet iformat{nullptr}; CameraDevice::CameraDevice(const QString& devName, AVFormatContext* context) : devName{devName} @@ -89,7 +92,7 @@ goto out; } - AVInputFormat* format; + AvFindInputFormatRet format; if (devName.startsWith("x11grab#")) { devName = devName.mid(8); format = idesktopFormat; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/src/video/cameradevice.h new/qTox/src/video/cameradevice.h --- old/qTox/src/video/cameradevice.h 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/src/video/cameradevice.h 2022-03-06 15:31:31.000000000 +0100 @@ -65,7 +65,6 @@ std::atomic_int refcount; static QHash<QString, CameraDevice*> openDevices; static QMutex openDeviceLock, iformatLock; - static AVInputFormat *iformat, *idesktopFormat; }; #endif // CAMERADEVICE_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/src/video/camerasource.cpp new/qTox/src/video/camerasource.cpp --- old/qTox/src/video/camerasource.cpp 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/src/video/camerasource.cpp 2022-03-06 15:31:31.000000000 +0100 @@ -277,7 +277,6 @@ } // We need to create a new CameraDevice - AVCodec* codec; device = CameraDevice::open(deviceName, mode); if (!device) { @@ -321,7 +320,7 @@ AVCodecParameters* cparams = device->context->streams[videoStreamIndex]->codecpar; codecId = cparams->codec_id; #endif - codec = avcodec_find_decoder(codecId); + const AVCodec* codec = avcodec_find_decoder(codecId); if (!codec) { qWarning() << "Codec not found"; emit openFailed(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/src/widget/form/groupchatform.cpp new/qTox/src/widget/form/groupchatform.cpp --- old/qTox/src/widget/form/groupchatform.cpp 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/src/widget/form/groupchatform.cpp 2022-03-06 15:31:31.000000000 +0100 @@ -37,7 +37,7 @@ #include "src/widget/style.h" #include "src/widget/tool/croppinglabel.h" #include "src/widget/translator.h" -#include "src/persistence/settings.h" +#include "src/persistence/igroupsettings.h" #include <QDragEnterEvent> #include <QMimeData> @@ -82,10 +82,11 @@ * @brief Timeout = peer stopped sending audio. */ -GroupChatForm::GroupChatForm(Group* chatGroup, IChatLog& chatLog, IMessageDispatcher& messageDispatcher) +GroupChatForm::GroupChatForm(Group* chatGroup, IChatLog& chatLog, IMessageDispatcher& messageDispatcher, IGroupSettings& _settings) : GenericChatForm(chatGroup, chatLog, messageDispatcher) , group(chatGroup) , inCall(false) + , settings(_settings) { nusersLabel = new QLabel(); @@ -129,7 +130,7 @@ connect(group, &Group::userLeft, this, &GroupChatForm::onUserLeft); connect(group, &Group::peerNameChanged, this, &GroupChatForm::onPeerNameChanged); connect(group, &Group::numPeersChanged, this, &GroupChatForm::updateUserCount); - connect(&Settings::getInstance(), &Settings::blackListChanged, this, &GroupChatForm::updateUserNames); + settings.connectTo_blackListChanged(this, [this](QStringList const&) { this->updateUserNames(); }); updateUserNames(); setAcceptDrops(true); @@ -198,12 +199,11 @@ label->setTextFormat(Qt::PlainText); label->setContextMenuPolicy(Qt::CustomContextMenu); - const Settings& s = Settings::getInstance(); connect(label, &QLabel::customContextMenuRequested, this, &GroupChatForm::onLabelContextMenuRequested); if (peerPk == selfPk) { label->setProperty("peerType", LABEL_PEER_TYPE_OUR); - } else if (s.getBlackList().contains(peerPk.toString())) { + } else if (settings.getBlackList().contains(peerPk.toString())) { label->setProperty("peerType", LABEL_PEER_TYPE_MUTED); } @@ -235,13 +235,17 @@ void GroupChatForm::onUserJoined(const ToxPk& user, const QString& name) { - addSystemInfoMessage(tr("%1 has joined the group").arg(name), ChatMessage::INFO, QDateTime::currentDateTime()); + if (settings.getShowGroupJoinLeaveMessages()) { + addSystemInfoMessage(tr("%1 has joined the group").arg(name), ChatMessage::INFO, QDateTime::currentDateTime()); + } updateUserNames(); } void GroupChatForm::onUserLeft(const ToxPk& user, const QString& name) { - addSystemInfoMessage(tr("%1 has left the group").arg(name), ChatMessage::INFO, QDateTime::currentDateTime()); + if (settings.getShowGroupJoinLeaveMessages()) { + addSystemInfoMessage(tr("%1 has left the group").arg(name), ChatMessage::INFO, QDateTime::currentDateTime()); + } updateUserNames(); } @@ -415,8 +419,7 @@ const QPoint pos = label->mapToGlobal(localPos); const QString muteString = tr("mute"); const QString unmuteString = tr("unmute"); - Settings& s = Settings::getInstance(); - QStringList blackList = s.getBlackList(); + QStringList blackList = settings.getBlackList(); QMenu* const contextMenu = new QMenu(this); const ToxPk selfPk = Core::getInstance()->getSelfPublicKey(); ToxPk peerPk; @@ -457,7 +460,7 @@ blackList << peerPk.toString(); } - s.setBlackList(blackList); + settings.setBlackList(blackList); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/src/widget/form/groupchatform.h new/qTox/src/widget/form/groupchatform.h --- old/qTox/src/widget/form/groupchatform.h 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/src/widget/form/groupchatform.h 2022-03-06 15:31:31.000000000 +0100 @@ -33,13 +33,14 @@ class QTimer; class GroupId; class IMessageDispatcher; -class Message; +struct Message; +class IGroupSettings; class GroupChatForm : public GenericChatForm { Q_OBJECT public: - explicit GroupChatForm(Group* chatGroup, IChatLog& chatLog, IMessageDispatcher& messageDispatcher); + GroupChatForm(Group* chatGroup, IChatLog& chatLog, IMessageDispatcher& messageDispatcher, IGroupSettings& _settings); ~GroupChatForm(); void peerAudioPlaying(ToxPk peerPk); @@ -79,6 +80,7 @@ QLabel* nusersLabel; TabCompleter* tabber; bool inCall; + IGroupSettings& settings; }; #endif // GROUPCHATFORM_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/src/widget/form/settings/generalform.cpp new/qTox/src/widget/form/settings/generalform.cpp --- old/qTox/src/widget/form/settings/generalform.cpp 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/src/widget/form/settings/generalform.cpp 2022-03-06 15:31:31.000000000 +0100 @@ -144,6 +144,7 @@ bodyUI->closeToTray->setEnabled(showSystemTray); bodyUI->statusChanges->setChecked(s.getStatusChangeNotificationEnabled()); + bodyUI->groupJoinLeaveMessages->setChecked(s.getShowGroupJoinLeaveMessages()); bodyUI->autoAwaySpinBox->setValue(s.getAutoAwayTime()); bodyUI->autoSaveFilesDir->setText(s.getGlobalAutoAcceptDir()); @@ -215,6 +216,11 @@ Settings::getInstance().setStatusChangeNotificationEnabled(bodyUI->statusChanges->isChecked()); } +void GeneralForm::on_groupJoinLeaveMessages_stateChanged() +{ + Settings::getInstance().setShowGroupJoinLeaveMessages(bodyUI->groupJoinLeaveMessages->isChecked()); +} + void GeneralForm::on_autoAwaySpinBox_editingFinished() { int minutes = bodyUI->autoAwaySpinBox->value(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/src/widget/form/settings/generalform.h new/qTox/src/widget/form/settings/generalform.h --- old/qTox/src/widget/form/settings/generalform.h 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/src/widget/form/settings/generalform.h 2022-03-06 15:31:31.000000000 +0100 @@ -52,6 +52,7 @@ void on_autoAwaySpinBox_editingFinished(); void on_minimizeToTray_stateChanged(); void on_statusChanges_stateChanged(); + void on_groupJoinLeaveMessages_stateChanged(); void on_autoacceptFiles_stateChanged(); void on_maxAutoAcceptSizeMB_editingFinished(); void on_autoSaveFilesDir_clicked(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/src/widget/form/settings/generalsettings.ui new/qTox/src/widget/form/settings/generalsettings.ui --- old/qTox/src/widget/form/settings/generalsettings.ui 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/src/widget/form/settings/generalsettings.ui 2022-03-06 15:31:31.000000000 +0100 @@ -222,6 +222,13 @@ </property> </widget> </item> + <item> + <widget class="QCheckBox" name="groupJoinLeaveMessages"> + <property name="text"> + <string>Add a chat message when a user joins or leaves a group</string> + </property> + </widget> + </item> </layout> </item> <item> @@ -364,6 +371,7 @@ <tabstop>minimizeToTray</tabstop> <tabstop>closeToTray</tabstop> <tabstop>statusChanges</tabstop> + <tabstop>groupJoinLeaveMessages</tabstop> <tabstop>autoAwaySpinBox</tabstop> <tabstop>autoSaveFilesDir</tabstop> <tabstop>autoacceptFiles</tabstop> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/src/widget/widget.cpp new/qTox/src/widget/widget.cpp --- old/qTox/src/widget/widget.cpp 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/src/widget/widget.cpp 2022-03-06 15:31:31.000000000 +0100 @@ -2115,7 +2115,7 @@ connect(messageDispatcher.get(), &IMessageDispatcher::messageReceived, notifyReceivedCallback); groupAlertConnections.insert(groupId, notifyReceivedConnection); - auto form = new GroupChatForm(newgroup, *groupChatLog, *messageDispatcher); + auto form = new GroupChatForm(newgroup, *groupChatLog, *messageDispatcher, settings); connect(&settings, &Settings::nameColorsChanged, form, &GenericChatForm::setColorizedNames); form->setColorizedNames(settings.getEnableGroupChatsColor()); groupMessageDispatchers[groupId] = messageDispatcher; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/test/model/groupmessagedispatcher_test.cpp new/qTox/test/model/groupmessagedispatcher_test.cpp --- old/qTox/test/model/groupmessagedispatcher_test.cpp 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/test/model/groupmessagedispatcher_test.cpp 2022-03-06 15:31:31.000000000 +0100 @@ -22,6 +22,8 @@ #include "src/model/groupmessagedispatcher.h" #include "src/model/message.h" #include "src/persistence/settings.h" +#include "src/persistence/igroupsettings.h" +#include "src/model/interface.h" #include <QObject> #include <QtTest/QtTest> @@ -126,8 +128,10 @@ } }; -class MockGroupSettings : public IGroupSettings +class MockGroupSettings : public QObject, public IGroupSettings { + Q_OBJECT + public: QStringList getBlackList() const override { @@ -145,6 +149,11 @@ } void setGroupAlwaysNotify(bool newValue) override {} + SIGNAL_IMPL(MockGroupSettings, blackListChanged, QStringList const& blist) + + bool getShowGroupJoinLeaveMessages() const override { return true; }; + void setShowGroupJoinLeaveMessages(bool newValue) override {}; + SIGNAL_IMPL(MockGroupSettings, showGroupJoinLeaveMessagesChanged, bool show) private: QStringList blacklist; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/windows/cross-compile/build.sh new/qTox/windows/cross-compile/build.sh --- old/qTox/windows/cross-compile/build.sh 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/windows/cross-compile/build.sh 2022-03-06 15:31:31.000000000 +0100 @@ -1101,7 +1101,7 @@ echo "Using cached build of NSIS ShellExecAsUser plugin `cat $NSISSHELLEXECASUSER_PREFIX_DIR/done`" fi # Install ShellExecAsUser plugin -cp "$NSISSHELLEXECASUSER_PREFIX_DIR/bin/ShellExecAsUser.dll" /usr/share/nsis/Plugins/x86-ansi/ +cp "$NSISSHELLEXECASUSER_PREFIX_DIR/bin/ShellExecAsUser.dll" /usr/share/nsis/Plugins/x86-unicode/ # mingw-ldd diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/windows/qtox.nsi new/qTox/windows/qtox.nsi --- old/qTox/windows/qtox.nsi 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/windows/qtox.nsi 2022-03-06 15:31:31.000000000 +0100 @@ -1,3 +1,4 @@ +Unicode True ################### #META ################### @@ -30,76 +31,90 @@ 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,93 +123,35 @@ 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 + !define RestoreFiles "!insertmacro RestoreFiles" ############## #MODERN UI @@ -243,6 +200,42 @@ !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 "$PROGRAMFILES" /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 ################# @@ -280,7 +273,7 @@ ${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.6" ${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" @@ -317,7 +310,7 @@ GetLineCount: ClearErrors - FileRead $UninstLog $R0 + FileReadUTF16LE $UninstLog $R0 IntOp $R1 $R1 + 1 StrCpy $R0 $R0 -2 Push $R0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qTox/windows/qtox64.nsi new/qTox/windows/qtox64.nsi --- old/qTox/windows/qtox64.nsi 2021-12-15 02:04:29.000000000 +0100 +++ new/qTox/windows/qtox64.nsi 2022-03-06 15:31:31.000000000 +0100 @@ -1,3 +1,4 @@ +Unicode True ################### #META ################### @@ -30,76 +31,90 @@ 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,93 +123,35 @@ 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 + !define RestoreFiles "!insertmacro RestoreFiles" ############## #MODERN UI @@ -243,6 +200,42 @@ !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 ################# @@ -281,7 +274,7 @@ ${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.6" ${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"
