Add installer

This commit is contained in:
driftingsun 2020-12-16 06:02:22 +03:00
parent c9bc8aa8c1
commit a2a5cafc5f
73 changed files with 4354 additions and 488 deletions

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>AmneziaVPN-service</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/AmneziaVPN.app/Contents/MacOS/AmneziaVPN-service</string>
</array>
<key>KeepAlive</key>
<true/>
<key>Sockets</key>
<dict>
<key>Listeners</key>
<dict>
<key>SockServiceName</key>
<string>5959</string>
<key>SockType</key>
<string>stream</string>
<key>SockFamily</key>
<string>IPv4</string>
</dict>
</dict>
</dict>
</plist>

BIN
deploy/data/macos/openvpn Normal file

Binary file not shown.

View file

@ -0,0 +1,32 @@
#!/bin/bash
APP_NAME=AmneziaVPN
PLIST_NAME=$APP_NAME.plist
LAUNCH_DAEMONS_PLIST_NAME=/Library/LaunchDaemons/$PLIST_NAME
LOG_FOLDER=/var/log/$APP_NAME
LOG_FILE="$LOG_FOLDER/post-install.log"
APP_PATH=/Applications/$APP_NAME.app
if launchctl list "$APP_NAME-service" &> /dev/null; then
launchctl unload $LAUNCH_DAEMONS_PLIST_NAME
rm -f $LAUNCH_DAEMONS_PLIST_NAME
fi
tar xzf $APP_PATH/$APP_NAME.tar.gz -C $APP_PATH
rm -f $APP_PATH/$APP_NAME.tar.gz
rm -rf $LOG_FOLDER
mkdir -p $LOG_FOLDER
echo "`date` Script started" > $LOG_FILE
killall -9 $APP_NAME-service 2>> $LOG_FILE
mv -f $APP_PATH/$PLIST_NAME $LAUNCH_DAEMONS_PLIST_NAME 2>> $LOG_FILE
chown root:wheel $LAUNCH_DAEMONS_PLIST_NAME
launchctl load $LAUNCH_DAEMONS_PLIST_NAME
echo "`date` Service status: $?" >> $LOG_FILE
echo "`date` Script finished" >> $LOG_FILE
rm -- "$0"

View file

@ -0,0 +1,14 @@
#!/bin/bash
APP_NAME=AmneziaVPN
PLIST_NAME=$APP_NAME.plist
LAUNCH_DAEMONS_PLIST_NAME=/Library/LaunchDaemons/$PLIST_NAME
if launchctl list "$APP_NAME-service" &> /dev/null; then
launchctl unload $LAUNCH_DAEMONS_PLIST_NAME
rm -f $LAUNCH_DAEMONS_PLIST_NAME
fi
rm -rf "$HOME/Library/Application Support/$APP_NAME"
rm -rf /var/log/$APP_NAME
rm -rf /Applications/$APP_NAME.app/Contents

View file

