Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guide on EXE install scripts #22179

Merged
merged 3 commits into from
Sep 26, 2024
Merged

Conversation

getvictor
Copy link
Member

For #20000 (4.57.0)

@getvictor
Copy link
Member Author

@spokanemac @eashaw Once published, this link should point to the article: http://fleetdm.com/learn-more-about/exe-install-scripts


The use of scheduled tasks allows the installer to run with user-level permissions, which is especially useful when installing software for non-admin users without requiring administrator credentials at the time of execution.

Since the installation is run by the current user, the script does not output the installer's messages to the console. If you need to see the output, you can modify the script to redirect it to a file and append it to the script output.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@getvictor, do you think it's worth mentioning how to capture the installer output? Something like: (I'm gleaning this from another PowerShell script I had)

To capture the installer output in a log file, modify the Start-Process section of the script like this:

$processOptions = @{
    FilePath = $uninstallCommand
    PassThru = $true
    Wait = $true
    RedirectStandardOutput = 'C:\Path\To\LogFile.log'
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To run as user, we are using a scheduled task, and not Start-Process. I would need some time to figure out how to get logs from the task, and I wasn't planning on doing that as part of this issue. Let me know if you feel otherwise.

The bigger issue is that the user must be logged in, which makes user scripts unreliable. I filed a story for feature fest: #22200

@getvictor
Copy link
Member Author

@spokanemac Can you also review/fix the grammar in the install and uninstall (not remove) script comments at https://github.com/fleetdm/fleet/tree/main/pkg/file/scripts? Please keep the line width at 77 characters or less, since that is the width in the UI.

@getvictor
Copy link
Member Author

@spokanemac Should we publish this now?

@noahtalerman
Copy link
Member

@spokanemac just giving you another ping! Waiting on this guide to close out the user story: #20000

cc @getvictor

@spokanemac spokanemac merged commit 07a1ae4 into main Sep 26, 2024
5 checks passed
@spokanemac spokanemac deleted the victor/20000-exe-install-scripts branch September 26, 2024 19:19
RachelElysia pushed a commit that referenced this pull request Sep 30, 2024
For #20000 (4.57.0)

---------

Co-authored-by: JD <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:improve documentation Involves writing improvements or additions to documentation
Development

Successfully merging this pull request may close these issues.

4 participants