Skip to content

Commit

Permalink
Ship unaltered love2d on Windows instead of following the release pro…
Browse files Browse the repository at this point in the history
…cedure

I am trying to make the cursed-olympus.zip floating around on the Celeste Discord official now
  • Loading branch information
maddie480 committed Feb 12, 2025
1 parent 7f7660b commit 56a3a64
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/accent-issue-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
Invoke-WebRequest -Uri 'https://maddie480.ovh/celeste/download-olympus?branch=main&platform=windows' -OutFile temp.zip
Expand-Archive -Path temp.zip -DestinationPath .
Expand-Archive -Path windows.main\dist.zip -DestinationPath olympus-install
Remove-Item -Path temp.zip,windows.main,olympus-install\main.exe -Force -Recurse
Remove-Item -Path temp.zip,windows.main -Force -Recurse
- name: Install love2d
run: |
Expand Down
32 changes: 2 additions & 30 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ strategy:
loveAppImage: ''
loveBinaryDirectory: ''
loveResourcesDirectory: ''
loveBinary: 'love.exe'
macos:
jobArchName: 'macOS'
imageName: 'macOS-latest'
Expand Down Expand Up @@ -207,7 +206,7 @@ steps:
Invoke-WebRequest -Uri $env:LOVELUAURL -OutFile lovelua.zip
Expand-Archive -Path lovelua.zip -DestinationPath lovelua
Copy-Item -Path lovelua/love-11.3-win32/lua51.dll -Destination love-raw/love-11.5-win32/lua51.dll -Force
# Copy cached unpacked LÖVE, fix it up if needed
# Copy cached unpacked LÖVE
- task: PowerShell@2
condition: and(succeeded(), ne(variables.loveURL, ''))
displayName: 'Dist: Copy and fix cached LÖVE'
Expand All @@ -220,17 +219,6 @@ steps:
Move-Item -Path love/love-11.5-win32 -Destination love-win
Remove-Item -Path love -Force -Recurse
Move-Item -Path love-win -Destination love
Invoke-WebRequest -Uri "https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe" -OutFile rcedit.exe
./rcedit.exe love/love.exe `
--set-icon icon.ico `
--set-version-string Comments $env:BUILD_SOURCEVERSION `
--set-version-string CompanyName "Everest Team" `
--set-version-string FileDescription Olympus `
--set-version-string FileVersion $env:BUILD_BUILDNUMBER `
--set-version-string LegalCopyright "See https://github.com/EverestAPI/Olympus/blob/main/LICENSE" `
--set-version-string OriginalFilename main.exe `
--set-version-string ProductName Olympus `
--set-version-string ProductVersion $env:BUILD_BUILDNUMBER
}
# Update the version.txt in the src dir based on the build number.
Expand All @@ -253,22 +241,6 @@ steps:
Compress-Archive -Path src/* -DestinationPath olympus.zip
Move-Item -Path olympus.zip -Destination olympus.love
Copy-Item -Path olympus.love -Destination love/$env:LOVEBINARYDIRECTORY/olympus.love
# Glue it onto the love binary.
- task: PowerShell@2
condition: and(succeeded(), ne(variables.loveBinary, ''))
displayName: 'Dist: Glue olympus.love onto LÖVE'
continueOnError: true
inputs:
targetType: 'inline'
script: |
if ($PSVersionTable.PSVersion.Major -lt 6) {
Get-Content love/$env:LOVEBINARYDIRECTORY/$env:LOVEBINARY,love/$env:LOVEBINARYDIRECTORY/olympus.love -Encoding Byte -ReadCount 512 | Set-Content love-glued -Encoding Byte
} else {
Get-Content love/$env:LOVEBINARYDIRECTORY/$env:LOVEBINARY,love/$env:LOVEBINARYDIRECTORY/olympus.love -AsByteStream -ReadCount 0 | Set-Content love-glued -AsByteStream
}
Remove-Item -Path love/$env:LOVEBINARYDIRECTORY/$env:LOVEBINARY -Force
Move-Item -Path love-glued -Destination love/$env:LOVEBINARYDIRECTORY/$env:LOVEBINARY
Remove-Item -Path love/$env:LOVEBINARYDIRECTORY/olympus.love -Force
# Copy luarocks.
- task: CopyFiles@2
Expand Down Expand Up @@ -322,7 +294,7 @@ steps:
Remove-Item -Path love/game.ico -Force
Remove-Item -Path love/love.ico -Force
Remove-Item -Path love/lovec.exe -Force
Move-Item -Path love/love.exe -Destination love/main.exe
Copy-Item -Path icon.ico -Destination love/icon.ico
New-Item -Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY/main -ItemType Directory
Compress-Archive -Path love/* -DestinationPath $env:BUILD_ARTIFACTSTAGINGDIRECTORY/main/dist.zip -Force
New-Item -Path $env:BUILD_ARTIFACTSTAGINGDIRECTORY/update -ItemType Directory
Expand Down
2 changes: 1 addition & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ and only contains the latest changes.
Its purpose is to be shown in Olympus when updating.

#changelog#
Do not create scripts on-the-fly and run them on Mac and Linux to suppress output, as this causes "permission denied" issues on some distributions
Ship unaltered love2d on Windows instead of following the release procedure, since this seems to fix issues for some people
14 changes: 3 additions & 11 deletions launcher-winforms/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,15 @@ namespace Olympus {
static class Program {

public static string InstallDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Olympus");
public static string MainPath = Path.Combine(InstallDir, "main.exe");
public static string MainPath = Path.Combine(InstallDir, "love.exe");
public static string ConfigDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Olympus");
public static string LogPath = Path.Combine(ConfigDir, "log-launcher.txt");

public static string[] Args;

[STAThread]
static void Main(string[] args) {
static void Main() {
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture;
CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture;

Args = args;

if (!Directory.Exists(InstallDir))
Directory.CreateDirectory(InstallDir);
if (!Directory.Exists(ConfigDir))
Expand Down Expand Up @@ -90,11 +86,7 @@ public static bool StartMain() {
Process process = new Process();
process.StartInfo.FileName = MainPath;
process.StartInfo.WorkingDirectory = InstallDir;
process.StartInfo.Arguments = string.Join(" ", Args.Select(arg => {
arg = Regex.Replace(arg, @"(\\*)" + "\"", @"$1\$0");
arg = Regex.Replace(arg, @"^(.*\s.*?)(\\*)$", "\"$1$2$2\"");
return arg;
}));
process.StartInfo.Arguments = "\"" + Path.Combine(Path.GetDirectoryName(MainPath), "olympus.love") + "\"";
process.Start();
return true;
}
Expand Down
3 changes: 3 additions & 0 deletions sharp/CmdRestart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public override string Run(string exe) {
}

process.StartInfo.FileName = exe;
#if WIN32
process.StartInfo.Arguments = "\"" + Path.Combine(Path.GetDirectoryName(exe), "olympus.love") + "\"";
#endif
Environment.CurrentDirectory = process.StartInfo.WorkingDirectory = Path.GetDirectoryName(exe);

Console.Error.WriteLine($"Starting Olympus process: {exe}");
Expand Down
2 changes: 1 addition & 1 deletion sharp/CmdWin32AppUninstall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public override string Run(bool quiet) {
string selfDirectory = Path.GetDirectoryName(selfPath);
if (string.IsNullOrEmpty(root)) root = Path.GetDirectoryName(selfDirectory);

if (!File.Exists(Path.Combine(root, "main.exe")) ||
if (!File.Exists(Path.Combine(root, "love.exe")) ||
!File.Exists(Path.Combine(root, "love.dll")) ||
!Directory.Exists(Path.Combine(root, "sharp"))) {
if (!quiet)
Expand Down
6 changes: 4 additions & 2 deletions sharp/CmdWin32CreateShortcuts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ public override string Run(string exepath) {
public static void CreateShortcut(string exepath, string lnkpath) {
IShellLink link = (IShellLink) new ShellLink();
link.SetDescription("Launch Olympus");
link.SetPath(exepath);
link.SetPath(Path.Combine(Path.GetDirectoryName(exepath), "love.exe"));
link.SetArguments("\"" + Path.Combine(Path.GetDirectoryName(exepath), "olympus.love") + "\"");
link.SetIconLocation(Path.Combine(Path.GetDirectoryName(exepath), "icon.ico"), 0);
link.SetWorkingDirectory(Directory.GetParent(exepath).FullName);
((IPersistFile) link).Save(lnkpath, false);
}
Expand Down Expand Up @@ -53,4 +55,4 @@ internal interface IShellLink {

}
}
#endif
#endif
25 changes: 15 additions & 10 deletions src/modinstaller.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,32 @@ function modinstaller.register()
local userOS = love.system.getOS()

if userOS == "Windows" then
local retval = false

local exepath = love.filesystem.getSource()
if (exepath:match(".exe$") and
if (exepath:match(".love") and
registry.setKey([[HKCU\Software\Classes\Everest\]], "URL:Everest") and
registry.setKey([[HKCU\Software\Classes\Everest\URL Protocol]], "") and
registry.setKey([[HKCU\Software\Classes\Everest\shell\open\command\]], string.format([["%s" "%%1"]], exepath)))
registry.setKey([[HKCU\Software\Classes\Everest\shell\open\command\]],
string.format([["%s" "%s" "%%1"]], exepath:gsub("olympus.love$", "love.exe"), exepath)))
then

-- While we're here, might as well register the application properly.
print("updating installed application listing")
sharp.win32AppAdd(exepath, utils.trim(utils.load("version.txt") or "?"))
retval = true
end

-- While we're here, might as well create some helpful .lnks
-- INTRODUCED AFTER BUILD 1531
if config.lastrun < 0 or config.lastrun <= 1531 then
print("creating shortcuts", exepath)
sharp.win32CreateShortcuts(exepath)
end

return true
-- While we're here, might as well create some helpful .lnks
-- Updated on build 4650
if config.lastrun <= 4650 then
print("creating shortcuts", exepath)
sharp.win32CreateShortcuts(exepath)
retval = true
end

return retval

elseif userOS == "OS X" then
return false

Expand Down
2 changes: 1 addition & 1 deletion src/registry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ end
registry.setKey = registry.setKeySharp


-- Fuck LuaCOM. Besides the fact that it likes to not work at random, it also keeps main.exe alive.
-- Fuck LuaCOM. Besides the fact that it likes to not work at random, it also keeps love.exe alive.
--[[
local luacomStatus, luacom = pcall(require, "luacom")
if luacomStatus and luacom then
Expand Down

0 comments on commit 56a3a64

Please sign in to comment.