@ -0,0 +1,329 @@
var requestToQuitFromApp = false;
var updaterCompleted = 0;
var desktopAppProcessRunning = false;
var appInstalledUninstallerPath;
function appName()
{
return installer.value("Name");
}
function appAlreadyInstalled()
{
return installer.fileExists(appInstalledUninstallerPath);
}
function appExecutableFileName()
{
if (runningOnWindows()) {
return appName() + ".exe";
} else {
return appName();
}
}
function appInstalled()
{
if (runningOnWindows()) {
appInstalledUninstallerPath = installer.value("TargetDir") + "\\maintenancetool.exe";
} else if (runningOnMacOS()){
appInstalledUninstallerPath = "/Applications/" + appName() + ".app/maintenancetool.app/Contents/MacOS/maintenancetool";
}
return appAlreadyInstalled();
}
function endsWith(str, suffix)
{
return str.indexOf(suffix, str.length - suffix.length) !== -1;
}
function runningOnWindows()
{
return (installer.value("os") === "win");
}
function runningOnMacOS()
{
return (installer.value("os") === "mac");
}
function sleep(miliseconds) {
var currentTime = new Date().getTime();
while (currentTime + miliseconds >= new Date().getTime()) {}
}
function raiseInstallerWindow()
{
if (!runningOnMacOS()) {
return;
}
var result = installer.execute("/bin/bash", ["-c", "ps -A | grep -m1 '" + appName() + "' | awk '{print $1}'"]);
if (Number(result[0]) > 0) {
var arg = 'tell application \"System Events\" ' +
'\n set frontmost of the first process whose unix id is ' + Number(result[0]) + ' to true ' +
'\n end tell' +
'\n ';
installer.execute("osascript", ["-e", arg]);
}
}
function appProcessIsRunning()
{
if (runningOnWindows()) {
var cmdArgs = ["/FI", "WINDOWTITLE eq " + appName()];
var result = installer.execute("tasklist", cmdArgs);
if ( Number(result[1]) === 0 ) {
if (result[0].indexOf(appExecutableFileName()) !== -1) {
return true;
}
}
} else {
return checkProccesIsRunning("pgrep -x '" + appName() + "'")
}
return false;
}
function checkProccesIsRunning(arg)
{
var cmdArgs = ["-c", arg];
var result = installer.execute("/bin/bash", cmdArgs);
var resultArg1 = Number(result[0])
if (resultArg1 >= 3) {
return true;
}
return false;
}
function requestToQuit(installer,gui)
{
requestToQuitFromApp = true;
installer.setDefaultPageVisible(QInstaller.IntroductionPage, false);
installer.setDefaultPageVisible(QInstaller.TargetDirectory, false);
installer.setDefaultPageVisible(QInstaller.ComponentSelection, false);
installer.setDefaultPageVisible(QInstaller.LicenseCheck, false);
installer.setDefaultPageVisible(QInstaller.StartMenuSelection, false);
installer.setDefaultPageVisible(QInstaller.ReadyForInstallation, false);
installer.setDefaultPageVisible(QInstaller.PerformInstallation, false);
installer.setDefaultPageVisible(QInstaller.FinishedPage, false);
gui.clickButton(buttons.NextButton);
gui.clickButton(buttons.FinishButton);
gui.clickButton(buttons.CancelButton);
if (runningOnWindows()) {
installer.setCancelled();
}
}
Controller.prototype.PerformInstallationPageCallback = function()
{
gui.clickButton(buttons.NextButton);
}
Controller.prototype.LicenseAgreementPageCallback = function()
{
gui.clickButton(buttons.NextButton);
}
Controller.prototype.FinishedPageCallback = function ()
{
if (desktopAppProcessRunning) {
gui.clickButton(buttons.FinishButton);
} else if (installer.isUpdater()) {
installer.autoAcceptMessageBoxes();
gui.clickButton(buttons.FinishButton);
}
}
Controller.prototype.RestartPageCallback = function ()
{
updaterCompleted = 1;
gui.clickButton(buttons.FinishButton);
}
Controller.prototype.StartMenuDirectoryPageCallback = function()
{
gui.clickButton(buttons.NextButton);
}
Controller.prototype.ComponentSelectionPageCallback = function()
{
gui.clickButton(buttons.NextButton);
}
Controller.prototype.ReadyForInstallationPageCallback = function()
{
if (installer.isUpdater()) {
gui.clickButton(buttons.CommitButton);
}
}
Controller.prototype.TargetDirectoryPageCallback = function ()
{
var widget = gui.pageById(QInstaller.TargetDirectory);
if (widget !== null) {
widget.BrowseDirectoryButton.clicked.disconnect(onBrowseButtonClicked);
widget.BrowseDirectoryButton.clicked.connect(onBrowseButtonClicked);
gui.clickButton(buttons.NextButton);
}
}
Controller.prototype.IntroductionPageCallback = function ()
{
var widget = gui.currentPageWidget();
if (installer.isUpdater() && updaterCompleted === 1) {
gui.clickButton(buttons.FinishButton);
gui.clickButton(buttons.CancelButton);
return;
}
if (installer.isUninstaller()) {
if (widget !== null) {
widget.findChild("PackageManagerRadioButton").visible = false;
widget.findChild("UpdaterRadioButton").visible = false;
}
}
if (installer.isUpdater()) {
gui.clickButton(buttons.NextButton);
}
}
onBrowseButtonClicked = function()
{
var widget = gui.pageById(QInstaller.TargetDirectory);
if (widget !== null) {
if (runningOnWindows()) {
// On Windows we are appending \<APP_NAME> if selected path don't ends with <APP_NAME>
var targetDir = widget.TargetDirectoryLineEdit.text;
if (! endsWith(targetDir, appName())) {
targetDir = targetDir + "\\" + appName();
}
installer.setValue("TargetDir", targetDir);
widget.TargetDirectoryLineEdit.setText(installer.value("TargetDir"));
}
}
}
onNextButtonClicked = function()
{
var widget = gui.pageById(QInstaller.TargetDirectory);
if (widget !== null) {
installer.setValue("APP_BUNDLE_TARGET_DIR", widget.TargetDirectoryLineEdit.text);
}
}
function Controller () {
console.log("OS: %1, architecture: %2".arg(systemInfo.prettyProductName).arg(systemInfo.currentCpuArchitecture));
if (installer.isInstaller() || installer.isUpdater()) {
console.log("Check if app already installed: " + appInstalled());
}
if (runningOnWindows()) {
installer.setValue("AllUsers", "true");
}
if (installer.isInstaller()) {
installer.setDefaultPageVisible(QInstaller.ComponentSelection, false);
installer.setDefaultPageVisible(QInstaller.TargetDirectory, false);
installer.setDefaultPageVisible(QInstaller.StartMenuDirectoryPage, false);
installer.setDefaultPageVisible(QInstaller.LicenseCheck, false);
isDesktopAppProcessRunningMessageLoop();
if (requestToQuitFromApp === true) {
requestToQuit(installer, gui);
return;
}
if (runningOnMacOS()) {
installer.setMessageBoxAutomaticAnswer("OverwriteTargetDirectory", QMessageBox.Yes);
}
if (appAlreadyInstalled()) {
if (QMessageBox.Ok === QMessageBox.information("os.information", appName(),
qsTr("The application is already installed.") + " " +
qsTr("We need to remove the old installation first. Do you wish to proceed?"),
QMessageBox.Ok | QMessageBox.Cancel)) {
if (appAlreadyInstalled()) {
var resultArray = installer.execute(appInstalledUninstallerPath);
console.log("Uninstaller finished with code: " + resultArray[1])
if (Number(resultArray[1]) !== 0) {
console.log("Uninstallation aborted by user");
installer.setCancelled();
return;
} else {
for (var i = 0; i < 100; i++) {
sleep(100);
if (!installer.fileExists(appInstalledUninstallerPath)) {
break;
}
}
}
}
raiseInstallerWindow();
} else {
console.log("Request to quit from user");
installer.setCancelled();
return;
}
}
} else if (installer.isUninstaller()) {
isDesktopAppProcessRunningMessageLoop();
if (requestToQuitFromApp === true) {
requestToQuit(installer, gui);
return;
}
} else if (installer.isUpdater()) {
installer.setMessageBoxAutomaticAnswer("cancelInstallation", QMessageBox.No);
installer.installationFinished.connect(function() {
gui.clickButton(buttons.NextButton);
});
}
}
isDesktopAppProcessRunningMessageLoop = function ()
{
if (requestToQuitFromApp === true) {
return;
}
if (installer.isUpdater()) {
for (var i = 0; i < 400; i++) {
desktopAppProcessRunning = appProcessIsRunning();
if (!desktopAppProcessRunning) {
break;
}
}
}
desktopAppProcessRunning = appProcessIsRunning();
if (desktopAppProcessRunning) {
var result = QMessageBox.warning("QMessageBox", appName() + " installer",
appName() + " is active. Close the app and press \"Retry\" button to continue installation. Press \"Abort\" button to abort the installer and exit.",
QMessageBox.Retry | QMessageBox.Abort);
if (result === QMessageBox.Retry) {
isDesktopAppProcessRunningMessageLoop();
} else {
requestToQuitFromApp = true;
return;
}
}
}

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<Name>AmneziaVPN</Name>
<Version>1.0.0</Version>
<Title>AmneziaVPN</Title>
<Publisher>AmneziaVPN</Publisher>
<StartMenuDir>AmneziaVPN</StartMenuDir>
<TargetDir>/Applications/AmneziaVPN.app</TargetDir>
<WizardDefaultWidth>600</WizardDefaultWidth>
<WizardDefaultHeight>380</WizardDefaultHeight>
<WizardStyle>Modern</WizardStyle>
<RemoveTargetDir>true</RemoveTargetDir>
<AllowSpaceInPath>true</AllowSpaceInPath>
<AllowNonAsciiCharacters>false</AllowNonAsciiCharacters>
<ControlScript>controlscript.js</ControlScript>
<RepositorySettingsPageVisible>false</RepositorySettingsPageVisible>
<DependsOnLocalInstallerBinary>true</DependsOnLocalInstallerBinary>
<SupportsModify>false</SupportsModify>
<DisableAuthorizationFallback>true</DisableAuthorizationFallback>
<RemoteRepositories>
<Repository>
<Url>https://amneziavpn.org/updates/macos</Url>
<Enabled>true</Enabled>
<DisplayName>AmneziaVPN - repository for macOS</DisplayName>
</Repository>
</RemoteRepositories>
</Installer>

