diff options
| -rw-r--r-- | docs/images/Yizi.ico | bin | 0 -> 270622 bytes | |||
| -rw-r--r-- | export.ps1 | 13 | ||||
| -rwxr-xr-x | export.sh | 4 | ||||
| -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 |
6 files changed, 105 insertions, 1 deletions
diff --git a/docs/images/Yizi.ico b/docs/images/Yizi.ico Binary files differnew file mode 100644 index 0000000..24a2d00 --- /dev/null +++ b/docs/images/Yizi.ico diff --git a/export.ps1 b/export.ps1 new file mode 100644 index 0000000..d24c37e --- /dev/null +++ b/export.ps1 @@ -0,0 +1,13 @@ +# Require : Cargo (Rust), ISCC (Inno Setup) + +# Build +cargo build --workspace --release +if ($LASTEXITCODE -ne 0) { + # Build failed +} else { + # Build succeeded + # Export + if (cargo run --manifest-path crates/build_helper/Cargo.toml --bin exporter) { + ISCC /Q .\setup\windows\setup_jv_cli.iss + } +} @@ -1,7 +1,9 @@ #!/bin/bash +# Require : Cargo (Rust) + # Build -if cargo build --workspace --release; then +if cargo build --workspace --release >/dev/null 2>&1; then # Export cargo run --manifest-path crates/build_helper/Cargo.toml --bin exporter fi 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 +} |
