Skip to content

Instantly share code, notes, and snippets.

@MobCat
Created June 22, 2025 06:10
Show Gist options
  • Save MobCat/533e9d9de808096886ce7595debbd19e to your computer and use it in GitHub Desktop.
Save MobCat/533e9d9de808096886ce7595debbd19e to your computer and use it in GitHub Desktop.
scriptTitle = "Aurora Disc to GOD installer"
scriptAuthor = "Phoenix / MobCat"
scriptVersion = 2
scriptDescription = "Installs the current disc as Game On Demand (GOD) on a local storage device."
scriptIcon = "icon\\icon.xur"
-- This script has been modifyed by MobCat
-- It no longer askes the user any silly lil promps
-- It just automatily install the GoD to \Xbox360\System\Hdd1\Content\0000000000000000\
-- Define script permissions to enable access to libraries
scriptPermissions = { "filesystem", "content" }
-- Define used enums
FilebrowserFlag = enum {
ShowFiles = 0x01,
BaseDirAsRoot = 0x02,
HideCreateDir = 0x04,
DisableHomeDrives = 0x08,
DeviceSelect = 0x10,
SelectDirectory = 0x20
}
NotificationType = enum {
Information = 0,
System = 1,
Warning = 2,
Error = 3,
XAM = 4
}
DiscInstallerCallbackReason = enum {
ParseStart = 0x01,
ParseComplete = 0x02,
PathsPrepared = 0x03,
ChunkCreate = 0x04,
ChunkTransfer = 0x05,
HashStart = 0x06,
HashComplete = 0x07,
HeaderCreated = 0x08,
CleanupStart = 0x09,
CleanupComplete = 0x10
}
DiscInstallerReturnCommand = enum {
Continue = 0x01,
Cancel = 0x02,
Quiet = 0x03
}
-- Mimic a switch / case statement
function switch(value, cases)
return cases[value]
end
-- Global states
local WasCanceled = false
local ShouldCleanup = false
local CleanupDone = false
-- Main entry point to script
function main()
-- Don't allow abort before writing starts
Script.SetCancelEnable(false)
-- Return values
local ret
-- Initialize targetPath and createContentDir
local targetPath = ""
local createContentDirs = false
--TODO: Find out how we can get info about the disc or at least get info about default.xbx on the disk
-- For now though, just let it rip no messages.
--ret = Script.ShowMessageBox("Install this disc contnet to your xbox hdd?", "Yes", "No")
-- Get installation path
targetPath = "\\Xbox360\\System\\Hdd1\\Content\\0000000000000000\\"
-- Ask if content dirs should be created
createContentDirs = true;
-- Update status
Script.SetStatus("Preparing to install disc");
-- Install the disc
local installed = FileSystem.InstallTitleFromDisc(targetPath, createContentDirs, progressRoutine);
-- Check if installation was successful
if installed then
-- Update status
Script.SetStatus("Disc installed...");
-- Show notification
Script.ShowNotification("Disc installed successfully");
-- Ask if content should be scanned
if Content.StartScan() == true then
Script.ShowNotification("Content Scan started");
else
Script.ShowNotification("Unable to start Content Scan", NotificationType.Warning);
end
else
-- Update status
Script.SetStatus("Disc install " .. (WasCanceled and "canceled" or "failed"));
-- Show notification if cleanup failed
if ShouldCleanup ==true and CleanupComplete == false then
Script.ShowNotification("File cleanup failed, view log for more information", NotificationType.Warning)
end
end
end
-- Handle progress callback
function progressRoutine(totalfilesize, filesize, chunksize, totalchunksize, chunknumber, chunkcount, callbackreason)
-- Define status strings
local cases = {
[DiscInstallerCallbackReason.ParseStart] = "Parsing disc",
[DiscInstallerCallbackReason.ParseComplete] = "Parse complete",
[DiscInstallerCallbackReason.PathsPrepared] = "Paths prepared",
[DiscInstallerCallbackReason.ChunkCreate] = "DATA file created",
[DiscInstallerCallbackReason.ChunkTransfer] = "DATA file transfering",
[DiscInstallerCallbackReason.HashStart] = "Hash start",
[DiscInstallerCallbackReason.HashComplete] = "Hash complete",
[DiscInstallerCallbackReason.HeaderCreated] = "Header created",
[DiscInstallerCallbackReason.CleanupStart] = "Cleanup start",
[DiscInstallerCallbackReason.CleanupComplete] = "Cleanup complete"
}
-- Initialize continue
local continue = DiscInstallerReturnCommand.Continue
-- Set progressbar
Script.SetProgress(filesize, totalfilesize);
-- Allow abort when not parsing or cleaning up
if callbackreason >= DiscInstallerCallbackReason.PathsPrepared and callbackreason < DiscInstallerCallbackReason.CleanupStart then
if Script.IsCancelEnabled() == false then Script.SetCancelEnable(true) end
else
if Script.IsCancelEnabled() == true then Script.SetCancelEnable(false) end
end
-- Define the status text
local stat = switch(callbackreason, cases)
-- Add chunk number if needed
if callbackreason >= DiscInstallerCallbackReason.ChunkCreate and callbackreason <= DiscInstallerCallbackReason.ChunkTransfer then
stat = stat .. " [" .. tostring(chunknumber) .. "/" .. tostring(chunkcount) .. "]"
end
-- Set status text if changed
if Script.GetStatus() ~= stat then Script.SetStatus(stat) end
-- Ask for cleanup if canceled or failed
if callbackreason == DiscInstallerCallbackReason.CleanupStart then
-- Cleanup is needed
ShouldCleanup = true
-- Show notification
Script.ShowNotification("Disc installation " .. (WasCanceled and "canceled" or "failed"),
WasCanceled and NotificationType.Warning or NotificationType.Error);
-- Allow cleanup to be canceled
ret = Script.ShowMessageBox("Cleanup", "Cleanup files and (empty) directories?\n\nThis will attempt to delete all data files,\nthe data directory and content directories\n(if applicable).", "No", "Yes");
if ret.Button == 1 then
continue = DiscInstallerReturnCommand.Cancel
-- Cleanup is canceled
ShouldCleanup = false
end
else
-- Cancel disc installation if Abort is pressed
if Script.IsCanceled() then
continue = DiscInstallerReturnCommand.Cancel
WasCanceled = true
end
end
-- Ask for cleanup if canceled or failed
if callbackreason == DiscInstallerCallbackReason.CleanupComplete then
-- Set cleanup completed
CleanupComplete = true
-- Show notification
Script.ShowNotification("File cleanup completed")
end
-- Return if the script should be continued
return continue
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment