V4 - 60008 Troubleshooting

I am trying to package a very simple app (Notepad++) and keep getting the subjected error.

If I use the same scripting for any other app, it works fine.

I am assuming it doesnt like something at the start of the install sequence:

But, that works for every other installation.

Are there any logs generated for when we get this error as I am at a loss as to what it is grumbling at?

Hi Gordy,

try to comment out the “Show-ADTInstallationWelcome” message. i think there is a problem with the “++” from Notepad++

Hi, thanks for the reply.

I ended up just redoing the entire script line by line and initiating the install locally and it now works, but it would be useful if the kit produced a log to troubleshoot when we receive a 6008 error.

The problem is if you’ve got a syntax error of some kind that’s impacting the script before Open-ADTSession is even called, not much we can do about it.

I assume you’ve been testing using the exe? In a single word: don’t. Test from PowerShell directly by invoking the script and if there’s an issue due to syntax or something else, the error will be right there in the console for you.

In the 3.x version, I added code my front script to handle errors that occurred before AppDeployToolkitMain.ps1 got to load. I’m going to need it in my v4.x fork so I’ll work on that tomorrow.

From the PSADT side, we’ve got to balance how complex we make Invoke-AppDeployToolkit.ps1 otherwise the file could be overwhelming to the point it alienates new users.

I just replaced this:

} 
catch
{
    $Host.UI.WriteErrorLine((Out-String -InputObject $_ -Width ([System.Int32]::MaxValue)))
    exit 60008
}


##================================================
## MARK: Invocation
##================================================

with this:

} 
catch 
{
    $Host.UI.WriteErrorLine((Out-String -InputObject $_ -Width ([System.Int32]::MaxValue)))
    #Creates log file in %temp%\Invoke-AppDeployToolkit.log
    [String]$mainErrorMessage = @{'Message:' = "$($_.Exception.Message)";'ScriptStackTrace:'="$($_.ScriptStackTrace)";'InnerException:'="$($_.Exception.InnerException)"} `
        | Format-Table -AutoSize -Wrap -HideTableHeaders | Out-String
    [String]$AlternateLogPath = "$Env:TEMP\$(($MyInvocation.MyCommand.name) -replace '.ps1','.log' )"
    Set-Content -Path $AlternateLogPath -Value "ExitCode = [$mainExitCode] `r`n [$mainErrorMessage]" -ErrorAction SilentlyContinue
    Write-error "ExitCode = [$mainExitCode] `r`n [$mainErrorMessage]"
    Start-Sleep -Seconds 4 # so that you have time to read it.
    exit 60008
}


##================================================
## MARK: Invocation
##================================================

Ugly? yes, but it works.
but you can remove the parts you don’t like.

1 Like