diff options
| author | Weicao-CatilGrass <1992414357@qq.com> | 2025-12-10 10:49:52 +0800 |
|---|---|---|
| committer | Weicao-CatilGrass <1992414357@qq.com> | 2025-12-10 10:49:52 +0800 |
| commit | 1567bab16b1eeb8ddaf5a8cc09c71bdb0bedbda3 (patch) | |
| tree | c5cc7c708207f3dae1b921c9d576d299a55be1b4 /setup | |
| parent | 5fd3992ff8eea62967288c639985bfe60b9a171b (diff) | |
Add Windows installer and export scripts
- Add Inno Setup configuration for Windows installer
- Add PowerShell scripts for installation and uninstallation
- Create Windows-specific export script
- Update existing export script to suppress build output
- Include application icon for installer
Diffstat (limited to 'setup')
| -rw-r--r-- | setup/windows/inst.ps1 | 8 | ||||
| -rw-r--r-- | setup/windows/setup_jv_cli.iss | 42 | ||||
| -rw-r--r-- | setup/windows/uninst.ps1 | 39 |
3 files changed, 89 insertions, 0 deletions
diff --git a/setup/windows/inst.ps1 b/setup/windows/inst.ps1 new file mode 100644 index 0000000..2e15dc3 --- /dev/null +++ b/setup/windows/inst.ps1 @@ -0,0 +1,8 @@ +. ".\uninst.ps1" + +$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path + +$parentDir = Split-Path -Parent $scriptDir +Add-Content -Path $PROFILE -Value "`n# JustEnoughVCS - Begin #" +Add-Content -Path $PROFILE -Value ". `"$parentDir\jv_cli.ps1`"" +Add-Content -Path $PROFILE -Value "# JustEnoughVCS - End #" diff --git a/setup/windows/setup_jv_cli.iss b/setup/windows/setup_jv_cli.iss new file mode 100644 index 0000000..24b2a32 --- /dev/null +++ b/setup/windows/setup_jv_cli.iss @@ -0,0 +1,42 @@ +#define MyAppName "JustEnoughVCS" +#define MyAppVersion "0.1.0" +#define MyAppPublisher "JustEnoughVCS Team" +#define MyAppURL "https://jvcs.cc/" + +[Setup] +AppId={{8265DF21-F290-487E-9403-C2730EC31A03} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName={autopf}\{#MyAppName} +DefaultGroupName={#MyAppName} +AllowNoIcons=yes +LicenseFile=..\..\LICENSE +PrivilegesRequired=lowest +OutputDir=..\..\export\setup +OutputBaseFilename=JustEnoughVCS For Windows +SetupIconFile=..\..\docs\images\Yizi.ico +SolidCompression=yes +WizardStyle=modern dynamic + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" + +[Files] +Source: "..\..\export\*"; Excludes: "setup"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +Source: "inst.ps1"; DestDir: "{app}\scripts\"; Flags: ignoreversion +Source: "uninst.ps1"; DestDir: "{app}\scripts\"; Flags: ignoreversion + +[Run] +Filename: "powershell.exe"; Parameters: "-ExecutionPolicy Bypass -File ""{app}\scripts\inst.ps1"""; Flags: runhidden; Description: "Running post-installation script..."; StatusMsg: "Running post-installation script..."; AfterInstall: RunPostInstall + +[UninstallRun] +Filename: "powershell.exe"; Parameters: "-ExecutionPolicy Bypass -File ""{app}\scripts\uninst.ps1"""; Flags: runhidden; RunOnceId: "UninstallScript" + +[Code] +procedure RunPostInstall; +begin +end; diff --git a/setup/windows/uninst.ps1 b/setup/windows/uninst.ps1 new file mode 100644 index 0000000..d5c898d --- /dev/null +++ b/setup/windows/uninst.ps1 @@ -0,0 +1,39 @@ +$profileContent = Get-Content $PROFILE -ErrorAction SilentlyContinue +if ($profileContent) { + $startMarker = "# JustEnoughVCS - Begin #" + $endMarker = "# JustEnoughVCS - End #" + $newContent = @() + $insideBlock = $false + $foundStart = $false + + foreach ($line in $profileContent) { + if ($line.Trim() -eq $startMarker) { + $insideBlock = $true + $foundStart = $true + continue + } + if ($line.Trim() -eq $endMarker) { + $insideBlock = $false + continue + } + if (-not $insideBlock) { + $newContent += $line + } + } + + if ($foundStart -and $insideBlock) { + $newContent = @() + $insideBlock = $false + foreach ($line in $profileContent) { + if ($line.Trim() -eq $startMarker) { + $insideBlock = $true + continue + } + if (-not $insideBlock) { + $newContent += $line + } + } + } + + $newContent | Set-Content $PROFILE +} |
