SCCM Install issue

I’m new to using this toolkit, so please excuse my ignorance. I am trying to deploy SpaceClaim via SCCM. I have the msi in the Files dir and another exe in the SupportFiles dir that sets my license server path. When I run Deploy-Application.exe via an Admin PS session, it works fine, everything installs/runs. When the application is deployed from SCCM, the secondary exe doesn’t seem to run to set the path. I’m not sure if this is a toolkit issue or SCCM.

The program is installing with system context

“Deploy-Application.exe” -DeploymentType Install -DeployMode NonInteractive

##===============================================
##
INSTALLATION
##*===============================================
[string]$installPhase = ‘Installation’

	## Handle Zero-Config MSI Installations
	If ($useDefaultMsi) {
		[hashtable]$ExecuteDefaultMSISplat =  @{ Action = 'Install'; Path = $defaultMsiFile }; If ($defaultMstFile) { $ExecuteDefaultMSISplat.Add('Transform', $defaultMstFile) }
		Execute-MSI @ExecuteDefaultMSISplat; If ($defaultMspFiles) { $defaultMspFiles | ForEach-Object { Execute-MSI -Action 'Patch' -Path $_ } }
	}

	## <Perform Installation tasks here>

        Execute-MSI -Path "$scriptDirectory\Files\Installer.msi"

	##*===============================================
	##* POST-INSTALLATION
	##*===============================================
	[string]$installPhase = 'Post-Installation'

	## <Perform Post-Installation tasks here>
        Execute-Process "$scriptDirectory\SupportFiles\SetMachineEnv.exe" -Parameters 'SPACECLAIM_LICENSE_FILE PORT@SERVER'

	## Display a message at the end of the install
	If (-not $useDefaultMsi) { Show-InstallationPrompt -Message 'You can customize text to appear at the end of an install or remove it completely for unattended installations.' -ButtonRightText 'OK' -Icon Information -NoWait }
}
ElseIf ($deploymentType -ieq 'Uninstall')
{

I’d like to help but you need to force the SetMachineEnv.exe to do logging.

To do that, look at Tips & Tricks - PSAppDeployToolkit Community

If I had to guess:
1-the EXE needs certain Environment variables set that are missing when you run as system.

2-It’s a 64bit EXE wrapper extracting a 32bit EXE (or vice-versa). System has 2 %temp% folders: 32 and 64 bit. The wrapper extracts the other EXE but cannot find it in its own profile.

FYI:
$scriptDirectory\SupportFiles = $dirSupportFiles

You can use powershell directly to set the environment variable instead of using the SetMachineEnv.exe

[System.Environment]::SetEnvironmentVariable('SPACECLAIM_LICENSE_FILE','PORT@SERVER',[System.EnvironmentVariableTarget]::Machine)

If you still want to run the exe, probably that SetMachineEnv.exe is a console executable and can run only in console mode, so you can try to add the parameter:
-UseShellExecute $true