View file

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<Name>AmneziaVPN</Name>
<Version>1.0.0</Version>
<Title>AmneziaVPN</Title>
<Publisher>AmneziaVPN</Publisher>
<StartMenuDir>AmneziaVPN</StartMenuDir>
<TargetDir>@ApplicationsDir@/AmneziaVPN</TargetDir>
<WizardDefaultWidth>600</WizardDefaultWidth>
<WizardDefaultHeight>380</WizardDefaultHeight>
<WizardStyle>Modern</WizardStyle>
<RemoveTargetDir>true</RemoveTargetDir>
<AllowSpaceInPath>true</AllowSpaceInPath>
<AllowNonAsciiCharacters>false</AllowNonAsciiCharacters>
<ControlScript>controlscript.js</ControlScript>
<RepositorySettingsPageVisible>false</RepositorySettingsPageVisible>
<DependsOnLocalInstallerBinary>true</DependsOnLocalInstallerBinary>
<SupportsModify>false</SupportsModify>
<DisableAuthorizationFallback>true</DisableAuthorizationFallback>
<RemoteRepositories>
<Repository>
<Url>https://amneziavpn.org/updates/windows</Url>
<Enabled>true</Enabled>
<DisplayName>AmneziaVPN - repository for Windows</DisplayName>
</Repository>
</RemoteRepositories>
</Installer>

