Skip to content
Snippets Groups Projects
Commit e9c22c3b authored by BtbN's avatar BtbN
Browse files

Move CPack win32 generator from NSIS to WIX

parent e7e570b8
No related branches found
No related tags found
No related merge requests found
if(APPLE)
if(WIN32 OR APPLE)
cmake_minimum_required(VERSION 2.8.12)
else()
cmake_minimum_required(VERSION 2.8.11)
......
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'">
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\64bit\obs.exe</LocalDebuggerCommand>
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\64bit\obs64.exe</LocalDebuggerCommand>
<LocalDebuggerWorkingDirectory>$(SolutionDir)rundir\$(Configuration)\bin\64bit</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\64bit\obs.exe</LocalDebuggerCommand>
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\64bit\obs64.exe</LocalDebuggerCommand>
<LocalDebuggerWorkingDirectory>$(SolutionDir)rundir\$(Configuration)\bin\64bit</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\64bit\obs.exe</LocalDebuggerCommand>
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\64bit\obs64.exe</LocalDebuggerCommand>
<LocalDebuggerWorkingDirectory>$(SolutionDir)rundir\$(Configuration)\bin\64bit</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|x64'">
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\64bit\obs.exe</LocalDebuggerCommand>
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\64bit\obs64.exe</LocalDebuggerCommand>
<LocalDebuggerWorkingDirectory>$(SolutionDir)rundir\$(Configuration)\bin\64bit</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\32bit\obs.exe</LocalDebuggerCommand>
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\32bit\obs32.exe</LocalDebuggerCommand>
<LocalDebuggerWorkingDirectory>$(SolutionDir)rundir\$(Configuration)\bin\32bit</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\32bit\obs.exe</LocalDebuggerCommand>
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\32bit\obs32.exe</LocalDebuggerCommand>
<LocalDebuggerWorkingDirectory>$(SolutionDir)rundir\$(Configuration)\bin\32bit</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\32bit\obs.exe</LocalDebuggerCommand>
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\32bit\obs32.exe</LocalDebuggerCommand>
<LocalDebuggerWorkingDirectory>$(SolutionDir)rundir\$(Configuration)\bin\32bit</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|Win32'">
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\32bit\obs.exe</LocalDebuggerCommand>
<LocalDebuggerCommand>$(SolutionDir)rundir\$(Configuration)\bin\32bit\obs32.exe</LocalDebuggerCommand>
<LocalDebuggerWorkingDirectory>$(SolutionDir)rundir\$(Configuration)\bin\32bit</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
......
[Settings]
NumFields=1
[Field 1]
Type=CheckBox
Text=Create @CPACK_PACKAGE_NAME@ Desktop Icon
Left=0
Right=-1
Top=10
Bottom=-1
State=1
This diff is collapsed.
......@@ -2,7 +2,7 @@
if(APPLE AND NOT CPACK_GENERATOR)
set(CPACK_GENERATOR "Bundle")
elseif(WIN32 AND NOT CPACK_GENERATOR)
set(CPACK_GENERATOR "NSIS" "ZIP")
set(CPACK_GENERATOR "WIX" "ZIP")
endif()
set(CPACK_PACKAGE_NAME "OBS Studio")
......@@ -19,36 +19,31 @@ if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
OUTPUT_VARIABLE OBS_VERSION
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT "${OBS_VERSION}" STREQUAL "")
set(CPACK_PACKAGE_VERSION "${OBS_VERSION}")
endif()
else()
set(OBS_VERSION "${CPACK_PACKAGE_VERSION}")
endif()
set(OBS_VERSION "${CPACK_PACKAGE_VERSION}")
if(INSTALLER_RUN)
file(TO_NATIVE_PATH "${OBS_EXECUTABLE32_DESTINATION}/obs" _obs32)
file(TO_NATIVE_PATH "${OBS_EXECUTABLE64_DESTINATION}/obs" _obs64)
#Workaround a cmake bug, remove when fixed
string(REPLACE "\\" "\\\\" _obs32 "${_obs32}")
string(REPLACE "\\" "\\\\" _obs64 "${_obs64}")
set(CPACK_PACKAGE_EXECUTABLES
"${_obs32}" "OBS Studio (32bit)"
"${_obs64}" "OBS Studio (64bit)")
"obs32" "OBS Studio (32bit)"
"obs64" "OBS Studio (64bit)")
set(CPACK_CREATE_DESKTOP_LINKS
"${_obs32}"
"${_obs64}")
"obs32"
"obs64")
else()
file(TO_NATIVE_PATH "${OBS_EXECUTABLE_DESTINATION}/obs" _obs)
#Workaround a cmake bug, remove when fixed
string(REPLACE "\\" "\\\\" _obs "${_obs}")
if(WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_output_suffix "64")
else()
set(_output_suffix "32")
endif()
else()
set(_output_suffix "")
endif()
set(CPACK_PACKAGE_EXECUTABLES "${_obs}" "OBS Studio")
set(CPACK_CREATE_DESKTOP_LINKS "${_obs}")
set(CPACK_PACKAGE_EXECUTABLES "obs${_output_suffix}" "OBS Studio")
set(CPACK_CREATE_DESKTOP_LINKS "obs${_output_suffix}")
endif()
set(CPACK_BUNDLE_NAME "OBS Studio")
......@@ -56,27 +51,28 @@ set(CPACK_BUNDLE_PLIST "${CMAKE_SOURCE_DIR}/cmake/osxbundle/Info.plist")
set(CPACK_BUNDLE_ICON "${CMAKE_SOURCE_DIR}/cmake/osxbundle/obs.icns")
set(CPACK_BUNDLE_STARTUP_COMMAND "${CMAKE_SOURCE_DIR}/cmake/osxbundle/obslaunch.sh")
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
set(CPACK_NSIS_MODIFY_PATH ON)
set(CPACK_WIX_TEMPLATE "${CMAKE_SOURCE_DIR}/cmake/Modules/WIX.template.in")
if(INSTALLER_RUN)
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "OBSStudio")
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
set(CPACK_WIX_UPGRADE_GUID "1f59ff79-2a3c-43c1-b2b2-033a5e6342eb")
set(CPACK_WIX_PRODUCT_GUID "0c7bec2a-4f07-41b2-9dff-d64b09c9c384")
set(CPACK_PACKAGE_FILE_NAME "obs-studio-${OBS_VERSION}")
elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
if(WIN32)
set(CPACK_PACKAGE_NAME "OBS Studio (64bit)")
endif()
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "OBSStudio64")
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
set(CPACK_WIX_UPGRADE_GUID "44c72510-2e8e-489c-8bc0-2011a9631b0b")
set(CPACK_WIX_PRODUCT_GUID "ca5bf4fe-7b38-4003-9455-de249d03caac")
set(CPACK_PACKAGE_FILE_NAME "obs-studio-x64-${OBS_VERSION}")
else()
if(WIN32)
set(CPACK_PACKAGE_NAME "OBS Studio (32bit)")
endif()
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "OBSStudio32")
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES32")
set(CPACK_WIX_UPGRADE_GUID "a26acea4-6190-4470-9fb9-f6d32f3ba030")
set(CPACK_WIX_PRODUCT_GUID "8e24982d-b0ab-4f66-9c90-f726f3b64682")
set(CPACK_PACKAGE_FILE_NAME "obs-studio-x86-${OBS_VERSION}")
endif()
......
<?xml version="1.0" encoding="UTF-8"?>
<?include "cpack_variables.wxi"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
RequiredVersion="3.6.3303.0">
<Product Id="$(var.CPACK_WIX_PRODUCT_GUID)"
Name="$(var.CPACK_PACKAGE_NAME)"
Language="1033"
Version="$(var.CPACK_PACKAGE_VERSION)"
Manufacturer="$(var.CPACK_PACKAGE_VENDOR)"
UpgradeCode="$(var.CPACK_WIX_UPGRADE_GUID)">
<Package InstallerVersion="301" Compressed="yes"/>
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes"/>
<MajorUpgrade
Schedule="afterInstallInitialize"
AllowDowngrades="yes"/>
<WixVariable Id="WixUILicenseRtf" Value="$(var.CPACK_WIX_LICENSE_RTF)"/>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALL_ROOT"/>
<?ifdef CPACK_WIX_PRODUCT_ICON?>
<Property Id="ARPPRODUCTICON">ProductIcon.ico</Property>
<Icon Id="ProductIcon.ico" SourceFile="$(var.CPACK_WIX_PRODUCT_ICON)"/>
<?endif?>
<?ifdef CPACK_WIX_UI_BANNER?>
<WixVariable Id="WixUIBannerBmp" Value="$(var.CPACK_WIX_UI_BANNER)"/>
<?endif?>
<?ifdef CPACK_WIX_UI_DIALOG?>
<WixVariable Id="WixUIDialogBmp" Value="$(var.CPACK_WIX_UI_DIALOG)"/>
<?endif?>
<FeatureRef Id="ProductFeature"/>
<UIRef Id="WixUI_InstallDir" />
</Product>
</Wix>
......@@ -80,6 +80,19 @@ add_executable(obs WIN32
${obs_HEADERS}
${obs_UI_HEADERS}
${obs_QRC_SOURCES})
if(WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_output_suffix "64")
else()
set(_output_suffix "32")
endif()
set_target_properties(obs
PROPERTIES
OUTPUT_NAME "obs${_output_suffix}")
endif()
target_link_libraries(obs
libobs
Qt5::Widgets
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment