Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af4b1c6
commit 7aeb61b
Showing
4 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,3 +150,5 @@ dist | |
|
||
# linux binary | ||
/src/oh-my-posh3 | ||
bin/ | ||
Output/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Param | ||
( | ||
[parameter(Mandatory = $true)] | ||
[string] | ||
$Version | ||
) | ||
|
||
New-Item -Path "." -Name "bin" -ItemType Directory | ||
Copy-Item -Path "../../themes" -Destination "./bin" -Recurse | ||
|
||
# download the files and pack them | ||
@{name = 'posh-windows-amd64.exe' }, @{name = 'posh-linux-amd64' }, @{name = 'posh-windows-386.exe' } | ForEach-Object -Process { | ||
$download = "https://github.com/jandedobbeleer/oh-my-posh3/releases/download/v$Version/$($_.name)" | ||
Invoke-WebRequest $download -Out "./bin/$($_.name)" | ||
} | ||
# lisence | ||
Invoke-WebRequest "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh3/v$Version/COPYING" -Out "./bin/COPYING.txt" | ||
$content = Get-Content '.\oh-my-posh.iss' -Raw | ||
$content = $content.Replace('<VERSION>', $Version) | ||
$content | Out-File -Encoding 'UTF8' ".oh-my-posh-$Version.iss" | ||
# package content | ||
ISCC.exe ".oh-my-posh-$Version.iss" | ||
# get hash | ||
$zipHash = Get-FileHash 'Output/install.exe' -Algorithm SHA256 | ||
$zipHash.Hash | Out-File -Encoding 'UTF8' 'Output/install.exe.sha256' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[Setup] | ||
AppName=Oh my Posh | ||
AppVersion=<VERSION> | ||
DefaultDirName={autopf}\oh-my-posh | ||
DefaultGroupName=Oh my Posh | ||
PrivilegesRequired=lowest | ||
AppPublisher=Jan De Dobbeleer | ||
AppPublisherURL=https://ohmyposh.dev | ||
AppSupportURL=https://github.com/JanDeDobbeleer/oh-my-posh3/issues | ||
LicenseFile="bin\COPYING.txt" | ||
OutputBaseFilename=install | ||
|
||
[Files] | ||
Source: "bin\posh-windows-amd64.exe"; DestDir: "{app}\bin"; DestName: "oh-my-posh.exe"; Flags: 64bit | ||
Source: "bin\posh-windows-386.exe"; DestDir: "{app}\bin"; DestName: "oh-my-posh.exe"; Flags: 32bit | ||
Source: "bin\posh-linux-amd64"; DestDir: "{app}\bin"; DestName: "oh-my-posh-wsl"; Flags: 64bit | ||
Source: "bin\themes\*"; DestDir: "{app}\themes" | ||
|
||
[Registry] | ||
Root: "HKCU"; Subkey: "Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}\bin"; Check: NeedsAddPathHKCU(ExpandConstant('{app}\bin')) | ||
Root: "HKCU"; Subkey: "Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}\themes"; Check: NeedsAddPathHKCU(ExpandConstant('{app}\themes')) | ||
|
||
[Code] | ||
function NeedsAddPathHKCU(Param: string): boolean; | ||
var | ||
OrigPath: string; | ||
begin | ||
if not RegQueryStringValue(HKEY_CURRENT_USER, | ||
'Environment', | ||
'Path', OrigPath) | ||
then begin | ||
Result := True; | ||
exit; | ||
end; | ||
// look for the path with leading and trailing semicolon | ||
// Pos() returns 0 if not found | ||
Result := Pos(';' + Param + ';', ';' + OrigPath + ';') = 0; | ||
end; |