View file

@ -0,0 +1,115 @@
function appName()
{
return installer.value("Name")
}
function serviceName()
{
return (appName() + "-service")
}
function appExecutableFileName()
{
if (runningOnWindows()) {
return appName() + ".exe";
} else {
return appName();
}
}
function runningOnWindows()
{
return (systemInfo.kernelType === "winnt");
}
function runningOnMacOS()
{
return (systemInfo.kernelType === "darwin");
}
function vcRuntimeIsInstalled()
{
return (installer.findPath("msvcp140.dll", [installer.value("RootDir")+ "\\Windows\\System32\\"]).length !== 0)
}
function Component()
{
component.loaded.connect(this, Component.prototype.componentLoaded);
installer.installationFinished.connect(this, Component.prototype.installationFinishedPageIsShown);
installer.finishButtonClicked.connect(this, Component.prototype.installationFinished);
}
Component.prototype.componentLoaded = function ()
{
}
Component.prototype.installationFinishedPageIsShown = function()
{
if (installer.isInstaller() && installer.status === QInstaller.Success) {
gui.clickButton(buttons.FinishButton);
}
}
Component.prototype.createOperations = function()
{
component.createOperations();
if (runningOnWindows()) {
component.addOperation("CreateShortcut", "@TargetDir@/" + appExecutableFileName(),
QDesktopServices.storageLocation(QDesktopServices.DesktopLocation) + "/" + appName() + ".lnk",
"workingDirectory=@TargetDir@", "iconPath=@TargetDir@\\" + appExecutableFileName(), "iconId=0");
component.addElevatedOperation("CreateShortcut", "@TargetDir@/" + appExecutableFileName(),
installer.value("AllUsersStartMenuProgramsPath") + "/" + appName() + ".lnk",
"workingDirectory=@TargetDir@", "iconPath=@TargetDir@\\" + appExecutableFileName(), "iconId=0");
if (!vcRuntimeIsInstalled()) {
component.addElevatedOperation("Execute", "@TargetDir@\\" + "vc_redist.x86.exe", "/install", "/quiet", "/norestart", "/log", "vc_redist_2017_x86.log");
} else {
console.log("Microsoft Visual C++ 2017 Redistributable already installed");
}
component.addElevatedOperation("Execute",
["sc", "create", serviceName(), "binpath=", installer.value("TargetDir").replace(/\//g, '\\') + "\\" + serviceName() + ".exe",
"start=", "auto", "depend=", "BFE/nsi"],
"UNDOEXECUTE", ["post-uninstall.exe"]);
} else if (runningOnMacOS()) {
component.addElevatedOperation("Execute", "@TargetDir@/post_install.sh", "UNDOEXECUTE", "@TargetDir@/post_uninstall.sh");
}
}
Component.prototype.installationFinished = function()
{
var command = "";
var args = [];
if ((installer.status === QInstaller.Success) && (installer.isInstaller() || installer.isUpdater())) {
if (!installer.gainAdminRights()) {
console.log("Fatal error! Cannot get admin rights!")
return
}
if (runningOnWindows()) {
command = "@TargetDir@/" + appExecutableFileName()
var status1 = installer.execute("net", ["start", serviceName()])
console.log(("%1 started with status: %2 ").arg(serviceName()).arg(status1))
var status2 = installer.execute("sc", ["failure", serviceName(), "reset=", "100", "actions=", "restart/2000/restart/2000/restart/2000"])
console.log(("Changed settings for %1 with status: %2 ").arg(serviceName()).arg(status2))
} else if (runningOnMacOS()) {
command = "/Applications/" + appName() + ".app/Contents/MacOS/" + appName();
}
installer.dropAdminRights()
processStatus = installer.executeDetached(command, args, installer.value("TargetDir"));
}
}

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<Package>
<DisplayName>AmneziaVPN</DisplayName>
<Description>Installation package for AmneziaVPN</Description>
<Version>1.0.0</Version>
<ReleaseDate>1970-01-01</ReleaseDate>
<Default>true</Default>
<ForcedInstallation>true</ForcedInstallation>
<RequiresAdminRights>true</RequiresAdminRights>
<Script>componentscript.js</Script>
</Package>

58
deploy/macos.sh Normal file
View file

@ -0,0 +1,58 @@
#!/bin/bash -ex
QT_BIN_DIR='/Users/admin/Qt/5.14.2/clang_64/bin'
QIF_BIN_DIR='/Users/admin/Qt/Tools/QtInstallerFramework/4.0/bin'
APP_NAME=AmneziaVPN
APP_FILENAME=$APP_NAME.app
APP_DOMAIN=org.amneziavpn.package
PLIST_NAME=$APP_NAME.plist
LAUNCH_DIR=$(pwd)
TOP_DIR=$LAUNCH_DIR/..
RELEASE_DIR=$TOP_DIR/../$APP_NAME-build
OUT_APP_DIR=$RELEASE_DIR/client/release
BUNDLE_DIR=$OUT_APP_DIR/$APP_FILENAME
DEPLOY_DATA_DIR=$LAUNCH_DIR/data/macos
INSTALLER_DATA_DIR=$RELEASE_DIR/installer/packages/$APP_DOMAIN/data
PRO_FILE_PATH=$TOP_DIR/$APP_NAME.pro
QMAKE_STASH_FILE=$TOP_DIR/.qmake_stash
TARGET_FILENAME=$TOP_DIR/$APP_NAME.dmg
cleanBuild()
{
rm -rf $RELEASE_DIR
rm -rf $QMAKE_STASH_FILE
}
cleanBuild
cd $TOP_DIR
$QT_BIN_DIR/qmake $PRO_FILE_PATH 'CONFIG+=release CONFIG+=x86_64'
make -j `sysctl -n hw.ncpu`
$QT_BIN_DIR/macdeployqt $OUT_APP_DIR/$APP_FILENAME -always-overwrite
cp -av $RELEASE_DIR/server/release/$APP_NAME-service.app/Contents/macOS/$APP_NAME-service $BUNDLE_DIR/Contents/macOS
cp -av $LAUNCH_DIR/data/macos/openvpn $BUNDLE_DIR/Contents/macOS
mkdir -p $INSTALLER_DATA_DIR
cp -av $LAUNCH_DIR/installer $RELEASE_DIR
cp -av $DEPLOY_DATA_DIR/post_install.sh $INSTALLER_DATA_DIR/post_install.sh
cp -av $DEPLOY_DATA_DIR/post_uninstall.sh $INSTALLER_DATA_DIR/post_uninstall.sh
cp -av $DEPLOY_DATA_DIR/$PLIST_NAME $INSTALLER_DATA_DIR/$PLIST_NAME
cd $BUNDLE_DIR
tar czf $INSTALLER_DATA_DIR/$APP_NAME.tar.gz ./
cd $RELEASE_DIR/installer
$QIF_BIN_DIR/binarycreator --offline-only -v -c config/macos.xml -p packages -f $APP_NAME
hdiutil create -volname $APP_NAME -srcfolder $APP_NAME.app -ov -format UDZO $TARGET_FILENAME
cleanBuild
cd $LAUNCH_DIR
echo "Finished, see $APP_NAME.dmg in '$TOP_DIR'"

Binary file not shown.

1
deploy/windows-env.bat Normal file
View file

@ -0,0 +1 @@
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsDevCmd.bat"

71
deploy/windows.bat Normal file
View file

@ -0,0 +1,71 @@
@ECHO OFF
CHCP 1252
SET QT_BIN_DIR="c:\Devel\Qt\5.14.2\msvc2017\bin"
SET QIF_BIN_DIR="c:\Devel\Qt\Tools\QtInstallerFramework\4.0\bin"
set APP_NAME=AmneziaVPN
set APP_FILENAME=%APP_NAME:"=%.exe
set APP_DOMAIN=org.amneziavpn.package
set LAUNCH_DIR=%cd%
set TOP_DIR=%LAUNCH_DIR:"=%\..
set RELEASE_DIR=%TOP_DIR:"=%\..\%APP_NAME:"=%-build
set OUT_APP_DIR=%RELEASE_DIR:"=%\client\release
set DEPLOY_DATA_DIR=%LAUNCH_DIR:"=%\data\windows
set INSTALLER_DATA_DIR=%RELEASE_DIR:"=%\installer\packages\%APP_DOMAIN:"=%\data
set PRO_FILE_PATH=%TOP_DIR:"=%\%APP_NAME:"=%.pro
set QMAKE_STASH_FILE=%TOP_DIR:"=%\.qmake_stash
set TARGET_FILENAME=%TOP_DIR:"=%\%APP_NAME:"=%.exe
echo "Environment:"
echo "APP_FILENAME: %APP_FILENAME%"
echo "LAUNCH_DIR: %LAUNCH_DIR%"
echo "TOP_DIR: %TOP_DIR%"
echo "RELEASE_DIR: %RELEASE_DIR%"
echo "OUT_APP_DIR: %OUT_APP_DIR%"
echo "DEPLOY_DATA_DIR: %DEPLOY_DATA_DIR%"
echo "INSTALLER_DATA_DIR: %INSTALLER_DATA_DIR%"
echo "PRO_FILE_PATH: %PRO_FILE_PATH%"
echo "QMAKE_STASH_FILE: %QMAKE_STASH_FILE%"
echo "TARGET_FILENAME: %TARGET_FILENAME%"
echo "Cleanup..."
Rmdir /Q /S %RELEASE_DIR%
Del %QMAKE_STASH_FILE%
Del %TARGET_FILENAME%
cd %TOP_DIR%
"%QT_BIN_DIR:"=%\qmake" %PRO_FILE_PATH% -spec win32-msvc
set CL=/MP
nmake /A /NOLOGO
del "%OUT_APP_DIR:"=%\*.obj"
del "%OUT_APP_DIR:"=%\*.cpp"
del "%OUT_APP_DIR:"=%\*.h"
del "%OUT_APP_DIR:"=%\*.res"
del "%OUT_APP_DIR:"=%\*.o"
del "%OUT_APP_DIR:"=%\*.lib"
del "%OUT_APP_DIR:"=%\*.exp"
echo "Deploying..."
"%QT_BIN_DIR:"=%\windeployqt" --release --force --no-translations "%OUT_APP_DIR:"=%\%APP_FILENAME:"=%"
echo "Copying deploy data..."
xcopy %DEPLOY_DATA_DIR% %OUT_APP_DIR% /s /e /y /i /f
copy "%RELEASE_DIR:"=%\server\release\%APP_NAME:"=%-service.exe" %OUT_APP_DIR%
copy "%RELEASE_DIR:"=%\post-uninstall\release\post-uninstall.exe" %OUT_APP_DIR%
cd %LAUNCH_DIR%
xcopy %LAUNCH_DIR:"=%\installer %RELEASE_DIR:"=%\installer /s /e /y /i /f
mkdir %INSTALLER_DATA_DIR%
cd %OUT_APP_DIR%
echo "Compressing data..."
"%QIF_BIN_DIR:"=%\archivegen" -c 9 %INSTALLER_DATA_DIR:"=%\%APP_NAME:"=%.7z ./
cd "%RELEASE_DIR:"=%\installer"
echo "Creating installer..."
"%QIF_BIN_DIR:"=%\binarycreator" --offline-only -v -c config\windows.xml -p packages -f %TARGET_FILENAME%
cd %LAUNCH_DIR%
echo "Finished, see %TARGET_FILENAME%"

View file

@ -1,191 +0,0 @@
; ****************************************************************************
; * Copyright (C) 2002-2014 OpenVPN Technologies, Inc. *
; * This program is free software; you can redistribute it and/or modify *
; * it under the terms of the GNU General Public License version 2 *
; * as published by the Free Software Foundation. *
; ****************************************************************************
; SYNTAX CHECKER
; cd \WINDDK\3790\tools\chkinf
; chkinf c:\src\openvpn\tap-win32\i386\oemvista.inf
; OUTPUT -> file:///c:/WINDDK/3790/tools/chkinf/htm/c%23+src+openvpn+tap-win32+i386+__OemWin2k.htm
; INSTALL/REMOVE DRIVER
; tapinstall install OemVista.inf tapoas
; tapinstall update OemVista.inf tapoas
; tapinstall remove tapoas
;*********************************************************
; Note to Developers:
;
; If you are bundling the TAP-Windows driver with your app,
; you should try to rename it in such a way that it will
; not collide with other instances of TAP-Windows defined
; by other apps. Multiple versions of the TAP-Windows
; driver, each installed by different apps, can coexist
; on the same machine if you follow these guidelines.
; NOTE: these instructions assume you are editing the
; generated OemWin2k.inf file, not the source
; OemWin2k.inf.in file which is preprocessed by winconfig
; and uses macro definitions from settings.in.
;
; (1) Rename all tapXXXX instances in this file to
; something different (use at least 5 characters
; for this name!)
; (2) Change the "!define TAP" definition in openvpn.nsi
; to match what you changed tapXXXX to.
; (3) Change TARGETNAME in SOURCES to match what you
; changed tapXXXX to.
; (4) Change TAP_COMPONENT_ID in common.h to match what
; you changed tapXXXX to.
; (5) Change SZDEPENDENCIES in service.h to match what
; you changed tapXXXX to.
; (6) Change DeviceDescription and Provider strings.
; (7) Change PRODUCT_TAP_WIN_DEVICE_DESCRIPTION in constants.h to what you
; set DeviceDescription to.
;
;*********************************************************
[Version]
Signature = "$Windows NT$"
CatalogFile = tap0901.cat
ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318}
Provider = %Provider%
Class = Net
; This version number should match the version
; number given in ..\version.m4.
DriverVer = 09/27/2019,9.24.2.601
[Strings]
DeviceDescription = "TAP-Windows Adapter V9"
Provider = "TAP-Windows Provider V9"
;----------------------------------------------------------------
; Manufacturer + Product Section (Done)
;----------------------------------------------------------------
[Manufacturer]
%Provider% = tap0901, NTARM64
[tap0901.NTARM64]
%DeviceDescription% = tap0901.ndi, root\tap0901 ; Root enumerated
%DeviceDescription% = tap0901.ndi, tap0901 ; Legacy
;---------------------------------------------------------------
; Driver Section (Done)
;---------------------------------------------------------------
;----------------- Characteristics ------------
; NCF_PHYSICAL = 0x04
; NCF_VIRTUAL = 0x01
; NCF_SOFTWARE_ENUMERATED = 0x02
; NCF_HIDDEN = 0x08
; NCF_NO_SERVICE = 0x10
; NCF_HAS_UI = 0x80
;----------------- Characteristics ------------
[tap0901.ndi]
CopyFiles = tap0901.driver, tap0901.files
AddReg = tap0901.reg
AddReg = tap0901.params.reg
Characteristics = 0x1
*IfType = 53 ; IF_TYPE_PROP_VIRTUAL
*MediaType = 0x0 ; NdisMedium802_3
*PhysicalMediaType = 0 ; NdisPhysicalMediumUnspecified
[tap0901.ndi.Services]
AddService = tap0901, 2, tap0901.service
[tap0901.reg]
HKR, Ndi, Service, 0, "tap0901"
HKR, Ndi\Interfaces, UpperRange, 0, "ndis5"
HKR, Ndi\Interfaces, LowerRange, 0, "ethernet"
HKR, , Manufacturer, 0, "%Provider%"
HKR, , ProductName, 0, "%DeviceDescription%"
[tap0901.params.reg]
HKR, Ndi\params\MTU, ParamDesc, 0, "MTU"
HKR, Ndi\params\MTU, Type, 0, "int"
HKR, Ndi\params\MTU, Default, 0, "1500"
HKR, Ndi\params\MTU, Optional, 0, "0"
HKR, Ndi\params\MTU, Min, 0, "100"
HKR, Ndi\params\MTU, Max, 0, "1500"
HKR, Ndi\params\MTU, Step, 0, "1"
HKR, Ndi\params\MediaStatus, ParamDesc, 0, "Media Status"
HKR, Ndi\params\MediaStatus, Type, 0, "enum"
HKR, Ndi\params\MediaStatus, Default, 0, "0"
HKR, Ndi\params\MediaStatus, Optional, 0, "0"
HKR, Ndi\params\MediaStatus\enum, "0", 0, "Application Controlled"
HKR, Ndi\params\MediaStatus\enum, "1", 0, "Always Connected"
HKR, Ndi\params\MAC, ParamDesc, 0, "MAC Address"
HKR, Ndi\params\MAC, Type, 0, "edit"
HKR, Ndi\params\MAC, Optional, 0, "1"
HKR, Ndi\params\AllowNonAdmin, ParamDesc, 0, "Non-Admin Access"
HKR, Ndi\params\AllowNonAdmin, Type, 0, "enum"
HKR, Ndi\params\AllowNonAdmin, Default, 0, "1"
HKR, Ndi\params\AllowNonAdmin, Optional, 0, "0"
HKR, Ndi\params\AllowNonAdmin\enum, "0", 0, "Not Allowed"
HKR, Ndi\params\AllowNonAdmin\enum, "1", 0, "Allowed"
;----------------------------------------------------------------
; Service Section
;----------------------------------------------------------------
;---------- Service Type -------------
; SERVICE_KERNEL_DRIVER = 0x01
; SERVICE_WIN32_OWN_PROCESS = 0x10
;---------- Service Type -------------
;---------- Start Mode ---------------
; SERVICE_BOOT_START = 0x0
; SERVICE_SYSTEM_START = 0x1
; SERVICE_AUTO_START = 0x2
; SERVICE_DEMAND_START = 0x3
; SERVICE_DISABLED = 0x4
;---------- Start Mode ---------------
[tap0901.service]
DisplayName = %DeviceDescription%
ServiceType = 1
StartType = 3
ErrorControl = 1
LoadOrderGroup = NDIS
ServiceBinary = %12%\tap0901.sys
;-----------------------------------------------------------------
; File Installation
;-----------------------------------------------------------------
;----------------- Copy Flags ------------
; COPYFLG_NOSKIP = 0x02
; COPYFLG_NOVERSIONCHECK = 0x04
;----------------- Copy Flags ------------
; SourceDisksNames
; diskid = description[, [tagfile] [, <unused>, subdir]]
; 1 = "Intel Driver Disk 1",e100bex.sys,,
[SourceDisksNames]
1 = %DeviceDescription%, tap0901.sys
; SourceDisksFiles
; filename_on_source = diskID[, [subdir][, size]]
; e100bex.sys = 1,, ; on distribution disk 1
[SourceDisksFiles]
tap0901.sys = 1
[DestinationDirs]
tap0901.files = 11
tap0901.driver = 12
[tap0901.files]
; TapPanel.cpl,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
; cipsrvr.exe,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
[tap0901.driver]
tap0901.sys,,,6 ; COPYFLG_NOSKIP | COPYFLG_NOVERSIONCHECK
;---------------------------------------------------------------
; End
;---------------------------------------------------------------

