Switched the installer to NSIS.
This commit is contained in:
parent
4d5e88d819
commit
8847a4cce6
13 changed files with 139 additions and 121 deletions
|
@ -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="
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 ..)
|
||||
|
|
|
@ -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 ..
|
||||
|
|
|
@ -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})
|
||||
|
|
|
@ -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 ..
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 ^
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
92
ports/deploy/installscript.nsi
Normal file
92
ports/deploy/installscript.nsi
Normal 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
|
|
@ -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");
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue