fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Default install script for .exe doesn't work in most cases

Open willmayhone88 opened this issue 7 months ago • 21 comments

Fleet version: 4.52.0, fleetd version 1.27.0

Web browser and operating system: Windows 11 23H2


💥  Actual behavior

Uploaded a package (Notion Setup 3.9.3.exe) using the ui. On host device page, selected the software and then selected the install option. Software did not perform the installation, it just copied the exe file to "C:\Program Files\Notion Setup 3.9.3". From there I can install it locally on the device, but the expected behavior would be that it actually performs the installation of the software.

🧑‍💻  Steps to reproduce

  1. Add .exe package to fleet
  2. Install software via device page

🕯️ More info (optional)

Need to reproduce with other exe files. This behavior does not occur when deploying .msi files. The error may be due to it not properly installing in the user context.

UPDATE: converting this one to feature request, since we need to improve default uninstall script (which is used for cleanup, in case post-install script fails)

🛠️ To fix

Next steps:

  1. Update the default install script for .exe to:
# Learn more about .exe install scripts: http://fleetdm.com/learn-more-about/exe-install-scripts

$exeFilePath = "${env:INSTALLER_PATH}"

# Add argument to install silently
# Argument to make install silent depends on installer,
# each installer might use different argument (usually it's "/S" or "/s")
$processOptions = @{
  FilePath = "$exeFilePath"
  ArgumentList = "/S"
  PassThru = $true
  Wait = $true
}

# Start process and track exit code
$process = Start-Process @processOptions
$exitCode = $process.ExitCode

# Prints the exit code
Write-Host "Install exit code: $exitCode"
  1. Transform this commentto the article about .exe installation (device-wide, user-wide, and raw executables)
  2. In default script: in the comment point to article with redirect (UI links)
  3. Test scripts from the comment with following apps: 1Password, Yubi Key Manager, Mozilla Firefox, Notion, FileZilla, Zoom, and Figma
  4. Default script redirect: PR

willmayhone88 avatar Jun 25 '24 21:06 willmayhone88