diff --git a/README.md b/README.md index ee46b72..111d285 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This is the repo for FishPog Pixelmon, and a bit of experimental tooling to make git clone https://git.233hfd.com/joey/FishPogPixelmon.git cd FishPogPixelmon -source ./venv.sh # or just venv.bat on windows +source ./venv.sh # or just venv.ps1 on windows python tooling.py --setup ``` @@ -21,4 +21,8 @@ now, pax will be installed, which will allow you to edit the modpack. refer to t python tooling.py --export ``` -this command will package up the pack with pax, then bundle some scripts with it that allows for auto-updating and automatically downloading the mods from curseforge, rather than having to distribute a large zip file. +## exporting the modpack client + +```bash +python tooling.py --client +``` diff --git a/client/client.ps1 b/client/client.ps1 index b2f9d20..0c073be 100755 --- a/client/client.ps1 +++ b/client/client.ps1 @@ -1,6 +1,12 @@ +# got to the directory where the script is located +Push-Location $PSScriptRoot + # check if winget is installed and if so, set a flag to true $winget = Get-Command winget -ErrorAction SilentlyContinue +# trust desktop-shortcut.ps1 for good measure +Unblock-File .\desktop-shortcut.ps1 + if (!$winget) { Write-Host "Error: winget is not installed." -Foreground Red Write-Host "This script will not work without winget." -Foreground Red diff --git a/client/desktop-shortcut.ps1 b/client/desktop-shortcut.ps1 new file mode 100644 index 0000000..ee4de39 --- /dev/null +++ b/client/desktop-shortcut.ps1 @@ -0,0 +1,12 @@ +# creates a desktop shortcut to run client.ps1 in powershell + +$ClientFile = "$PSScriptRoot\client.ps1" +$ShortcutPath = "$Home\Desktop\FishPog Pixelmon.lnk" +$IconPath = "$PSScriptRoot\icon.ico" + +$WshShell = New-Object -comObject WScript.Shell +$Shortcut = $WshShell.CreateShortcut($ShortcutPath) +$Shortcut.TargetPath = "powershell.exe" +$Shortcut.Arguments = "-ExecutionPolicy Bypass -File `"$ClientFile`"" +$Shortcut.IconLocation = $IconPath +$Shortcut.Save() \ No newline at end of file diff --git a/client/icon.ico b/client/icon.ico new file mode 100644 index 0000000..4d004ca Binary files /dev/null and b/client/icon.ico differ diff --git a/tooling.py b/tooling.py index e4e001e..e023a11 100644 --- a/tooling.py +++ b/tooling.py @@ -58,6 +58,8 @@ def export_client(): z.write("client/client.sh", "client.sh") z.write("client/requirements.txt", "requirements.txt") z.write("client/client.py", "client.py") + z.write("client/icon.ico", "icon.ico") + z.write("client/desktop-shortcut.ps1", "desktop-shortcut.ps1") z.close()