mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-15 01:01:26 +00:00
Compare commits
3 Commits
1.20.0-alp
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
472b10a8a4 | ||
|
|
2fe7fe886c | ||
|
|
cd9e315447 |
5
dist/win/contrib/patchWebDAV.bat
vendored
5
dist/win/contrib/patchWebDAV.bat
vendored
@@ -4,15 +4,18 @@
|
||||
:: This file must be located in the INSTALLDIR
|
||||
|
||||
set "LOOPBACK_ALIAS=%1"
|
||||
set "ACTION=%2"
|
||||
if "%ACTION%"=="" set "ACTION=install"
|
||||
|
||||
:: Log for debugging
|
||||
echo LOOPBACK_ALIAS=%LOOPBACK_ALIAS%
|
||||
echo ACTION=%ACTION%
|
||||
|
||||
:: Change to INSTALLDIR
|
||||
cd %~dp0
|
||||
:: Execute the PowerShell script
|
||||
powershell -NoLogo -NoProfile -NonInteractive -ExecutionPolicy RemoteSigned -File .\patchWebDAV.ps1^
|
||||
-LoopbackAlias %LOOPBACK_ALIAS%
|
||||
-LoopbackAlias %LOOPBACK_ALIAS% -Action %ACTION%
|
||||
|
||||
:: Return the exit code from PowerShell
|
||||
exit /b %ERRORLEVEL%
|
||||
47
dist/win/contrib/patchWebDAV.ps1
vendored
47
dist/win/contrib/patchWebDAV.ps1
vendored
@@ -1,15 +1,17 @@
|
||||
#Requires -RunAsAdministrator
|
||||
Param(
|
||||
[Parameter(Mandatory, HelpMessage="Please provide an alias for 127.0.0.1")][string] $LoopbackAlias
|
||||
[Parameter(Mandatory, HelpMessage="Please provide an alias for 127.0.0.1")][string] $LoopbackAlias,
|
||||
[string] $Action = "install"
|
||||
)
|
||||
|
||||
New-Variable -Name "sysdir" -Value ([Environment]::SystemDirectory) -Option Constant -Scope Global
|
||||
New-Variable -Name "hostsFile" -Value "$sysdir\drivers\etc\hosts" -Option Constant -Scope Global
|
||||
|
||||
# Adds an alias for 127.0.0.1 to the hosts file
|
||||
function Add-AliasToHost {
|
||||
param (
|
||||
[string]$LoopbackAlias
|
||||
)
|
||||
$sysdir = [Environment]::SystemDirectory
|
||||
$hostsFile = "$sysdir\drivers\etc\hosts"
|
||||
$aliasLine = "127.0.0.1 $LoopbackAlias"
|
||||
|
||||
foreach ($line in Get-Content $hostsFile) {
|
||||
@@ -18,9 +20,26 @@ function Add-AliasToHost {
|
||||
}
|
||||
}
|
||||
|
||||
Add-Content -Path $hostsFile -Encoding ascii -Value "`r`n$aliasLine"
|
||||
$content = Get-Content $hostsFile
|
||||
$content += "`r`n$aliasLine"
|
||||
|
||||
$content | Set-Content "$hostsFile.tmp" -Encoding ascii
|
||||
Move-Item "$hostsFile.tmp" $hostsFile -Force
|
||||
}
|
||||
|
||||
# Removes an alias for 127.0.0.1 from the hosts file
|
||||
function Remove-AliasFromHost {
|
||||
param (
|
||||
[string]$LoopbackAlias
|
||||
)
|
||||
$aliasLine = "127.0.0.1 $LoopbackAlias"
|
||||
|
||||
$content = Get-Content $hostsFile
|
||||
$newContent = $content | Where-Object { $_ -ne $aliasLine }
|
||||
|
||||
$newContent | Set-Content "$hostsFile.tmp" -Encoding ascii
|
||||
Move-Item "$hostsFile.tmp" $hostsFile -Force
|
||||
}
|
||||
|
||||
# Sets in the registry the webclient file size limit to the maximum value
|
||||
function Set-WebDAVFileSizeLimit {
|
||||
@@ -54,14 +73,20 @@ function Edit-ProviderOrder {
|
||||
New-ItemProperty -Path $RegistryPath -Name $Name -Value $UpdatedOrder -PropertyType String -Force | Out-Null
|
||||
}
|
||||
|
||||
if ($Action -eq "install") {
|
||||
Add-AliasToHost $LoopbackAlias
|
||||
Write-Output 'Ensured alias exists in hosts file'
|
||||
|
||||
Add-AliasToHost $LoopbackAlias
|
||||
Write-Output 'Ensured alias exists in hosts file'
|
||||
Set-WebDAVFileSizeLimit
|
||||
Write-Output 'Set WebDAV file size limit'
|
||||
|
||||
Set-WebDAVFileSizeLimit
|
||||
Write-Output 'Set WebDAV file size limit'
|
||||
|
||||
Edit-ProviderOrder
|
||||
Write-Output 'Ensured correct provider order'
|
||||
Edit-ProviderOrder
|
||||
Write-Output 'Ensured correct provider order'
|
||||
} elseif ($Action -eq "uninstall") {
|
||||
Remove-AliasFromHost $LoopbackAlias
|
||||
Write-Output 'Ensured alias removed from hosts file'
|
||||
} else {
|
||||
Write-Error "Invalid action: $Action. Only 'install' or 'uninstall' are valid."
|
||||
}
|
||||
|
||||
exit 0
|
||||
|
||||
11
dist/win/resources/main.wxs
vendored
11
dist/win/resources/main.wxs
vendored
@@ -158,9 +158,13 @@
|
||||
<ns0:CustomAction Id="DisableUserConfig" BinaryRef="Wix4UtilCA_$(sys.BUILDARCHSHORT)" DllEntry="WixQuietExec" Execute="deferred" Return="ignore" Impersonate="no"/>
|
||||
|
||||
<!-- WebDAV patches -->
|
||||
<ns0:SetProperty Id="PatchWebDAV" Value=""[INSTALLDIR]patchWebDAV.bat" "$(var.LoopbackAlias)"" Sequence="execute" Before="PatchWebDAV" />
|
||||
<ns0:SetProperty Id="PatchWebDAV" Value=""[INSTALLDIR]patchWebDAV.bat" "$(var.LoopbackAlias)" install" Sequence="execute" Before="PatchWebDAV" />
|
||||
<ns0:CustomAction Id="PatchWebDAV" BinaryRef="Wix4UtilCA_$(sys.BUILDARCHSHORT)" DllEntry="WixQuietExec" Execute="deferred" Return="ignore" Impersonate="no"/>
|
||||
|
||||
<!-- WebDAV patches (Uninstall) -->
|
||||
<ns0:SetProperty Id="PatchWebDAVUninstall" Value=""[INSTALLDIR]patchWebDAV.bat" "$(var.LoopbackAlias)" uninstall" Sequence="execute" Before="PatchWebDAVUninstall" />
|
||||
<ns0:CustomAction Id="PatchWebDAVUninstall" BinaryRef="Wix4UtilCA_$(sys.BUILDARCHSHORT)" DllEntry="WixQuietExec" Execute="deferred" Return="ignore" Impersonate="no"/>
|
||||
|
||||
<!-- Update check configuration -->
|
||||
<ns0:SetProperty Id="PatchUpdateCheck" Value=""[INSTALLDIR]patchUpdateCheck.bat" "[DISABLEUPDATECHECK]"" Sequence="execute" Before="PatchUpdateCheck" />
|
||||
<ns0:CustomAction Id="PatchUpdateCheck" BinaryRef="Wix4UtilCA_$(sys.BUILDARCHSHORT)" DllEntry="WixQuietExec64" Execute="deferred" Return="ignore" Impersonate="no"/>
|
||||
@@ -214,9 +218,8 @@
|
||||
|
||||
<ns0:RemoveExistingProducts After="InstallValidate"/> <!-- Moved from CostInitialize, due to Wix4CloseApplications_* -->
|
||||
<ns0:Custom Action="DisableUserConfig" After="InstallFiles" Condition="NOT (Installed AND (NOT REINSTALL) AND (NOT UPGRADINGPRODUCTCODE) AND REMOVE)"/>
|
||||
<!-- Skip action on uninstall -->
|
||||
<!-- TODO: don't skip action, but remove cryptomator alias from hosts file -->
|
||||
<ns0:Custom Action="PatchWebDAV" After="DisableUserConfig" Condition="NOT (Installed AND (NOT REINSTALL) AND (NOT UPGRADINGPRODUCTCODE) AND REMOVE)"/>
|
||||
<ns0:Custom Action="PatchWebDAVUninstall" Before="RemoveFiles" Condition="Installed AND (NOT REINSTALL) AND (NOT UPGRADINGPRODUCTCODE) AND REMOVE" />
|
||||
<!-- Configure update check setting if property is provided -->
|
||||
<ns0:Custom Action="PatchUpdateCheck" After="PatchWebDAV" Condition="DISABLEUPDATECHECK AND NOT (Installed AND (NOT REINSTALL) AND (NOT UPGRADINGPRODUCTCODE) AND REMOVE)"/>
|
||||
</ns0:InstallExecuteSequence>
|
||||
@@ -228,4 +231,4 @@
|
||||
<ns0:WixVariable Id="WixUIBannerBmp" Value="$(env.JP_WIXWIZARD_RESOURCES)\banner.bmp" />
|
||||
<ns0:WixVariable Id="WixUIDialogBmp" Value="$(env.JP_WIXWIZARD_RESOURCES)\background.bmp" />
|
||||
</ns0:Package>
|
||||
</ns0:Wix>
|
||||
</ns0:Wix>
|
||||
@@ -9,90 +9,94 @@
|
||||
<?import javafx.scene.control.Hyperlink?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.RadioButton?>
|
||||
<?import javafx.scene.control.ScrollPane?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.control.ToggleGroup?>
|
||||
<?import javafx.scene.control.Tooltip?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<VBox xmlns:fx="http://javafx.com/fxml"
|
||||
xmlns="http://javafx.com/javafx"
|
||||
fx:controller="org.cryptomator.ui.vaultoptions.MountOptionsController"
|
||||
spacing="6">
|
||||
<fx:define>
|
||||
<ToggleGroup fx:id="mountPointToggleGroup"/>
|
||||
</fx:define>
|
||||
<padding>
|
||||
<Insets topRightBottomLeft="12"/>
|
||||
</padding>
|
||||
<children>
|
||||
<HBox spacing="12" alignment="CENTER_LEFT">
|
||||
<Label text="%vaultOptions.mount.volume.type" labelFor="$vaultVolumeTypeChoiceBox"/>
|
||||
<ChoiceBox fx:id="vaultVolumeTypeChoiceBox"/>
|
||||
<Hyperlink contentDisplay="GRAPHIC_ONLY" onAction="#openVolumePreferences" visible="${controller.defaultMountServiceSelected}" managed="${controller.defaultMountServiceSelected}" accessibleText="%vaultOptions.mount.info">
|
||||
<graphic>
|
||||
<FontAwesome5IconView glyph="COGS" styleClass="glyph-icon-muted"/>
|
||||
</graphic>
|
||||
<tooltip>
|
||||
<Tooltip text="%vaultOptions.mount.info" showDelay="100ms"/>
|
||||
</tooltip>
|
||||
</Hyperlink>
|
||||
<Hyperlink contentDisplay="GRAPHIC_ONLY" onAction="#openDocs" visible="${!controller.defaultMountServiceSelected}" managed="${!controller.defaultMountServiceSelected}" accessibleText="%preferences.volume.docsTooltip">
|
||||
<graphic>
|
||||
<FontAwesome5IconView glyph="QUESTION_CIRCLE" styleClass="glyph-icon-muted"/>
|
||||
</graphic>
|
||||
<tooltip>
|
||||
<Tooltip text="%preferences.volume.docsTooltip" showDelay="100ms"/>
|
||||
</tooltip>
|
||||
</Hyperlink>
|
||||
</HBox>
|
||||
|
||||
<Label styleClass="label-red" text="%vaultOptions.mount.volumeType.restartRequired" visible="${controller.selectedMountServiceRequiresRestart}" managed="${controller.selectedMountServiceRequiresRestart}"/>
|
||||
|
||||
<HBox spacing="12" alignment="CENTER_LEFT" visible="${controller.loopbackPortChangeable}" managed="${controller.loopbackPortChangeable}">
|
||||
<Label text="%vaultOptions.mount.volume.tcp.port" labelFor="$vaultLoopbackPortField"/>
|
||||
<NumericTextField fx:id="vaultLoopbackPortField"/>
|
||||
<Button text="%generic.button.apply" fx:id="vaultLoopbackPortApplyButton" onAction="#doChangeLoopbackPort"/>
|
||||
</HBox>
|
||||
|
||||
<CheckBox fx:id="readOnlyCheckbox" text="%vaultOptions.mount.readonly" visible="${controller.readOnlyOptionAllowed}" managed="${controller.readOnlyOptionAllowed}"/>
|
||||
|
||||
<VBox visible="${controller.mountFlagsSupported}" managed="${controller.mountFlagsSupported}">
|
||||
<CheckBox fx:id="customMountFlagsCheckbox" text="%vaultOptions.mount.customMountFlags" onAction="#toggleUseCustomMountFlags"/>
|
||||
<TextField fx:id="mountFlagsField" HBox.hgrow="ALWAYS" maxWidth="Infinity" accessibleText="%vaultOptions.mount.customMountFlags">
|
||||
<VBox.margin>
|
||||
<Insets left="24"/>
|
||||
</VBox.margin>
|
||||
</TextField>
|
||||
</VBox>
|
||||
|
||||
<Label text="%vaultOptions.mount.mountPoint">
|
||||
<VBox.margin>
|
||||
<Insets top="9"/>
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
|
||||
<RadioButton toggleGroup="${mountPointToggleGroup}" fx:id="mountPointAutoBtn" text="%vaultOptions.mount.mountPoint.auto"/>
|
||||
|
||||
<HBox spacing="6" visible="${controller.mountpointDriveLetterSupported}" managed="${controller.mountpointDriveLetterSupported}">
|
||||
<RadioButton toggleGroup="${mountPointToggleGroup}" fx:id="mountPointDriveLetterBtn" text="%vaultOptions.mount.mountPoint.driveLetter"/>
|
||||
<ChoiceBox fx:id="driveLetterSelection" disable="${!mountPointDriveLetterBtn.selected}" accessibleText="%vaultOptions.mount.mountPoint.driveLetter"/>
|
||||
</HBox>
|
||||
|
||||
<VBox spacing="6" visible="${controller.mountpointDirSupported}" managed="${controller.mountpointDirSupported}">
|
||||
<HBox spacing="6" alignment="CENTER_LEFT">
|
||||
<RadioButton toggleGroup="${mountPointToggleGroup}" fx:id="mountPointDirBtn" text="%vaultOptions.mount.mountPoint.custom"/>
|
||||
<Button text="%vaultOptions.mount.mountPoint.directoryPickerButton" onAction="#chooseCustomMountPoint" contentDisplay="LEFT" disable="${!mountPointDirBtn.selected}">
|
||||
<ScrollPane xmlns:fx="http://javafx.com/fxml"
|
||||
xmlns="http://javafx.com/javafx"
|
||||
fx:controller="org.cryptomator.ui.vaultoptions.MountOptionsController"
|
||||
fitToWidth="true"
|
||||
hbarPolicy="NEVER">
|
||||
<VBox spacing="6">
|
||||
<fx:define>
|
||||
<ToggleGroup fx:id="mountPointToggleGroup"/>
|
||||
</fx:define>
|
||||
<padding>
|
||||
<Insets topRightBottomLeft="12"/>
|
||||
</padding>
|
||||
<children>
|
||||
<HBox spacing="12" alignment="CENTER_LEFT">
|
||||
<Label text="%vaultOptions.mount.volume.type" labelFor="$vaultVolumeTypeChoiceBox"/>
|
||||
<ChoiceBox fx:id="vaultVolumeTypeChoiceBox"/>
|
||||
<Hyperlink contentDisplay="GRAPHIC_ONLY" onAction="#openVolumePreferences" visible="${controller.defaultMountServiceSelected}" managed="${controller.defaultMountServiceSelected}" accessibleText="%vaultOptions.mount.info">
|
||||
<graphic>
|
||||
<FontAwesome5IconView glyph="FOLDER_OPEN" glyphSize="15"/>
|
||||
<FontAwesome5IconView glyph="COGS" styleClass="glyph-icon-muted"/>
|
||||
</graphic>
|
||||
</Button>
|
||||
<tooltip>
|
||||
<Tooltip text="%vaultOptions.mount.info" showDelay="100ms"/>
|
||||
</tooltip>
|
||||
</Hyperlink>
|
||||
<Hyperlink contentDisplay="GRAPHIC_ONLY" onAction="#openDocs" visible="${!controller.defaultMountServiceSelected}" managed="${!controller.defaultMountServiceSelected}" accessibleText="%preferences.volume.docsTooltip">
|
||||
<graphic>
|
||||
<FontAwesome5IconView glyph="QUESTION_CIRCLE" styleClass="glyph-icon-muted"/>
|
||||
</graphic>
|
||||
<tooltip>
|
||||
<Tooltip text="%preferences.volume.docsTooltip" showDelay="100ms"/>
|
||||
</tooltip>
|
||||
</Hyperlink>
|
||||
</HBox>
|
||||
<TextField fx:id="directoryPathField" text="${controller.directoryPath}" visible="${mountPointDirBtn.selected}" managed="${mountPointDirBtn.managed}" maxWidth="Infinity" editable="false" accessibleText="%vaultOptions.mount.mountPoint.custom">
|
||||
<VBox.margin>
|
||||
<Insets left="24"/>
|
||||
</VBox.margin>
|
||||
</TextField>
|
||||
</VBox>
|
||||
</children>
|
||||
|
||||
</VBox>
|
||||
<Label styleClass="label-red" text="%vaultOptions.mount.volumeType.restartRequired" visible="${controller.selectedMountServiceRequiresRestart}" managed="${controller.selectedMountServiceRequiresRestart}"/>
|
||||
|
||||
<HBox spacing="12" alignment="CENTER_LEFT" visible="${controller.loopbackPortChangeable}" managed="${controller.loopbackPortChangeable}">
|
||||
<Label text="%vaultOptions.mount.volume.tcp.port" labelFor="$vaultLoopbackPortField"/>
|
||||
<NumericTextField fx:id="vaultLoopbackPortField"/>
|
||||
<Button text="%generic.button.apply" fx:id="vaultLoopbackPortApplyButton" onAction="#doChangeLoopbackPort"/>
|
||||
</HBox>
|
||||
|
||||
<CheckBox fx:id="readOnlyCheckbox" text="%vaultOptions.mount.readonly" visible="${controller.readOnlyOptionAllowed}" managed="${controller.readOnlyOptionAllowed}"/>
|
||||
|
||||
<VBox visible="${controller.mountFlagsSupported}" managed="${controller.mountFlagsSupported}">
|
||||
<CheckBox fx:id="customMountFlagsCheckbox" text="%vaultOptions.mount.customMountFlags" onAction="#toggleUseCustomMountFlags"/>
|
||||
<TextField fx:id="mountFlagsField" HBox.hgrow="ALWAYS" maxWidth="Infinity" accessibleText="%vaultOptions.mount.customMountFlags">
|
||||
<VBox.margin>
|
||||
<Insets left="24"/>
|
||||
</VBox.margin>
|
||||
</TextField>
|
||||
</VBox>
|
||||
|
||||
<Label text="%vaultOptions.mount.mountPoint">
|
||||
<VBox.margin>
|
||||
<Insets top="9"/>
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
|
||||
<RadioButton toggleGroup="${mountPointToggleGroup}" fx:id="mountPointAutoBtn" text="%vaultOptions.mount.mountPoint.auto"/>
|
||||
|
||||
<HBox spacing="6" visible="${controller.mountpointDriveLetterSupported}" managed="${controller.mountpointDriveLetterSupported}">
|
||||
<RadioButton toggleGroup="${mountPointToggleGroup}" fx:id="mountPointDriveLetterBtn" text="%vaultOptions.mount.mountPoint.driveLetter"/>
|
||||
<ChoiceBox fx:id="driveLetterSelection" disable="${!mountPointDriveLetterBtn.selected}" accessibleText="%vaultOptions.mount.mountPoint.driveLetter"/>
|
||||
</HBox>
|
||||
|
||||
<VBox spacing="6" visible="${controller.mountpointDirSupported}" managed="${controller.mountpointDirSupported}">
|
||||
<HBox spacing="6" alignment="CENTER_LEFT">
|
||||
<RadioButton toggleGroup="${mountPointToggleGroup}" fx:id="mountPointDirBtn" text="%vaultOptions.mount.mountPoint.custom"/>
|
||||
<Button text="%vaultOptions.mount.mountPoint.directoryPickerButton" onAction="#chooseCustomMountPoint" contentDisplay="LEFT" disable="${!mountPointDirBtn.selected}">
|
||||
<graphic>
|
||||
<FontAwesome5IconView glyph="FOLDER_OPEN" glyphSize="15"/>
|
||||
</graphic>
|
||||
</Button>
|
||||
</HBox>
|
||||
<TextField fx:id="directoryPathField" text="${controller.directoryPath}" visible="${mountPointDirBtn.selected}" managed="${mountPointDirBtn.managed}" maxWidth="Infinity" editable="false" accessibleText="%vaultOptions.mount.mountPoint.custom">
|
||||
<VBox.margin>
|
||||
<Insets left="24"/>
|
||||
</VBox.margin>
|
||||
</TextField>
|
||||
</VBox>
|
||||
</children>
|
||||
|
||||
</VBox>
|
||||
</ScrollPane>
|
||||
|
||||
Reference in New Issue
Block a user