Binary file not shown.

Binary file not shown.

View file

@ -1,82 +0,0 @@
/*
* TAP-Windows -- A kernel driver to provide virtual tap
* device functionality on Windows.
*
* This code was inspired by the CIPE-Win32 driver by Damion K. Wilson.
*
* This source code is Copyright (C) 2002-2014 OpenVPN Technologies, Inc.,
* and is released under the GPL version 2 (see below). This particular file
* (tap-windows.h) is also licensed using the MIT license (see COPYRIGHT.MIT).
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* This program 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 this program (see the file COPYING included with this
* distribution); if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __TAP_WIN_H
#define __TAP_WIN_H
/*
* =============
* TAP IOCTLs
* =============
*/
#define TAP_WIN_CONTROL_CODE(request,method) \
CTL_CODE (FILE_DEVICE_UNKNOWN, request, method, FILE_ANY_ACCESS)
/* Present in 8.1 */
#define TAP_WIN_IOCTL_GET_MAC TAP_WIN_CONTROL_CODE (1, METHOD_BUFFERED)
#define TAP_WIN_IOCTL_GET_VERSION TAP_WIN_CONTROL_CODE (2, METHOD_BUFFERED)
#define TAP_WIN_IOCTL_GET_MTU TAP_WIN_CONTROL_CODE (3, METHOD_BUFFERED)
#define TAP_WIN_IOCTL_GET_INFO TAP_WIN_CONTROL_CODE (4, METHOD_BUFFERED)
#define TAP_WIN_IOCTL_CONFIG_POINT_TO_POINT TAP_WIN_CONTROL_CODE (5, METHOD_BUFFERED)
#define TAP_WIN_IOCTL_SET_MEDIA_STATUS TAP_WIN_CONTROL_CODE (6, METHOD_BUFFERED)
#define TAP_WIN_IOCTL_CONFIG_DHCP_MASQ TAP_WIN_CONTROL_CODE (7, METHOD_BUFFERED)
#define TAP_WIN_IOCTL_GET_LOG_LINE TAP_WIN_CONTROL_CODE (8, METHOD_BUFFERED)
#define TAP_WIN_IOCTL_CONFIG_DHCP_SET_OPT TAP_WIN_CONTROL_CODE (9, METHOD_BUFFERED)
/* Added in 8.2 */
/* obsoletes TAP_WIN_IOCTL_CONFIG_POINT_TO_POINT */
#define TAP_WIN_IOCTL_CONFIG_TUN TAP_WIN_CONTROL_CODE (10, METHOD_BUFFERED)
/* Control whether 802.1Q headers are added for priority */
#define TAP_WIN_IOCTL_PRIORITY_BEHAVIOR TAP_WIN_CONTROL_CODE (11, METHOD_BUFFERED)
#define TAP_PRIORITY_BEHAVIOR_NOPRIORITY 0
#define TAP_PRIORITY_BEHAVIOR_ENABLED 1
#define TAP_PRIORITY_BEHAVIOR_ADDALWAYS 2
#define TAP_PRIORITY_BEHAVIOR_MAX 2
/*
* =================
* Registry keys
* =================
*/
#define ADAPTER_KEY "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
#define NETWORK_CONNECTIONS_KEY "SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
/*
* ======================
* Filesystem prefixes
* ======================
*/
#define USERMODEDEVICEDIR "\\\\.\\Global\\"
#define SYSDEVICEDIR "\\Device\\"
#define USERDEVICEDIR "\\DosDevices\\Global\\"
#define TAP_WIN_SUFFIX ".tap"
#endif // __TAP_WIN_H