mirror of
https://github.com/Macrame-App/Macrame
synced 2025-12-29 07:19:26 +00:00
Install script for Windows and shortcut
This commit is contained in:
parent
84b038b5ee
commit
f49630558d
2 changed files with 42 additions and 0 deletions
42
install.bat
Normal file
42
install.bat
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
@echo off
|
||||
setlocal
|
||||
|
||||
REM Set paths relative to the current working directory
|
||||
|
||||
$ruleName = "Macrame LAN Access"
|
||||
$exePath = Join-Path $PSScriptRoot "be\Macrame.exe"
|
||||
|
||||
# Check if rule exists
|
||||
$existingRule = Get-NetFirewallRule -DisplayName $ruleName -ErrorAction SilentlyContinue
|
||||
|
||||
if (-not $existingRule) {
|
||||
New-NetFirewallRule -DisplayName $ruleName `
|
||||
-Direction Inbound `
|
||||
-Action Allow `
|
||||
-Program $exePath `
|
||||
-Protocol TCP `
|
||||
-Profile Private `
|
||||
-Enabled True
|
||||
|
||||
Write-Host "Firewall rule '$ruleName' added for $exePath"
|
||||
} else {
|
||||
Write-Host "Firewall rule '$ruleName' already exists"
|
||||
}
|
||||
:: Navigate to the "be" directory
|
||||
cd /d "%~dp0be"
|
||||
|
||||
:: Run setup.exe to generate configuration and necessary files
|
||||
start /wait Setup.exe
|
||||
|
||||
:: start /wait caddy.exe fmt --overwrite
|
||||
|
||||
:: Run Caddy to generate certificates and serve content
|
||||
:: start /wait caddy.exe start --config CaddyFile
|
||||
|
||||
:: taskkill /f /im caddy.exe
|
||||
|
||||
:: Now start macrame.exe
|
||||
start Macrame.exe
|
||||
|
||||
:: End of script
|
||||
exit
|
||||
Loading…
Add table
Add a link
Reference in a new issue