From 5fd3992ff8eea62967288c639985bfe60b9a171b Mon Sep 17 00:00:00 2001 From: Weicao-CatilGrass <1992414357@qq.com> Date: Wed, 10 Dec 2025 10:22:45 +0800 Subject: Move installation script to setup/linux directory --- setup/linux/inst.sh | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 setup/linux/inst.sh (limited to 'setup') diff --git a/setup/linux/inst.sh b/setup/linux/inst.sh new file mode 100644 index 0000000..bbebeb8 --- /dev/null +++ b/setup/linux/inst.sh @@ -0,0 +1,88 @@ +# Check if required tools are installed +echo "Checking for required tools..." +if ! command -v cargo &> /dev/null; then + echo "Error: cargo is not installed. Please install Rust and Cargo first." + exit 1 +fi +if ! command -v git &> /dev/null; then + echo "Error: git is not installed. Please install git first." + exit 1 +fi + +# Set installation directory to current directory +echo "Installation directory set to current directory: $(pwd)" +install_dir="$(pwd)" + +# Clone or update repos +echo "Cloning or updating repositories..." +mkdir -p "$install_dir" +cd "$install_dir" + +# Function to clone or pull repository +clone_or_pull() { + local repo_url="$1" + local repo_name=$(basename "$repo_url") + + if [ -d "$repo_name" ]; then + echo "Repository $repo_name already exists, pulling latest changes..." + cd "$repo_name" + git pull origin main + cd .. + else + echo "Cloning $repo_name..." + git clone "$repo_url" + fi +} + +# Clone or update repositories +clone_or_pull https://github.com/JustEnoughVCS/CommandLine +clone_or_pull https://github.com/JustEnoughVCS/VersionControl + +# Setup VersionControl repo +echo "Setting up VersionControl..." +cd VersionControl +chmod +x setup.sh +./setup.sh + +# Build CLI +echo "Building CLI..." +cd ../CommandLine +cargo build --release +cargo export + +# Configure shell to include CLI in PATH +echo "Now adding JustEnoughVCS CLI to your environment. Please select your target shell:" +echo "1) ~/.zshrc (Zsh)" +echo "2) ~/.bashrc (Bash)" +echo "3) ~/.config/fish/config.fish (Fish)" +echo "4) Skip shell configuration" +echo -n "Enter your choice (1-4): " +read choice + +case $choice in + 1) + config_file="$HOME/.zshrc" + ;; + 2) + config_file="$HOME/.bashrc" + ;; + 3) + config_file="$HOME/.config/fish/config.fish" + ;; + 4) + echo "Skipping shell configuration." + echo "Installation completed! You can manually add the CLI to your PATH later." + exit 0 + ;; + *) + echo "Invalid choice. Skipping shell configuration." + exit 0 + ;; +esac + +cli_path="$(pwd)/export/jv_cli.sh" +echo "# JustEnoughVCS CLI" >> "$config_file" +echo "source \"$cli_path\"" >> "$config_file" +echo "CLI has been added to $config_file" +echo "Please restart your shell or run: source $config_file" +echo "Installation completed successfully!" -- cgit From 1567bab16b1eeb8ddaf5a8cc09c71bdb0bedbda3 Mon Sep 17 00:00:00 2001 From: Weicao-CatilGrass <1992414357@qq.com> Date: Wed, 10 Dec 2025 10:49:52 +0800 Subject: 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 --- setup/windows/inst.ps1 | 8 ++++++++ setup/windows/setup_jv_cli.iss | 42 ++++++++++++++++++++++++++++++++++++++++++ setup/windows/uninst.ps1 | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 setup/windows/inst.ps1 create mode 100644 setup/windows/setup_jv_cli.iss create mode 100644 setup/windows/uninst.ps1 (limited to 'setup') 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 +} -- cgit From be67a79c4a10fc42d7d15b87e488db00238e4676 Mon Sep 17 00:00:00 2001 From: Weicao-CatilGrass <1992414357@qq.com> Date: Wed, 10 Dec 2025 11:02:09 +0800 Subject: Rename Windows CLI installer template file --- setup/windows/setup_jv_cli.iss | 42 --------------------------------- setup/windows/setup_jv_cli_template.iss | 42 +++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 42 deletions(-) delete mode 100644 setup/windows/setup_jv_cli.iss create mode 100644 setup/windows/setup_jv_cli_template.iss (limited to 'setup') diff --git a/setup/windows/setup_jv_cli.iss b/setup/windows/setup_jv_cli.iss deleted file mode 100644 index 24b2a32..0000000 --- a/setup/windows/setup_jv_cli.iss +++ /dev/null @@ -1,42 +0,0 @@ -#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/setup_jv_cli_template.iss b/setup/windows/setup_jv_cli_template.iss new file mode 100644 index 0000000..24b2a32 --- /dev/null +++ b/setup/windows/setup_jv_cli_template.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; -- cgit From 15b508b7931aacd0c07ad6f52d4cefa6eef69fa1 Mon Sep 17 00:00:00 2001 From: Weicao-CatilGrass <1992414357@qq.com> Date: Wed, 10 Dec 2025 11:10:47 +0800 Subject: Add Windows installer script generation to build process - Generate Inno Setup installer script from template at build time - Extract author and homepage from Cargo.toml for script customization - Add generated installer script to .gitignore to avoid committing build artifacts --- setup/windows/setup_jv_cli_template.iss | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'setup') diff --git a/setup/windows/setup_jv_cli_template.iss b/setup/windows/setup_jv_cli_template.iss index 24b2a32..124d897 100644 --- a/setup/windows/setup_jv_cli_template.iss +++ b/setup/windows/setup_jv_cli_template.iss @@ -1,7 +1,7 @@ #define MyAppName "JustEnoughVCS" -#define MyAppVersion "0.1.0" -#define MyAppPublisher "JustEnoughVCS Team" -#define MyAppURL "https://jvcs.cc/" +#define MyAppVersion "<<>>" +#define MyAppPublisher "<<>>" +#define MyAppURL "<<>>" [Setup] AppId={{8265DF21-F290-487E-9403-C2730EC31A03} -- cgit