Issue deploying .exe from Intune

Hi i’m a relative newbie to the PSADT and app deployment world. I’ve packaged a few msi’s with no issue, but whenever i try .exe files, i seem to get problems.

I’m trying to package the AMD Adrenalin edition 24.1.1 software. The script runs fine when testing on my machine when elevated as System, but it fails whenever I run it from Intune, with the The application was not detected after installation completed successfully (0x87D1041C) error.

Here is my below script and Intune config settings. Any advice would be very welcome. Thanks.

    If ($deploymentType -ine 'Uninstall' -and $deploymentType -ine 'Repair')
    {
        ##*===============================================
        ##* PRE-INSTALLATION
        ##*===============================================
        [String]$installPhase = 'Pre-Installation'

        ## Show Welcome Message, close Internet Explorer if required, allow up to 3 deferrals, verify there is enough disk space to complete the install, and persist the prompt
        Show-InstallationWelcome -CheckDiskSpace -DeferTimes 3

        ## Show Progress Message (with the default message)
        Show-InstallationProgress

        ## <Perform Pre-Installation tasks here>


        ##*===============================================
        ##* INSTALLATION
        ##*===============================================
        [String]$installPhase = 'Installation'

        #
          
      Execute-Process -Path 'whql-amd-software-adrenalin-edition-24.1.1-win10-win11-jan23-rdna.exe'



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

    }
    ElseIf ($deploymentType -ieq 'Uninstall') {
        ##*===============================================
        ##* PRE-UNINSTALLATION
        ##*===============================================
        [String]$installPhase = 'Pre-Uninstallation'

        ## Show Welcome Message, close Internet Explorer with a 60 second countdown before automatically closing
        Show-InstallationWelcome -CloseApps 'iexplore' -CloseAppsCountdown 60

        ## Show Progress Message (with the default message)
        Show-InstallationProgress

        ## <Perform Pre-Uninstallation tasks here>


        ##*===============================================
        ##* UNINSTALLATION
        ##*===============================================
        [String]$installPhase = 'Uninstallation'

        $msiguid = get-ciminstance win32_product | where-object { $_.name -like "AMD Settings" } | select identifyingnumber -expandproperty identifyingnumber
        start-process C:\windows\system32\msiexec.exe -argumentlist "/x $msiguid /qn /norestart" -wait


        ## <Perform Uninstallation tasks here>


        ##*===============================================
        ##* POST-UNINSTALLATION
        ##*===============================================
        [String]$installPhase = 'Post-Uninstallation'

        ## <Perform Post-Uninstallation tasks here>


    }
    ElseIf ($deploymentType -ieq 'Repair') {
        ##*===============================================
        ##* PRE-REPAIR
        ##*===============================================
        [String]$installPhase = 'Pre-Repair'

        ## Show Welcome Message, close Internet Explorer with a 60 second countdown before automatically closing
        Show-InstallationWelcome -CloseApps 'iexplore' -CloseAppsCountdown 60

        ## Show Progress Message (with the default message)
        Show-InstallationProgress

        ## <Perform Pre-Repair tasks here>

        ##*===============================================
        ##* REPAIR
        ##*===============================================
        [String]$installPhase = 'Repair'

        ## Handle Zero-Config MSI Repairs
        If ($useDefaultMsi) {
            [Hashtable]$ExecuteDefaultMSISplat = @{ Action = 'Repair'; Path = $defaultMsiFile; }; If ($defaultMstFile) {
                $ExecuteDefaultMSISplat.Add('Transform', $defaultMstFile)
            }
            Execute-MSI @ExecuteDefaultMSISplat
        }
        ## <Perform Repair tasks here>

        ##*===============================================
        ##* POST-REPAIR
        ##*===============================================
        [String]$installPhase = 'Post-Repair'

        ## <Perform Post-Repair tasks here>


    }
    ##*===============================================
    ##* END SCRIPT BODY
    ##*===============================================

    ## Call the Exit-Script function to perform final cleanup operations
    Exit-Script -ExitCode $mainExitCode
}
Catch {
    [Int32]$mainExitCode = 60001
    [String]$mainErrorMessage = "$(Resolve-Error)"
    Write-Log -Message $mainErrorMessage -Severity 3 -Source $deployAppScriptFriendlyName
    Show-DialogBox -Text $mainErrorMessage -Icon 'Stop'
    Exit-Script -ExitCode $mainExitCode
}

Install command
deploy-application.exe -deploymenttype install

Uninstall command
deploy-application.exe -deploymenttype uninstall

Installation time required (mins)
60

Allow available uninstall
Yes

Install behavior
System

Device restart behavior
App install may force a device restart

Return codes
0 Success
1707 Success
3010 Soft reboot
1641 Hard reboot
1618 Retry

Requirements

Edit
Operating system architecture
x64

Minimum operating system
Windows 11 22H2

Disk space required (MB)
No Disk space required (MB)

Physical memory required (MB)
No Physical memory required (MB)

Minimum number of logical processors required
No Minimum number of logical processors required

Minimum CPU speed required (MHz)
No Minimum CPU speed required (MHz)

Additional requirement rules
No Additional requirement rules

Detection rules

Edit
Rules format
Manually configure detection rules

Detection rules
Registry Computer\HKEY_LOCAL_MACHINE\SOFTWARE\AMD\CN

If it installed successfully but Intune doesn’t see it, it’s an Intune issue. Not a PSADT issue.

You could try this utility on the target to confirm.

Reddit has an Intune sub-Reddit.

This error appears in the log over and over but i’m not sure what it means:

[Win32App] Failed to parse appResultCreatedTimeUTC with IntuneManagementExtension 08/03/2024 15:12:30 153 (0x0099)
GetRegistryValue encountered an exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Management.Services.IntuneWindowsAgent.AgentCommon.RegistryHelper.GetRegistryValue(String key, String valueName, String defaultValue, Boolean check32BitOn64) IntuneManagementExtension 08/03/2024 15:12:30 153 (0x0099)

I think it means your detection method failed.
Again, not a PSADT issue.

But if i install the app manually, then Company Portal detects that the app is now installed, so the detection rule must be working? Which is why i’m convinced that it is the PS Script even though it works when run manually.

Weirdly, the uninstall from Company Portal works too, it’s just the install.

Then it’s being installed differently with Intune under the SYSTEM account.

Take PSADT out of the picture and install the EXE directly with Intune.
It should fail.

Thanks it appears to be something to do with the install behaviour as opposed to PSADT like you said. It works fine if i set the behaviour to user but fails when set to system. Still not sure why it’s not working but i’ll try and find another forum to ask that question. Thanks for your help.

1 Like

If anyone is interested, the issue was fixed by including the ServiceUI.exe tool to let the install run interactively on the user account.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.