Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into chatterino7
Browse files Browse the repository at this point in the history
  • Loading branch information
Nerixyz committed Jun 15, 2024
2 parents b2a7765 + 538bead commit 2a64a09
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .CI/build-installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ $VCRTVersion = (Get-Item "$Env:VCToolsRedistDir\vc_redist.x64.exe").VersionInfo;
ISCC `
/DWORKING_DIR="$($pwd.Path)\" `
/DINSTALLER_BASE_NAME="$installerBaseName" `
/DSHIPPED_VCRT_BUILD="$($VCRTVersion.FileBuildPart)" `
/DSHIPPED_VCRT_MINOR="$($VCRTVersion.FileMinorPart)" `
/DSHIPPED_VCRT_VERSION="$($VCRTVersion.FileDescription)" `
$defines `
/O. `
Expand Down
6 changes: 3 additions & 3 deletions .CI/chatterino-installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ begin
Result := VCRTVersion + ' is installed';
end;
// Checks if a new VCRT is needed by comparing the builds.
// Checks if a new VCRT is needed by comparing the minor version (the major one is locked at 14).
function NeedsNewVCRT(): Boolean;
var
VCRTBuild: Cardinal;
begin
Result := True;
if RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Bld', VCRTBuild) then
if RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64', 'Minor', VCRTBuild) then
begin
if VCRTBuild >= {#SHIPPED_VCRT_BUILD} then
if VCRTBuild >= {#SHIPPED_VCRT_MINOR} then
Result := False;
end;
end;
30 changes: 30 additions & 0 deletions .CI/deploy-crt.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
param (
[string] $InstallDir = "Chatterino2"
)

if ($null -eq $Env:VCToolsRedistDir) {
Write-Error "VCToolsRedistDir is not set. Forgot to set Visual Studio environment variables?";
exit 1
}

# A path to the runtime libraries (e.g. "$Env:VCToolsRedistDir\onecore\x64\Microsoft.VC143.CRT")
$vclibs = (Get-ChildItem "$Env:VCToolsRedistDir\onecore\x64" -Filter '*.CRT')[0].FullName;

# All executables and libraries in the installation directory
$targets = Get-ChildItem -Recurse -Include '*.dll', '*.exe' $InstallDir;
# All dependencies of the targets (with duplicates)
$all_deps = $targets | ForEach-Object { (dumpbin /DEPENDENTS $_.FullName) -match '^(?!Dump of).+\.dll$' } | ForEach-Object { $_.Trim() };
# All dependencies without duplicates
$dependencies = $all_deps | Sort-Object -Unique;

$n_deployed = 0;
foreach ($dll in $dependencies) {
Write-Output "Checking for $dll";
if (Test-Path -PathType Leaf "$vclibs\$dll") {
Write-Output "Deploying $dll";
Copy-Item "$vclibs\$dll" "$InstallDir\$dll" -Force;
$n_deployed++;
}
}

Write-Output "Deployed $n_deployed libraries";
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ jobs:
run: |
windeployqt bin/chatterino.exe --release --no-compiler-runtime --no-translations --no-opengl-sw --dir Chatterino2/
cp bin/chatterino.exe Chatterino2/
..\.CI\deploy-crt.ps1 Chatterino2
echo nightly > Chatterino2/modes
- name: Package (windows)
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/create-installer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
fetch-depth: 0 # allows for tags access

- name: Download artifact
uses: dawidd6/action-download-artifact@v5
uses: dawidd6/action-download-artifact@v6
with:
workflow: build.yml
name: chatterino-windows-x86-64-Qt-${{ matrix.qt-version }}.zip
Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
path: build/

- name: Download artifact
uses: dawidd6/action-download-artifact@v5
uses: dawidd6/action-download-artifact@v6
with:
workflow: build.yml
name_is_regexp: true
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Minor: Added the ability to duplicate tabs. (#5277)
- Minor: Improved error messages for channel update commands. (#5429)
- Minor: Moderators can now see when users are warned. (#5441)
- Minor: Added support for Brave & google-chrome-stable browsers. (#5452)
- Bugfix: Fixed tab move animation occasionally failing to start after closing a tab. (#5426)
- Bugfix: If a network request errors with 200 OK, Qt's error code is now reported instead of the HTTP status. (#5378)
- Bugfix: Fixed restricted users usernames not being clickable. (#5405)
Expand All @@ -26,6 +27,8 @@
- Dev: Removed unused timegate settings. (#5361)
- Dev: All Lua globals now show in the `c2` global in the LuaLS metadata. (#5385)
- Dev: Images are now loaded in worker threads. (#5431)
- Dev: Qt Creator now auto-configures Conan when loading the project and skips vcpkg. (#5305)
- Dev: The MSVC CRT is now bundled with Chatterino as it depends on having a recent version installed. (#5447)

## 2.5.1

Expand Down
5 changes: 5 additions & 0 deletions QtCreatorPackageManager.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# https://www.qt.io/blog/qt-creator-cmake-package-manager-auto-setup

# set(QT_CREATOR_SKIP_PACKAGE_MANAGER_SETUP ON) # skip both conan and vcpkg auto-setups
# set(QT_CREATOR_SKIP_CONAN_SETUP ON) # skip conan auto-setup
set(QT_CREATOR_SKIP_VCPKG_SETUP ON) # skip vcpkg auto-setup
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,7 @@ if (BUILD_APP)
endif()
get_filename_component(QT_BIN_DIR ${QT_CORE_LOC} DIRECTORY)

# This assumes the installed CRT is up-to-date (see .CI/deploy-crt.ps1)
set(WINDEPLOYQT_COMMAND_ARGV "${WINDEPLOYQT_PATH}" "$<TARGET_FILE:${EXECUTABLE_PROJECT}>" ${WINDEPLOYQT_MODE} --no-compiler-runtime --no-translations --no-opengl-sw)
string(REPLACE ";" " " WINDEPLOYQT_COMMAND "${WINDEPLOYQT_COMMAND_ARGV}")

Expand Down
20 changes: 14 additions & 6 deletions src/util/IncognitoBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,20 @@ QString getPrivateSwitch(const QString &browserExecutable)
{
// list of command line switches to turn on private browsing in browsers
static auto switches = std::vector<std::pair<QString, QString>>{
{"firefox", "-private-window"}, {"librewolf", "-private-window"},
{"waterfox", "-private-window"}, {"icecat", "-private-window"},
{"chrome", "-incognito"}, {"vivaldi", "-incognito"},
{"opera", "-newprivatetab"}, {"opera\\launcher", "--private"},
{"iexplore", "-private"}, {"msedge", "-inprivate"},
{"firefox-esr", "-private-window"}, {"chromium", "-incognito"},
{"firefox", "-private-window"},
{"librewolf", "-private-window"},
{"waterfox", "-private-window"},
{"icecat", "-private-window"},
{"chrome", "-incognito"},
{"google-chrome-stable", "-incognito"},
{"vivaldi", "-incognito"},
{"opera", "-newprivatetab"},
{"opera\\launcher", "--private"},
{"iexplore", "-private"},
{"msedge", "-inprivate"},
{"firefox-esr", "-private-window"},
{"chromium", "-incognito"},
{"brave", "-incognito"},
};

// compare case-insensitively
Expand Down

0 comments on commit 2a64a09

Please sign in to comment.