Conversation
Indefinitely restarting the daemon is annoying as it makes problems harder to diagnose.
Member
Author
|
Saving this for later... I tried to get a bit fancy and run the MSVC installer if the MSVC runtime is missing or it's minor version is too low, but got stuck and ran out of time. diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7337b096..7f93a6f8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -94,6 +94,8 @@ set(REQUIRED_OPENSSL_VERSION 3.0)
set(REQUIRED_LIBEI_VERSION 1.3)
set(REQUIRED_LIBPORTAL_VERSION 0.8)
set(REQUIRED_QT_VERSION 6.7.0)
+set(REQUIRED_MSVC_RUNTIME_MAJOR 14)
+set(REQUIRED_MSVC_RUNTIME_MINOR 42)
# Control debug item visibility
# When not set logging is forced to DEBUG and show code locations
diff --git a/deploy/windows/deploy.cmake b/deploy/windows/deploy.cmake
index fe71d90c..1d50a6ea 100644
--- a/deploy/windows/deploy.cmake
+++ b/deploy/windows/deploy.cmake
@@ -6,7 +6,7 @@
set(MY_DIR ${CMAKE_CURRENT_LIST_DIR})
install(CODE "execute_process(
- COMMAND ${DEPLOYQT} --no-compiler-runtime --no-system-d3d-compiler --no-quick-import -network \"\${CMAKE_INSTALL_PREFIX}/deskflow.exe\"
+ COMMAND ${DEPLOYQT} --no-system-d3d-compiler --no-quick-import -network \"\${CMAKE_INSTALL_PREFIX}/deskflow.exe\"
)")
# Setup OS_STRING
diff --git a/deploy/windows/wix-patch.xml.in b/deploy/windows/wix-patch.xml.in
index 55fd1e9b..6bc94f79 100644
--- a/deploy/windows/wix-patch.xml.in
+++ b/deploy/windows/wix-patch.xml.in
@@ -30,22 +30,50 @@
<CPackWiXFragment Id="#PRODUCT">
<Property Id="VC_REDIST_INSTALLED">
<RegistrySearch
- Id="FindVCRedist"
+ Id="Find_VCRedist_Installed"
Root="HKLM"
Key="SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64"
Name="Installed"
Type="raw" />
</Property>
+ <Property Id="VC_REDIST_VERSION_MINOR">
+ <RegistrySearch
+ Id="Find_VCRedist_Version_Minor"
+ Root="HKLM"
+ Key="SOFTWARE\Microsoft\VisualStudio\@[email protected]\VC\Runtimes\x64"
+ Name="Minor"
+ Type="raw" />
+ </Property>
+
<CustomAction Id="Run_Deskflow" ExeCommand="Deskflow" FileRef="CM_FP_deskflow.exe" Return="asyncNoWait"/>
-
+
<CustomAction
- Id="ShowVCRedistError"
- Error="Latest Microsoft Visual C++ Redistributable is required. Please install it before proceeding."/>
+ Id="Show_VCRedist_Error"
+ Error="Microsoft Visual C++ Redistributable v@REQUIRED_MSVC_RUNTIME_MAJOR@.@REQUIRED_MSVC_RUNTIME_MINOR@ is required. The installer will now exit and install the Redistributable. Please restart the installation afterwards."/>
+
+ <CustomAction
+ Id="Run_VCRedist"
+ ExeCommand=""
+ FileRef="CM_FP_vc_redist.x64.exe"
+ Execute="deferred"
+ Impersonate="no"
+ Return="check"
+ />
<InstallExecuteSequence>
- <Custom Action="ShowVCRedistError" Before="InstallServices" Condition="NOT Installed AND NOT VC_REDIST_INSTALLED"/>
- <Custom Action="Run_Deskflow" OnExit="success" Condition="NOT Installed"/>
+ <Custom
+ Action="Show_VCRedist_Error"
+ Before="InstallServices"
+ Condition="NOT Installed AND (NOT VC_REDIST_INSTALLED OR VC_REDIST_VERSION_MINOR < @REQUIRED_MSVC_RUNTIME_MINOR@)"/>
+ <Custom
+ Action="Run_VCRedist"
+ OnExit="error"
+ Condition="NOT Installed AND (NOT VC_REDIST_INSTALLED OR VC_REDIST_VERSION_MINOR < @REQUIRED_MSVC_RUNTIME_MINOR@)"/>
+ <Custom
+ Action="Run_Deskflow"
+ OnExit="success"
+ Condition="NOT Installed"/>
</InstallExecuteSequence>
</CPackWiXFragment>
</CPackWiXPatch>
diff --git a/src/lib/arch/win32/ArchMiscWindows.cpp b/src/lib/arch/win32/ArchMiscWindows.cpp
index 7f149496..15524304 100644
--- a/src/lib/arch/win32/ArchMiscWindows.cpp
+++ b/src/lib/arch/win32/ArchMiscWindows.cpp
@@ -38,8 +38,8 @@
// See table of the compiler versions and the matching runtime DLL versions:
// https://dev.to/yumetodo/list-of-mscver-and-mscfullver-8nd
#if _MSC_VER >= 1942 // Visual Studio 2022 Update 12 (v17.12.4)
-const auto kRequiredMajor = 14;
-const auto kRequiredMinor = 42;
+const auto kRequiredMajor = kWindowsRuntimeMajor;
+const auto kRequiredMinor = kWindowsRuntimeMinor;
#elif _MSC_VER >= 1920 // Visual Studio 2019 Update 7 (v16.7)
const auto kRequiredMajor = 14;
const auto kRequiredMinor = 27;
diff --git a/src/lib/common/constants.h.in b/src/lib/common/constants.h.in
index ba762c44..5d6b2430 100644
--- a/src/lib/common/constants.h.in
+++ b/src/lib/common/constants.h.in
@@ -7,6 +7,8 @@
#pragma once
+// clang-format off
+
const auto kAppName = "@CMAKE_PROJECT_PROPER_NAME@";
const auto kAppId = "@CMAKE_PROJECT_NAME@";
const auto kAppDescription = "@CMAKE_PROJECT_DESCRIPTION@";
@@ -17,6 +19,8 @@ const auto kDaemonBinName = "@CMAKE_PROJECT_NAME@-daemon";
const auto kDaemonIpcName = "@CMAKE_PROJECT_NAME@-daemon";
const auto kDaemonLogFilename = "@[email protected]";
const auto kWindowsRegistryKey = "SOFTWARE\\@CMAKE_PROJECT_PROPER_NAME@";
+const auto kWindowsRuntimeMajor = @REQUIRED_MSVC_RUNTIME_MAJOR@;
+const auto kWindowsRuntimeMinor = @REQUIRED_MSVC_RUNTIME_MINOR@;
const auto kCopyright = //
"Copyright @CMAKE_PROJECT_COPYRIGHT@\n"
@@ -36,3 +40,5 @@ const auto kCertificateFilename = "@[email protected]";
const auto kFingerprintLocalFilename = "local-fingerprint";
const auto kFingerprintTrustedServersFilename = "trusted-servers";
const auto kFingerprintTrustedClientsFilename = "trusted-clients";
+
+// clang-format on |
sithlord48
approved these changes
Mar 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #8326