Switched the installer to NSIS.

This commit is contained in:
Gonzalo Exequiel Pedone 2021-05-05 16:45:47 -03:00
parent 4d5e88d819
commit 8847a4cce6
No known key found for this signature in database
GPG key ID: B8B09E63E9B85BAF
13 changed files with 139 additions and 121 deletions

View file

@ -8,9 +8,10 @@ cache:
env: env:
global: global:
- QTIFWVER=4.0.0 - QTIFWVER=4.1.0
- ARCH_ROOT_DATE=2021.02.01 - ARCH_ROOT_DATE=2021.05.01
- ARCH_ROOT_URL=https://mirror.rackspace.com/archlinux - ARCH_ROOT_URL=https://mirror.rackspace.com/archlinux
- NSIS_VERSION=3.06.1
# BT_KEY # BT_KEY
- secure: "hHaLRfMKI1iB/NtKRfS3E+kABSbMOycS3dW2wNmNdCpPEmGaeuBfRIiwXlPMMXYIE/47YUKCGN8vraCoW4yEJGaIsU86MpaHsBYdjNFYaTjkElKTo8d2IgS9ur/ve65Fjutd8rDRGYBcvG9FIcMMgN+rNekSy9L4eVoaFuMq5V5AkxSmQu7YMmny3DMR1+eD7E/I4tu6tde16l51mB47fyW1u/FcyJ8mIAPW5hoSvVznNxAPGd5/80NcqykfjNmTFQ2B7YJMEQPwIA/YJMq+SjOqZNyB0Q8XzN1I9HqK2D2C89dZUI6bD+Q9JNGKIyoEpJ5BzKu6oZaVBGIfCCI9Dyq/B6PCm4s5swVWkGFJzL31EKewvzP3YepszEAbiuFMLW2ye6PJat5pSU13RHVKzVS2jXoFQGdPnwU9dtIRXga1csGar3RqJDlCR2Ncz1DGv80r4Z3CFycrftgFNIRLG1cXaaN4GWM8uE38zSp0hhWyiPXay++rhRdyQU4sq2A3dEA8JqxOR1B6ngxqBgN17u1VHK2EUUZ5HHlv856SnZ1lA94J7T0CBrkRxEDLmE6fLR5n0CuHSX5iA4rRfqKmF1FfQi/IaG+EWKbACkmQGIV9+aKB30JqsJvcXLtSGTC7IzonIzIKiBhjJo7AbW45VzzmfBC3MqiNPpEwwTiRKDI=" - secure: "hHaLRfMKI1iB/NtKRfS3E+kABSbMOycS3dW2wNmNdCpPEmGaeuBfRIiwXlPMMXYIE/47YUKCGN8vraCoW4yEJGaIsU86MpaHsBYdjNFYaTjkElKTo8d2IgS9ur/ve65Fjutd8rDRGYBcvG9FIcMMgN+rNekSy9L4eVoaFuMq5V5AkxSmQu7YMmny3DMR1+eD7E/I4tu6tde16l51mB47fyW1u/FcyJ8mIAPW5hoSvVznNxAPGd5/80NcqykfjNmTFQ2B7YJMEQPwIA/YJMq+SjOqZNyB0Q8XzN1I9HqK2D2C89dZUI6bD+Q9JNGKIyoEpJ5BzKu6oZaVBGIfCCI9Dyq/B6PCm4s5swVWkGFJzL31EKewvzP3YepszEAbiuFMLW2ye6PJat5pSU13RHVKzVS2jXoFQGdPnwU9dtIRXga1csGar3RqJDlCR2Ncz1DGv80r4Z3CFycrftgFNIRLG1cXaaN4GWM8uE38zSp0hhWyiPXay++rhRdyQU4sq2A3dEA8JqxOR1B6ngxqBgN17u1VHK2EUUZ5HHlv856SnZ1lA94J7T0CBrkRxEDLmE6fLR5n0CuHSX5iA4rRfqKmF1FfQi/IaG+EWKbACkmQGIV9+aKB30JqsJvcXLtSGTC7IzonIzIKiBhjJo7AbW45VzzmfBC3MqiNPpEwwTiRKDI="

View file

