mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
added the ability to work with an online repository
* added a command line argument for the application, when called, cached profiles will be cleared
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ClearProfilesCheckboxForm</class>
|
||||
<widget class="QWidget" name="ClearProfilesCheckboxForm">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="ClearProfilesCheckbox">
|
||||
<property name="text">
|
||||
<string>Clear client cached profiles</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -47,7 +47,11 @@ function Component()
|
||||
|
||||
Component.prototype.componentLoaded = function ()
|
||||
{
|
||||
|
||||
console.log("123");
|
||||
// if (installer.isPackageManager()) {
|
||||
installer.addWizardPageItem( component, "ClearProfilesCheckboxForm", QInstaller.ComponentSelection );
|
||||
console.log("333");
|
||||
// }
|
||||
}
|
||||
|
||||
Component.prototype.installationFinishedPageIsShown = function()
|
||||
@@ -62,7 +66,6 @@ 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");
|
||||
@@ -100,7 +103,6 @@ Component.prototype.createOperations = function()
|
||||
Component.prototype.installationFinished = function()
|
||||
{
|
||||
var command = "";
|
||||
var args = [];
|
||||
|
||||
if ((installer.status === QInstaller.Success) && (installer.isInstaller() || installer.isUpdater())) {
|
||||
|
||||
@@ -121,11 +123,21 @@ Component.prototype.installationFinished = function()
|
||||
} else if (runningOnMacOS()) {
|
||||
command = "/Applications/" + appName() + ".app/Contents/MacOS/" + appName();
|
||||
} else if (runningOnLinux()) {
|
||||
command = "@TargetDir@/client/" + appName();
|
||||
}
|
||||
command = "@TargetDir@/client/" + appName();
|
||||
}
|
||||
|
||||
installer.dropAdminRights()
|
||||
|
||||
if (installer.isUninstaller() || installer.isUpdater()) {
|
||||
var checkboxForm = component.userInterface( "ClearProfilesCheckboxForm" );
|
||||
if (checkboxForm && checkboxForm.ClearProfilesCheckbox.checked) {
|
||||
var args = ["--clearProfiles"];
|
||||
processStatus = installer.execute(command, args, installer.value("TargetDir"));
|
||||
}
|
||||
}
|
||||
|
||||
var args = [];
|
||||
processStatus = installer.executeDetached(command, args, installer.value("TargetDir"));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,7 @@
|
||||
<ForcedInstallation>true</ForcedInstallation>
|
||||
<RequiresAdminRights>true</RequiresAdminRights>
|
||||
<Script>componentscript.js</Script>
|
||||
<UserInterfaces>
|
||||
<UserInterface>clearProfilesCheckboxForm.ui</UserInterface>
|
||||
</UserInterfaces>
|
||||
</Package>
|
||||
|
||||
Reference in New Issue
Block a user