1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-10-06 09:17:07 +02:00

Add explicit SCREENPLAY_RELEASE option

For now this disables setting autostart path on
dev builds. This is annoying because it previously
did set the path to the ScreenPlay dev build that
did have all the dlls and thus fails.
This commit is contained in:
Elias Steurer 2022-07-08 12:49:53 +02:00
parent db04e5bab0
commit bf199ab001
4 changed files with 23 additions and 16 deletions

View File

@ -57,7 +57,10 @@ file(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
add_compile_definitions(COMPILE_INFO="Build Date: ${BUILD_DATE}. Git Hash: ${GIT_COMMIT_HASH}. ")
add_compile_definitions(SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
add_compile_definitions(RELEASE_VERSION="${SCREENPLAY_RELEASE}")
if(${SCREENPLAY_RELEASE})
add_compile_definitions(RELEASE_VERSION)
endif()
find_package(Git REQUIRED)
if(WIN32)

View File

@ -294,7 +294,7 @@ target_link_libraries(
SteamSDKQtEnums)
if(${SCREENPLAY_STEAM})
target_compile_definitions(ScreenPlayApp PRIVATE SCREENPLAY_STEAM=1)
target_compile_definitions(ScreenPlayApp PRIVATE SCREENPLAY_STEAM)
target_link_libraries(ScreenPlayApp PUBLIC ScreenPlayWorkshopplugin ScreenPlayWorkshop)
endif()
@ -305,7 +305,7 @@ if(${SCREENPLAY_TESTS})
add_executable(tst_ScreenPlay tests/tst_main.cpp)
target_link_libraries(tst_ScreenPlay PRIVATE ScreenPlayApp ScreenPlayAppplugin Qt6::Test)
if(${SCREENPLAY_STEAM})
target_compile_definitions(tst_ScreenPlay PRIVATE SCREENPLAY_STEAM=1)
target_compile_definitions(tst_ScreenPlay PRIVATE SCREENPLAY_STEAM)
target_link_libraries(tst_ScreenPlay PUBLIC ScreenPlayWorkshopplugin ScreenPlayWorkshop)
endif()
endif()

View File

@ -62,22 +62,22 @@ Settings::Settings(const std::shared_ptr<GlobalVariables>& globalVariables,
qmlRegisterUncreatableType<Settings>("Settings", 1, 0, "Settings", "Error only for enums");
if (!m_qSettings.contains("Autostart")) {
if (desktopEnvironment() == DesktopEnvironment::Windows) {
QSettings settings("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", QSettings::NativeFormat);
if (!m_qSettings.value("Autostart").toBool()) {
if (!settings.contains("ScreenPlay")) {
}
}
// Lets not set the dev version as startup.
#ifdef RELEASE_VERSION
if (desktopEnvironment() == DesktopEnvironment::Windows) {
QSettings settings("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", QSettings::NativeFormat);
if (!settings.childGroups().contains("ScreenPlay", Qt::CaseSensitive)) {
settings.setValue("ScreenPlay", QDir::toNativeSeparators(QCoreApplication::applicationFilePath()) + " -silent");
settings.sync();
if (!m_qSettings.contains("Autostart")) {
m_qSettings.setValue("Autostart", true);
m_qSettings.sync();
}
}
m_qSettings.setValue("Autostart", true);
m_qSettings.sync();
} else {
setAutostart(m_qSettings.value("Autostart", true).toBool());
}
#endif
setCheckWallpaperVisible(m_qSettings.value("CheckWallpaperVisible", false).toBool());
setHighPriorityStart(m_qSettings.value("ScreenPlayExecutable", false).toBool());
if (m_qSettings.contains("VideoFillMode")) {

View File

@ -72,7 +72,7 @@ if __name__ == "__main__":
parser.add_argument('-installer', action="store_true", dest="create_installer",
help="Create a installer.")
parser.add_argument('-release', action="store_true", dest="build_release",
help="Create a release version of ScreenPlay for sharing with the world.")
help="Create a release version of ScreenPlay for sharing with the world. This is not about debug/release build, but the c++ define SCREENPLAY_RELEASE.")
args = parser.parse_args()
if not args.build_type:
@ -114,6 +114,10 @@ if __name__ == "__main__":
"steam_appid.txt" # This file is only needed for testing. It must not be in a release version!
]
if args.build_steam and not args.build_release:
print("Steam Builds must have release option enabled via -release")
exit(4)
if root_path.name == "Tools":
root_path = root_path.parent
@ -179,7 +183,7 @@ if __name__ == "__main__":
if args.build_tests:
build_tests = "ON"
if args.build_release:
build_tests = "ON"
build_release = "ON"
if args.create_installer:
create_installer = "ON"
ifw_root_path = f"{aqt_path}\\Tools\\QtInstallerFramework\\4.2"