@ -30,7 +30,9 @@ if (APPLE)
set(BUILD_INFO_FILE AkVirtualCamera.plugin/Contents/Resources/build-info.txt) set(BUILD_INFO_FILE AkVirtualCamera.plugin/Contents/Resources/build-info.txt)
set(APP_LIBDIR AkVirtualCamera.plugin/Contents/Frameworks) set(APP_LIBDIR AkVirtualCamera.plugin/Contents/Frameworks)
set(MAIN_EXECUTABLE AkVirtualCamera.plugin/Contents/MacOS/AkVirtualCamera) set(MAIN_EXECUTABLE AkVirtualCamera.plugin/Contents/MacOS/AkVirtualCamera)
set(PACKET_TARGET_ARCH ${TARGET_ARCH})
set(QTIFW_TARGET_DIR "\@ApplicationsDir\@/AkVirtualCamera") set(QTIFW_TARGET_DIR "\@ApplicationsDir\@/AkVirtualCamera")
set(OUTPUT_FORMATS "QtIFW")
elseif (WIN32) elseif (WIN32)
add_subdirectory(dshow) add_subdirectory(dshow)
set(TARGET_PLATFORM windows) set(TARGET_PLATFORM windows)
@ -39,10 +41,12 @@ elseif (WIN32)
set(APP_LIBDIR ${TARGET_ARCH}) set(APP_LIBDIR ${TARGET_ARCH})
if (IS_64BITS_TARGET) if (IS_64BITS_TARGET)
set(QTIFW_TARGET_DIR "\@ApplicationsDirX64\@/AkVirtualCamera") set(PACKET_TARGET_ARCH win64)
else () else ()
set(QTIFW_TARGET_DIR "\@ApplicationsDirX86\@/AkVirtualCamera") set(PACKET_TARGET_ARCH win32)
endif() endif()
set(OUTPUT_FORMATS "Nsis")
endif () endif ()
add_subdirectory(Manager) add_subdirectory(Manager)

View file

@ -36,7 +36,8 @@ add_executable(Manager
src/main.cpp src/main.cpp
src/cmdparser.cpp) src/cmdparser.cpp)
set_target_properties(Manager PROPERTIES 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) add_dependencies(Manager VCamIPC PlatformUtils VCamUtils)
target_include_directories(Manager target_include_directories(Manager
PRIVATE ..) PRIVATE ..)

View file

@ -32,7 +32,8 @@ add_executable(Assistant
src/assistantglobals.h src/assistantglobals.h
src/main.cpp) src/main.cpp)
set_target_properties(Assistant PROPERTIES 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) add_dependencies(Assistant PlatformUtils VCamUtils)
target_include_directories(Assistant target_include_directories(Assistant
PRIVATE .. PRIVATE ..

View file

@ -47,9 +47,10 @@ add_library(VirtualCamera SHARED
src/queue.h src/queue.h
src/stream.cpp src/stream.cpp
src/stream.h) 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 set_target_properties(VirtualCamera PROPERTIES
OUTPUT_NAME ${CMIO_PLUGIN_NAME} OUTPUT_NAME ${CMIO_PLUGIN_NAME}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build/${MACBINPATH}
PREFIX "" PREFIX ""
SUFFIX "") SUFFIX "")
add_dependencies(VirtualCamera VCamIPC PlatformUtils VCamUtils) add_dependencies(VirtualCamera VCamIPC PlatformUtils VCamUtils)
@ -79,4 +80,4 @@ target_link_libraries(VirtualCamera
VCamIPC VCamIPC
${EXTRA_LIBS}) ${EXTRA_LIBS})
install(TARGETS VirtualCamera DESTINATION ${MACBINPATH}) 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})

View file

