diff --git a/.travis.yml b/.travis.yml index 9b09979..a1d1ebe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,9 +8,10 @@ cache: env: global: - - QTIFWVER=4.0.0 - - ARCH_ROOT_DATE=2021.02.01 + - QTIFWVER=4.1.0 + - ARCH_ROOT_DATE=2021.05.01 - ARCH_ROOT_URL=https://mirror.rackspace.com/archlinux + - NSIS_VERSION=3.06.1 # BT_KEY - secure: "hHaLRfMKI1iB/NtKRfS3E+kABSbMOycS3dW2wNmNdCpPEmGaeuBfRIiwXlPMMXYIE/47YUKCGN8vraCoW4yEJGaIsU86MpaHsBYdjNFYaTjkElKTo8d2IgS9ur/ve65Fjutd8rDRGYBcvG9FIcMMgN+rNekSy9L4eVoaFuMq5V5AkxSmQu7YMmny3DMR1+eD7E/I4tu6tde16l51mB47fyW1u/FcyJ8mIAPW5hoSvVznNxAPGd5/80NcqykfjNmTFQ2B7YJMEQPwIA/YJMq+SjOqZNyB0Q8XzN1I9HqK2D2C89dZUI6bD+Q9JNGKIyoEpJ5BzKu6oZaVBGIfCCI9Dyq/B6PCm4s5swVWkGFJzL31EKewvzP3YepszEAbiuFMLW2ye6PJat5pSU13RHVKzVS2jXoFQGdPnwU9dtIRXga1csGar3RqJDlCR2Ncz1DGv80r4Z3CFycrftgFNIRLG1cXaaN4GWM8uE38zSp0hhWyiPXay++rhRdyQU4sq2A3dEA8JqxOR1B6ngxqBgN17u1VHK2EUUZ5HHlv856SnZ1lA94J7T0CBrkRxEDLmE6fLR5n0CuHSX5iA4rRfqKmF1FfQi/IaG+EWKbACkmQGIV9+aKB30JqsJvcXLtSGTC7IzonIzIKiBhjJo7AbW45VzzmfBC3MqiNPpEwwTiRKDI=" diff --git a/CMakeLists.txt b/CMakeLists.txt index 7da713a..e7756e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,9 @@ if (APPLE) set(BUILD_INFO_FILE AkVirtualCamera.plugin/Contents/Resources/build-info.txt) set(APP_LIBDIR AkVirtualCamera.plugin/Contents/Frameworks) set(MAIN_EXECUTABLE AkVirtualCamera.plugin/Contents/MacOS/AkVirtualCamera) + set(PACKET_TARGET_ARCH ${TARGET_ARCH}) set(QTIFW_TARGET_DIR "\@ApplicationsDir\@/AkVirtualCamera") + set(OUTPUT_FORMATS "QtIFW") elseif (WIN32) add_subdirectory(dshow) set(TARGET_PLATFORM windows) @@ -39,10 +41,12 @@ elseif (WIN32) set(APP_LIBDIR ${TARGET_ARCH}) if (IS_64BITS_TARGET) - set(QTIFW_TARGET_DIR "\@ApplicationsDirX64\@/AkVirtualCamera") + set(PACKET_TARGET_ARCH win64) else () - set(QTIFW_TARGET_DIR "\@ApplicationsDirX86\@/AkVirtualCamera") + set(PACKET_TARGET_ARCH win32) endif() + + set(OUTPUT_FORMATS "Nsis") endif () add_subdirectory(Manager) diff --git a/Manager/CMakeLists.txt b/Manager/CMakeLists.txt index 10bc96f..a4bdfd4 100644 --- a/Manager/CMakeLists.txt +++ b/Manager/CMakeLists.txt @@ -36,7 +36,8 @@ add_executable(Manager src/main.cpp src/cmdparser.cpp) set_target_properties(Manager PROPERTIES - OUTPUT_NAME AkVCamManager) + OUTPUT_NAME AkVCamManager + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build/${INSTALLPATH}) add_dependencies(Manager VCamIPC PlatformUtils VCamUtils) target_include_directories(Manager PRIVATE ..) diff --git a/cmio/Assistant/CMakeLists.txt b/cmio/Assistant/CMakeLists.txt index 384d4c3..417d047 100644 --- a/cmio/Assistant/CMakeLists.txt +++ b/cmio/Assistant/CMakeLists.txt @@ -32,7 +32,8 @@ add_executable(Assistant src/assistantglobals.h src/main.cpp) set_target_properties(Assistant PROPERTIES - OUTPUT_NAME ${CMIO_PLUGIN_ASSISTANT_NAME}) + OUTPUT_NAME ${CMIO_PLUGIN_ASSISTANT_NAME} + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build/${INSTALLPATH}) add_dependencies(Assistant PlatformUtils VCamUtils) target_include_directories(Assistant PRIVATE .. diff --git a/cmio/VirtualCamera/CMakeLists.txt b/cmio/VirtualCamera/CMakeLists.txt index 100aaa1..668f6a2 100644 --- a/cmio/VirtualCamera/CMakeLists.txt +++ b/cmio/VirtualCamera/CMakeLists.txt @@ -47,9 +47,10 @@ add_library(VirtualCamera SHARED src/queue.h src/stream.cpp src/stream.h) -configure_file(Info.plist.in Info.plist) +configure_file(Info.plist.in ${CMAKE_BINARY_DIR}/build/${CONTENTSPATH}/Info.plist) set_target_properties(VirtualCamera PROPERTIES OUTPUT_NAME ${CMIO_PLUGIN_NAME} + LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build/${MACBINPATH} PREFIX "" SUFFIX "") add_dependencies(VirtualCamera VCamIPC PlatformUtils VCamUtils) @@ -79,4 +80,4 @@ target_link_libraries(VirtualCamera VCamIPC ${EXTRA_LIBS}) install(TARGETS VirtualCamera DESTINATION ${MACBINPATH}) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Info.plist DESTINATION ${CONTENTSPATH}) +install(FILES ${CMAKE_BINARY_DIR}/build/${CONTENTSPATH}/Info.plist DESTINATION ${CONTENTSPATH}) diff --git a/dshow/Assistant/CMakeLists.txt b/dshow/Assistant/CMakeLists.txt index 3df36e1..dd55e50 100644 --- a/dshow/Assistant/CMakeLists.txt +++ b/dshow/Assistant/CMakeLists.txt @@ -31,7 +31,8 @@ add_executable(Assistant src/service.cpp src/service.h) set_target_properties(Assistant PROPERTIES - OUTPUT_NAME ${DSHOW_PLUGIN_ASSISTANT_NAME}) + OUTPUT_NAME ${DSHOW_PLUGIN_ASSISTANT_NAME} + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build/${INSTALLPATH}) add_dependencies(Assistant PlatformUtils VCamUtils) target_include_directories(Assistant PRIVATE .. diff --git a/dshow/VirtualCamera/CMakeLists.txt b/dshow/VirtualCamera/CMakeLists.txt index 1d234f9..bd19c8c 100644 --- a/dshow/VirtualCamera/CMakeLists.txt +++ b/dshow/VirtualCamera/CMakeLists.txt @@ -79,6 +79,7 @@ add_library(VirtualCamera SHARED VirtualCamera.def) set_target_properties(VirtualCamera PROPERTIES OUTPUT_NAME ${DSHOW_PLUGIN_NAME} + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build/${INSTALLPATH} PREFIX "") add_dependencies(VirtualCamera VCamIPC PlatformUtils VCamUtils) target_compile_definitions(VirtualCamera PRIVATE VIRTUALCAMERA_LIBRARY) diff --git a/package_info.conf.in b/package_info.conf.in index 7425502..b94061d 100644 --- a/package_info.conf.in +++ b/package_info.conf.in @@ -5,9 +5,9 @@ sourcesDir = @CMAKE_SOURCE_DIR@ mainExecutable = @MAIN_EXECUTABLE@ libDir = @APP_LIBDIR@ buildInfoFile = @BUILD_INFO_FILE@ -targetArch = @TARGET_ARCH@ +targetArch = @PACKET_TARGET_ARCH@ version = @VERSION@ -outputFormats = QtIFW +outputFormats = @OUTPUT_FORMATS@ hideArch = true writeLauncher = false @@ -22,3 +22,13 @@ license = COPYING licenseName = GNU General Public License v3.0 script = ports/deploy/installscript.@TARGET_PLATFORM@.qs changeLog = ChangeLog + +[Nsis] +organization = Webcamoid +appName = AkVirtualCamera +productVersion = @VERSION@.0 +description = AkVirtualCamera, virtual camera for Mac and Windows +license = COPYING +requiresAdminRights = true +multiUserInstall = false +script = ports/deploy/installscript.nsi diff --git a/ports/ci/appveyor/install_deps.bat b/ports/ci/appveyor/install_deps.bat index d892137..19da867 100755 --- a/ports/ci/appveyor/install_deps.bat +++ b/ports/ci/appveyor/install_deps.bat @@ -22,7 +22,8 @@ setlocal if "%CMAKE_GENERATOR%" == "MSYS Makefiles" set PATH=C:\msys64\usr\bin;%PATH% if "%CMAKE_GENERATOR%" == "MSYS Makefiles" ( - pacman -Syy + pacman --noconfirm -Syyu ^ + --ignore filesystem,pacman,pacman-mirrors pacman --noconfirm --needed -S ^ cmake ^ git ^ @@ -34,5 +35,5 @@ if "%CMAKE_GENERATOR%" == "MSYS Makefiles" ( mingw-w64-x86_64-pkg-config ^ mingw-w64-i686-pkg-config ) - + endlocal diff --git a/ports/ci/travis/install_deps.sh b/ports/ci/travis/install_deps.sh index b2d5797..87dbd06 100644 --- a/ports/ci/travis/install_deps.sh +++ b/ports/ci/travis/install_deps.sh @@ -84,12 +84,12 @@ EOF mingw-w64-gcc \ mingw-w64-cmake - qtIFW=QtInstallerFramework-win-x86.exe + # Install NSIS - # Install Qt Installer Framework - ${DOWNLOAD_CMD} http://download.qt.io/official_releases/qt-installer-framework/${QTIFWVER}/${qtIFW} || true + nsis=nsis-${NSIS_VERSION}-setup.exe + ${DOWNLOAD_CMD} "https://sourceforge.net/projects/nsis/files/NSIS%20${NSIS_VERSION:0:1}/${NSIS_VERSION}/${nsis}" - if [ -e ${qtIFW} ]; then + if [ -e ${nsis} ]; then INSTALLSCRIPT=installscript.sh cat << EOF > ${INSTALLSCRIPT} @@ -100,10 +100,7 @@ export HOME=$HOME export WINEPREFIX=/opt/.wine cd $TRAVIS_BUILD_DIR -wine ./${qtIFW} \ - ${qtIinstallerVerbose} \ - --script "ports/ci/travis/qtifw_non_interactive_install.qs" \ - --no-force-installations +wine ./${nsis} /S EOF chmod +x ${INSTALLSCRIPT} @@ -126,20 +123,22 @@ elif [ "${TRAVIS_OS_NAME}" = osx ]; then python brew link --overwrite python brew link python - qtIFW=QtInstallerFramework-mac-x64.dmg # Install Qt Installer Framework + qtIFW=QtInstallerFramework-macOS-x86_64-${QTIFWVER}.dmg ${DOWNLOAD_CMD} http://download.qt.io/official_releases/qt-installer-framework/${QTIFWVER}/${qtIFW} || true if [ -e "${qtIFW}" ]; then hdiutil convert ${qtIFW} -format UDZO -o qtifw 7z x -oqtifw qtifw.dmg -bb 7z x -oqtifw qtifw/5.hfsx -bb - chmod +x qtifw/QtInstallerFramework-mac-x64/QtInstallerFramework-mac-x64.app/Contents/MacOS/QtInstallerFramework-mac-x64 + chmod +x qtifw/QtInstallerFramework-macOS-x86_64-${QTIFWVER}/QtInstallerFramework-macOS-x86_64-${QTIFWVER}.app/Contents/MacOS/QtInstallerFramework-macOS-x86_64-${QTIFWVER} - qtifw/QtInstallerFramework-mac-x64/QtInstallerFramework-mac-x64.app/Contents/MacOS/QtInstallerFramework-mac-x64 \ - ${qtIinstallerVerbose} \ - --script "$PWD/ports/ci/travis/qtifw_non_interactive_install.qs" \ - --no-force-installations + qtifw/QtInstallerFramework-macOS-x86_64-${QTIFWVER}/QtInstallerFramework-macOS-x86_64-${QTIFWVER}.app/Contents/MacOS/QtInstallerFramework-macOS-x86_64-${QTIFWVER} \ + --verbose \ + --accept-licenses \ + --accept-messages \ + --confirm-command \ + install fi fi diff --git a/ports/ci/travis/qtifw_non_interactive_install.qs b/ports/ci/travis/qtifw_non_interactive_install.qs deleted file mode 100644 index 55d8e67..0000000 --- a/ports/ci/travis/qtifw_non_interactive_install.qs +++ /dev/null @@ -1,50 +0,0 @@ -function Controller() -{ - installer.autoRejectMessageBoxes(); - installer.setMessageBoxAutomaticAnswer("OverwriteTargetDirectory", QMessageBox.Yes); - installer.setMessageBoxAutomaticAnswer("stopProcessesForUpdates", QMessageBox.Ignore); - installer.installationFinished.connect(function() { - gui.clickButton(buttons.NextButton); - }) -} - -Controller.prototype.IntroductionPageCallback = function() -{ - gui.clickButton(buttons.NextButton); -} - -Controller.prototype.TargetDirectoryPageCallback = function() -{ - gui.clickButton(buttons.NextButton); -} - -Controller.prototype.ComponentSelectionPageCallback = function() -{ - gui.clickButton(buttons.NextButton); -} - -Controller.prototype.LicenseAgreementPageCallback = function() -{ - gui.currentPageWidget().AcceptLicenseRadioButton.setChecked(true); - gui.clickButton(buttons.NextButton); -} - -Controller.prototype.StartMenuDirectoryPageCallback = function() -{ - gui.clickButton(buttons.NextButton); -} - -Controller.prototype.ReadyForInstallationPageCallback = function() -{ - gui.clickButton(buttons.NextButton); -} - -Controller.prototype.PerformInstallationPageCallback = function() -{ - gui.clickButton(buttons.NextButton); -} - -Controller.prototype.FinishedPageCallback = function() -{ - gui.clickButton(buttons.FinishButton); -} diff --git a/ports/deploy/installscript.nsi b/ports/deploy/installscript.nsi new file mode 100644 index 0000000..8cf1568 --- /dev/null +++ b/ports/deploy/installscript.nsi @@ -0,0 +1,92 @@ +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +!include LogicLib.nsh +!include x64.nsh + +Var arch +Var narchs +Var assistantPath +Var managerPath + +Function InstallPlugin + Push "x86" + StrCpy $narchs 1 + + ${If} ${RunningX64} + Push "x64" + StrCpy $narchs 2 + ${EndIf} + + ${For} $R1 1 $narchs + Pop $arch + + # Load assistant daemon. + StrCpy $assistantPath "$INSTDIR\$arch\AkVCamAssistant.exe" + + ${If} ${FileExists} "$assistantPath" + ExecShellWait "" "$assistantPath" "--install" SW_HIDE + ${EndIf} + + ExecShellWait "" "sc" "start AkVCamAssistant" SW_HIDE + ${Next} +FunctionEnd + +Function un.InstallPlugin + Push "x86" + StrCpy $narchs 1 + + ${If} ${RunningX64} + Push "x64" + StrCpy $narchs 2 + ${EndIf} + + ${For} $R1 1 $narchs + Pop $arch + + # If the assistant is not running, start it so it won't hang the manager. + StrCpy $assistantPath "$INSTDIR\$arch\AkVCamAssistant.exe" + ExecShellWait "" "sc" "start AkVCamAssistant" SW_HIDE + + # Remove virtual cameras + StrCpy $managerPath "$INSTDIR\$arch\AkVCamManager.exe" + + ${If} ${FileExists} "$managerPath" + ExecShellWait "" "$managerPath" "remove-devices" SW_HIDE + ExecShellWait "" "$managerPath" "update" SW_HIDE + ${EndIf} + + # Uninstall assistant daemon. + ExecShellWait "" "sc" "stop AkVCamAssistant" SW_HIDE + + ${If} ${FileExists} "$assistantPath" + ExecShellWait "" "$assistantPath" "--uninstall" SW_HIDE + ${EndIf} + + # If the assistant is still alive, kill it, no mercy. + ExecShellWait "" "taskkill" "/F /IM AkVCamAssistant.exe" SW_HIDE + ${Next} +FunctionEnd + +!macro INSTALL_SCRIPT_AFTER_INSTALL + Call InstallPlugin +!macroend + +!macro INSTALL_SCRIPT_UNINSTALL + Call un.InstallPlugin +!macroend diff --git a/ports/deploy/installscript.windows.qs b/ports/deploy/installscript.windows.qs deleted file mode 100644 index 8a11b05..0000000 --- a/ports/deploy/installscript.windows.qs +++ /dev/null @@ -1,44 +0,0 @@ -function Component() -{ -} - -Component.prototype.beginInstallation = function() -{ - component.beginInstallation(); -} - -Component.prototype.createOperations = function() -{ - component.createOperations(); - let archs = ["x86", "x64"]; - - for (let i in archs) { - // Remove virtual cameras - if (installer.isUninstaller()) { - let managerPath = - installer.value("TargetDir") - + "/" - + archs[i] - + "/AkVCamManager.exe"; - component.addElevateOperation("Execute", - managerPath, - "remove-devices"); - component.addElevatedOperation("Execute", - managerPath, - "update"); - } - - let assistantPath = - installer.value("TargetDir") - + "/" - + archs[i] - + "/AkVCamAssistant.exe"; - - // Load assistant daemon. - if (installer.fileExists(assistantPath)) - component.addElevatedOperation("Execute", - assistantPath, "--install", - "UNDOEXECUTE", - assistantPath, "--uninstall"); - } -}