Skip to content

Commit

Permalink
Add the installation script and improve doc
Browse files Browse the repository at this point in the history
  • Loading branch information
GaelGirodon committed Jan 30, 2021
1 parent 95d3c68 commit f67f18e
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# EditorConfig
# EditorConfig

root = true

[*]
charset = utf-8
end_of_line = crlf
insert_final_newline = true
indent_style = space
Expand Down
2 changes: 1 addition & 1 deletion Accounts/Accounts.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<!-- Target configuration -->
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
 GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Expand Down
29 changes: 28 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,41 @@
# Accounts

![Release](https://img.shields.io/github/v/release/GaelGirodon/accounts?style=flat-square)
![License](https://img.shields.io/github/license/GaelGirodon/accounts?style=flat-square&color=blue)

A basic personal financial-accounting software.

## Get started
## Installation

- Install the [.NET Desktop Runtime](https://dotnet.microsoft.com/download/dotnet/current/runtime/desktop)
- Download the [latest release](https://github.com/GaelGirodon/accounts/releases/latest)
- Extract the archive
- Run `Accounts.exe`

### Using script

```powershell
# Install .NET Desktop Runtime using the link above or dotnet install scripts
# Allow running scripts
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
# Download and install the latest release of Accounts
Invoke-WebRequest 'https://raw.githubusercontent.com/GaelGirodon/accounts/master/Scripts/Install.ps1' `
| Invoke-Expression
```

## Features

- Manage an account: add, edit, check and remove transactions
- Navigate in the transactions list by month and year
- Get the account balance and the sum of credits and debits of each month
- Batch duplicate transactions to another date
- Save account transactions to a `.account` file (a simple zipped JSON file)
- Easily create account file backups
- Support many keyboard shortcuts and accelerator keys
- Available in :fr: French and :uk: English

## License

**Accounts** is licensed under the GNU General Public License.
57 changes: 57 additions & 0 deletions Scripts/Install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#
# Install.ps1
#
# Download and install the application.
#
# Remote install: `Invoke-WebRequest 'https://raw.githubusercontent.com/GaelGirodon/accounts/master/Scripts/Install.ps1' | Invoke-Expression`
#

$ErrorActionPreference = "stop" # Quit if anything goes wrong

$PackageUrl = "https://github.com/GaelGirodon/accounts/releases/latest/download/Accounts.zip"
$PackageChecksumUrl = "$PackageUrl.sha256"
$PackagePath = (Join-Path $env:TEMP "Accounts.zip")
$InstallPath = (Join-Path $env:LOCALAPPDATA "Programs\Accounts")
$StartMenuPath = (Join-Path $env:APPDATA "Microsoft\Windows\Start Menu\Programs")

# Download
Write-Host "Downloading package from $PackageUrl..."
$WebClient = (New-Object System.Net.WebClient)
$WebClient.Headers.Add("User-Agent: WebClient")
$WebClient.DownloadFile($PackageUrl, $PackagePath)
Write-Host -ForegroundColor Green "Package downloaded to $PackagePath"

# Checksum
Write-Host "Validating checksum..."
$WebClient.Headers.Add("User-Agent: WebClient")
$PackageChecksumExpected = ($WebClient.DownloadString($PackageChecksumUrl)).Trim()
Write-Host "> Expected: $PackageChecksumExpected"
$PackageChecksumActual = (Get-FileHash -Algorithm SHA256 $PackagePath).Hash.ToLower()
Write-Host "> Actual: $PackageChecksumActual"
if ($PackageChecksumActual -ine $PackageChecksumExpected) {
Write-Error "Invalid checksum"
return 2 | Out-Null
}
Write-Host -ForegroundColor Green "Checksum is valid"

# Extract
Write-Host "Extracting archive to $InstallPath..."
Expand-Archive -Path $PackagePath -DestinationPath $InstallPath -Force
Write-Host -ForegroundColor Green "Archive extracted to $InstallPath"

# Create a shortcut
Write-Host "Creating a shortcut in the start menu..."
$ShortcutName = "Accounts"
if ((Get-Culture).Name -like "fr*") {
$ShortcutName = "Comptes"
}
$WSScriptShell = New-Object -ComObject WScript.Shell
$Shortcut = $WSScriptShell.CreateShortcut("$StartMenuPath\$ShortcutName.lnk")
$Shortcut.TargetPath = "$InstallPath\Accounts.exe"
$Shortcut.Save()
Write-Host -ForegroundColor Green "Shortcut created"

# Clean up
Write-Host "Removing package..."
Remove-Item $PackagePath
Write-Host -ForegroundColor Green "Package removed"
2 changes: 1 addition & 1 deletion Scripts/Package.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#
#
# Package.ps1
#
# Build and package the application.
Expand Down

0 comments on commit f67f18e

Please sign in to comment.