@ -31,7 +31,8 @@ add_executable(Assistant
src/service.cpp src/service.cpp
src/service.h) src/service.h)
set_target_properties(Assistant PROPERTIES 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) add_dependencies(Assistant PlatformUtils VCamUtils)
target_include_directories(Assistant target_include_directories(Assistant
PRIVATE .. PRIVATE ..

View file

@ -79,6 +79,7 @@ add_library(VirtualCamera SHARED
VirtualCamera.def) VirtualCamera.def)
set_target_properties(VirtualCamera PROPERTIES set_target_properties(VirtualCamera PROPERTIES
OUTPUT_NAME ${DSHOW_PLUGIN_NAME} OUTPUT_NAME ${DSHOW_PLUGIN_NAME}
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build/${INSTALLPATH}
PREFIX "") PREFIX "")
add_dependencies(VirtualCamera VCamIPC PlatformUtils VCamUtils) add_dependencies(VirtualCamera VCamIPC PlatformUtils VCamUtils)
target_compile_definitions(VirtualCamera PRIVATE VIRTUALCAMERA_LIBRARY) target_compile_definitions(VirtualCamera PRIVATE VIRTUALCAMERA_LIBRARY)

View file

@ -5,9 +5,9 @@ sourcesDir = @CMAKE_SOURCE_DIR@
mainExecutable = @MAIN_EXECUTABLE@ mainExecutable = @MAIN_EXECUTABLE@
libDir = @APP_LIBDIR@ libDir = @APP_LIBDIR@
buildInfoFile = @BUILD_INFO_FILE@ buildInfoFile = @BUILD_INFO_FILE@
targetArch = @TARGET_ARCH@ targetArch = @PACKET_TARGET_ARCH@
version = @VERSION@ version = @VERSION@
outputFormats = QtIFW outputFormats = @OUTPUT_FORMATS@
hideArch = true hideArch = true
writeLauncher = false writeLauncher = false
@ -22,3 +22,13 @@ license = COPYING
licenseName = GNU General Public License v3.0 licenseName = GNU General Public License v3.0
script = ports/deploy/installscript.@TARGET_PLATFORM@.qs script = ports/deploy/installscript.@TARGET_PLATFORM@.qs
changeLog = ChangeLog 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

View file

@ -22,7 +22,8 @@ setlocal
if "%CMAKE_GENERATOR%" == "MSYS Makefiles" set PATH=C:\msys64\usr\bin;%PATH% if "%CMAKE_GENERATOR%" == "MSYS Makefiles" set PATH=C:\msys64\usr\bin;%PATH%
if "%CMAKE_GENERATOR%" == "MSYS Makefiles" ( if "%CMAKE_GENERATOR%" == "MSYS Makefiles" (
pacman -Syy pacman --noconfirm -Syyu ^
--ignore filesystem,pacman,pacman-mirrors
pacman --noconfirm --needed -S ^ pacman --noconfirm --needed -S ^
cmake ^ cmake ^
git ^ git ^
@ -34,5 +35,5 @@ if "%CMAKE_GENERATOR%" == "MSYS Makefiles" (
mingw-w64-x86_64-pkg-config ^ mingw-w64-x86_64-pkg-config ^
mingw-w64-i686-pkg-config mingw-w64-i686-pkg-config
) )
endlocal endlocal

View file

@ -84,12 +84,12 @@ EOF
mingw-w64-gcc \ mingw-w64-gcc \
mingw-w64-cmake mingw-w64-cmake
qtIFW=QtInstallerFramework-win-x86.exe # Install NSIS
# Install Qt Installer Framework nsis=nsis-${NSIS_VERSION}-setup.exe
${DOWNLOAD_CMD} http://download.qt.io/official_releases/qt-installer-framework/${QTIFWVER}/${qtIFW} || true ${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 INSTALLSCRIPT=installscript.sh
cat << EOF > ${INSTALLSCRIPT} cat << EOF > ${INSTALLSCRIPT}
@ -100,10 +100,7 @@ export HOME=$HOME
export WINEPREFIX=/opt/.wine export WINEPREFIX=/opt/.wine
cd $TRAVIS_BUILD_DIR cd $TRAVIS_BUILD_DIR
wine ./${qtIFW} \ wine ./${nsis} /S
${qtIinstallerVerbose} \
--script "ports/ci/travis/qtifw_non_interactive_install.qs" \
--no-force-installations
EOF EOF
chmod +x ${INSTALLSCRIPT} chmod +x ${INSTALLSCRIPT}
@ -126,20 +123,22 @@ elif [ "${TRAVIS_OS_NAME}" = osx ]; then
python python
brew link --overwrite python brew link --overwrite python
brew link python brew link python
qtIFW=QtInstallerFramework-mac-x64.dmg
# Install Qt Installer Framework # 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 ${DOWNLOAD_CMD} http://download.qt.io/official_releases/qt-installer-framework/${QTIFWVER}/${qtIFW} || true
if [ -e "${qtIFW}" ]; then if [ -e "${qtIFW}" ]; then
hdiutil convert ${qtIFW} -format UDZO -o qtifw hdiutil convert ${qtIFW} -format UDZO -o qtifw
7z x -oqtifw qtifw.dmg -bb 7z x -oqtifw qtifw.dmg -bb
7z x -oqtifw qtifw/5.hfsx -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 \ qtifw/QtInstallerFramework-macOS-x86_64-${QTIFWVER}/QtInstallerFramework-macOS-x86_64-${QTIFWVER}.app/Contents/MacOS/QtInstallerFramework-macOS-x86_64-${QTIFWVER} \
${qtIinstallerVerbose} \ --verbose \
--script "$PWD/ports/ci/travis/qtifw_non_interactive_install.qs" \ --accept-licenses \
--no-force-installations --accept-messages \
--confirm-command \
install
fi fi
fi fi

View file

@ -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);
}

View file

@ -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 <http://www.gnu.org/licenses/>.
#
# 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

View file

@ -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");
}
}