mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-14 08:41:28 +00:00
Add cryptomator-vault alias to etc/hosts during (re)install (#1914)
Co-authored-by: Armin Schrenk <armin.schrenk@skymatic.de>
This commit is contained in:
committed by
GitHub
parent
9b8661fe3c
commit
2808d777e0
2
dist/win/build.bat
vendored
2
dist/win/build.bat
vendored
@@ -1,2 +1,2 @@
|
||||
@echo off
|
||||
powershell -NoExit -ExecutionPolicy Unrestricted -Command .\build.ps1
|
||||
powershell -NoLogo -NoExit -ExecutionPolicy Unrestricted -Command .\build.ps1
|
||||
1
dist/win/build.ps1
vendored
1
dist/win/build.ps1
vendored
@@ -68,7 +68,6 @@ Copy-Item "$buildDir\..\..\target\cryptomator-*.jar" -Destination "$buildDir\..\
|
||||
Copy-Item "contrib\*" -Destination "Cryptomator"
|
||||
attrib -r "Cryptomator\Cryptomator.exe"
|
||||
|
||||
|
||||
# create .msi bundle
|
||||
$Env:JP_WIXWIZARD_RESOURCES = "$buildDir\resources"
|
||||
& "$Env:JAVA_HOME\bin\jpackage" `
|
||||
|
||||
3
dist/win/contrib/patchHosts.bat
vendored
Normal file
3
dist/win/contrib/patchHosts.bat
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
@echo off
|
||||
cd %~dp0
|
||||
powershell -NoLogo -NonInteractive -ExecutionPolicy Unrestricted -Command .\patchHosts.ps1
|
||||
16
dist/win/contrib/patchHosts.ps1
vendored
Normal file
16
dist/win/contrib/patchHosts.ps1
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
#Requires -RunAsAdministrator
|
||||
|
||||
$sysdir = [Environment]::SystemDirectory
|
||||
$hostsFile = "$sysdir\drivers\etc\hosts"
|
||||
$aliasLine = '127.0.0.1 cryptomator-vault'
|
||||
|
||||
foreach ($line in Get-Content $hostsFile) {
|
||||
if ($line -eq $aliasLine){
|
||||
Write-Output 'No changes necessary'
|
||||
exit 0
|
||||
}
|
||||
}
|
||||
|
||||
Add-Content -Path $hostsFile -Encoding ascii -Value "`r`n$aliasLine"
|
||||
Write-Output 'Added alias to hosts file'
|
||||
exit 0
|
||||
4
dist/win/resources/main.wxs
vendored
4
dist/win/resources/main.wxs
vendored
@@ -124,6 +124,8 @@
|
||||
<CustomAction Id="JpSetARPURLUPDATEINFO" Property="ARPURLUPDATEINFO" Value="$(var.JpUpdateURL)" />
|
||||
<?endif?>
|
||||
|
||||
<CustomAction Id="PatchHostsFile" Impersonate="no" ExeCommand="[INSTALLDIR]patchHosts.bat" Directory="INSTALLDIR" Execute="deferred" Return="asyncWait" />
|
||||
|
||||
<?ifdef JpIcon ?>
|
||||
<Property Id="ARPPRODUCTICON" Value="JpARPPRODUCTICON"/>
|
||||
<Icon Id="JpARPPRODUCTICON" SourceFile="$(var.JpIcon)"/>
|
||||
@@ -153,6 +155,8 @@
|
||||
<Custom Action="JpDisallowDowngrade" After="FindRelatedProducts">JP_DOWNGRADABLE_FOUND</Custom>
|
||||
<?endif?>
|
||||
<RemoveExistingProducts Before="CostInitialize"/>
|
||||
|
||||
<Custom Action="PatchHostsFile" After="InstallFiles">NOT Installed OR REINSTALL</Custom>
|
||||
</InstallExecuteSequence>
|
||||
|
||||
<WixVariable Id="WixUIBannerBmp" Value="$(env.JP_WIXWIZARD_RESOURCES)\banner.bmp" />
|
||||
|
||||
Reference in New Issue
Block a user