Skip to content

Instantly share code, notes, and snippets.

@Kade-github
Last active September 21, 2025 19:38
Show Gist options
  • Save Kade-github/65bcc1ed0c1af723700a98b892b0ca2d to your computer and use it in GitHub Desktop.
Save Kade-github/65bcc1ed0c1af723700a98b892b0ca2d to your computer and use it in GitHub Desktop.
LOVE2D exe distribution PowerShell script
# Variable for game name
$gameName = "Game"
$lovePath = "E:\LOVE"
# CD into the game directory
cd game
# Use 7z to create a zip file of the game directory
7z a -tzip ../game.love *
# CD into the parent directory
cd ..
# Create the bin directory if it doesn't exist
if (-not (Test-Path -Path "bin")) {
New-Item -ItemType Directory -Path "bin"
}
# Copy the love path into bin/ folder (only .dlls, love.exe, and licenses)
xcopy /Y /E /I $lovePath\*.dll bin\
xcopy /Y /I $lovePath\love.exe bin\
xcopy /Y /I $lovePath\license.txt bin\
# Copy the game.love to the bin folder
xcopy /Y /I game.love bin\
# Clean up the game.love file in the root directory
del game.love
# Copy game.love and love.exe to the same exe
Get-Content bin/love.exe,bin/game.love -Encoding Byte | Set-Content bin/$gameName.exe -Encoding Byte
# Remove the game.love file
del "bin\game.love"
del "bin\love.exe"
# print success message
Write-Host "Build completed successfully! The executable is located in the bin folder as $gameName.exe"
@Kade-github
Copy link
Author

this one uses 7zip because Compress-Archive sucks, tar.exe sucks, and 7zip worked so I dunno what to tell you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment