From e25bdba3a3a53b09be5269d8b065c13b73ab55c3 Mon Sep 17 00:00:00 2001 From: yum Date: Sun, 1 Jan 2023 21:05:27 -0800 Subject: Embed git in package package.ps1 fetches PortableGit and embeds it in the package. This eliminates all but one runtime dependency (MSVC++ Redistributable). * Move Python into a new FOSS folder. --- GUI/.gitignore | 3 +++ GUI/package.ps1 | 22 +++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'GUI') diff --git a/GUI/.gitignore b/GUI/.gitignore index b847faa..45ea261 100644 --- a/GUI/.gitignore +++ b/GUI/.gitignore @@ -1,3 +1,6 @@ # ignore generated package files TaSTT TaSTT.zip + +# ignore net-fetched dependencies +PortableGit* diff --git a/GUI/package.ps1 b/GUI/package.ps1 index 0941196..c1109c5 100644 --- a/GUI/package.ps1 +++ b/GUI/package.ps1 @@ -4,13 +4,33 @@ if (Test-Path $install_dir) { rm -Recurse $install_dir } +$git_dir = "PortableGit" + +if (-Not (Test-Path $git_dir)) { + echo "Fetching PortableGit" + + # When it's time to update this, get the latest version from here: + # https://git-scm.com/download/win + $GIT_2_39_0_URL = "https://github.com/git-for-windows/git/releases/download/v2.39.0.windows.2/PortableGit-2.39.0.2-64-bit.7z.exe" + $GIT_URL = $GIT_2_39_0_URL + $GIT_FILE = $(Split-Path -Path $GIT_URL -Leaf) + + if (-Not (Test-Path $GIT_FILE)) { + Invoke-WebRequest $GIT_URL -OutFile $GIT_FILE + } + & "./$GIT_FILE" + + Read-Host -Prompt "Press enter once PortableGit is installed at $pwd\PortableGit" +} + mkdir $install_dir > $null mkdir $install_dir/Resources > $null cp -Recurse ../Animations TaSTT/Resources/Animations mkdir TaSTT/Resources/Fonts cp -Recurse ../Fonts/Bitmaps TaSTT/Resources/Fonts/Bitmaps cp -Recurse ../Images TaSTT/Resources/Images -cp -Recurse ../Python TaSTT/Resources/Python +cp -Recurse ../FOSS/Python TaSTT/Resources/Python +cp -Recurse PortableGit TaSTT/Resources/PortableGit cp -Recurse ../Scripts TaSTT/Resources/Scripts cp -Recurse ../Shaders TaSTT/Resources/Shaders cp -Recurse ../Sounds TaSTT/Resources/Sounds -- cgit v1.2.3