Forum Discussion
Hi Mike,
I've checked the %localappdata% path for the SYSTEM account after a failed install attempt and there was no output of a SquirrelTemp folder.
For reference, this is the script I've used previously. When running as SYSTEM it fails, when running as a local administrator, it works fine.
TLDR: Save the below as a .ps1 file, call it using `ScriptName.ps1 -version 2026.6`
It will download the latest version, and attempt to install it.
[CmdletBinding()]
param(
# Version to install; this is passed through to URL and installer args.
[Parameter(Mandatory = $true)]
[string]$Version,
# URL template must contain "{version}" placeholder.
[string]$DownloadUrlTemplate = "https://download.myob.com/arl/MYOB_AccountRight_Setup_{version}.exe",
# Extra installer arguments passed through as-is.
[string[]]$InstallerArguments = @("-allusers")
)
$ErrorActionPreference = "Stop"
function Get-InstalledMyobVersion {
param(
[Parameter(Mandatory = $true)]
[string]$TargetVersion
)
$uninstallPaths = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*",
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
)
$entries = foreach ($path in $uninstallPaths) {
Get-ItemProperty -Path $path -ErrorAction SilentlyContinue
}
$expectedDisplayName = "MYOB AccountRight $TargetVersion"
$myobEntry = $entries |
Where-Object { $_.DisplayName -eq $expectedDisplayName } |
Select-Object -First 1
return $myobEntry.DisplayName
}
$installedVersion = Get-InstalledMyobVersion -TargetVersion $Version
if ($installedVersion) {
Write-Output "MYOB version $Version is already installed. Nothing to do."
exit 0
}
$downloadUrl = $DownloadUrlTemplate.Replace("{version}", $Version)
$tempInstaller = Join-Path 'c:\temp' ("MYOB_AccountRight_Setup_{0}.exe" -f $Version)
Write-Output "Download URL: $downloadUrl"
Write-Output "Temporary installer path: $tempInstaller"
if (-Not (Test-Path -Path $tempInstaller)) {
Write-Output "Temporary installer not found at $tempInstaller. Will download."
Write-Output "Downloading from $downloadUrl"
try {
Invoke-WebRequest -Uri $downloadUrl -OutFile $tempInstaller
} catch {
throw "Failed to download MYOB installer from $downloadUrl. $_"
}
if (-not (Test-Path -Path $tempInstaller)) {
throw "Downloaded installer not found at $tempInstaller."
}
} else {
Write-Output "Temporary installer already exists at $tempInstaller. Will re-download."
}
Write-Output 'Swapping Install Mode...'
change user /install ##Tested to see if this would fix the SYSTEM issue on Terminal / Multi-user hosts. It doesn't
Write-Output "Running installer..."
$process = Start-Process -FilePath $tempInstaller -ArgumentList $InstallerArguments -Wait
if ($process.ExitCode -ne 0) {
throw "MYOB installer failed with exit code $($process.ExitCode)."
}
$postInstallVersion = Get-InstalledMyobVersion -TargetVersion $Version
if ($postInstallVersion) {
Write-Output "MYOB $Version installed successfully."
Remove-Item -Path $tempInstaller -Force
} else {
throw "Install completed but expected app name 'MYOB AccountRight $Version' was not detected."
}
Thank you jbiskit - I have passed your email to the team who are looking into this. I think it will be easier to connect with them directly instead of having this thread as the middleman.
Really appreciate you connecting with me via the forum on this though! Hopefully we can publish an update on how this was fixed soon
Looking for something else?
Search the Community Forum for answers or find your topic and get the conversation started!
Learn, solve, grow
Level up your skills and find answers across all MYOB products