-
Notifications
You must be signed in to change notification settings - Fork 502
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
Remove default EXE install/uninstall scripts, require entering install/uninstall scripts on EXE upload #27268
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #27268 +/- ##
==========================================
- Coverage 63.72% 63.72% -0.01%
==========================================
Files 1747 1748 +1
Lines 165935 166129 +194
Branches 4518 4583 +65
==========================================
+ Hits 105748 105866 +118
- Misses 51924 51987 +63
- Partials 8263 8276 +13
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Use the $INSTALLER_PATH variable to point to the installer.{" "} | ||
{getSupportedScriptTypeText(pkgType)}.{" "} | ||
<CustomLink | ||
url={`${LEARN_MORE_ABOUT_BASE_LINK}/exe-install-scripts`} | ||
text="EXE install scripts must be built manually." | ||
newTab | ||
/>{" "} | ||
Fleet can automatically build install and uninstall scripts for MSI | ||
packages and Fleet-maintained Apps. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return ( | ||
<> | ||
$PACKAGE_ID will be populated with the {PKG_TYPE_TO_ID_TEXT[pkgType]}{" "} | ||
from the .{pkgType} file after the software is added.{" "} | ||
{getSupportedScriptTypeText(pkgType)}{" "} | ||
<CustomLink | ||
url={`${LEARN_MORE_ABOUT_BASE_LINK}/exe-install-scripts`} | ||
text="EXE uninstall scripts must be built manually." | ||
newTab | ||
/>{" "} | ||
Fleet can automatically build install and uninstall scripts for MSI | ||
packages and Fleet-maintained Apps. | ||
</> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
frontend/pages/SoftwarePage/components/PackageAdvancedOptions/PackageAdvancedOptions.tsx
Outdated
Show resolved
Hide resolved
$PACKAGE_ID will be populated with the {PKG_TYPE_TO_ID_TEXT[pkgType]}{" "} | ||
from the .{pkgType} file after the software is added.{" "} | ||
{getSupportedScriptTypeText(pkgType)}{" "} | ||
<CustomLink | ||
url={`${LEARN_MORE_ABOUT_BASE_LINK}/exe-install-scripts`} | ||
text="EXE uninstall scripts must be built manually." | ||
newTab | ||
/>{" "} | ||
Fleet can automatically build install and uninstall scripts for MSI | ||
packages and Fleet-maintained Apps. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$PACKAGE_ID will be populated with the {PKG_TYPE_TO_ID_TEXT[pkgType]}{" "} | |
from the .{pkgType} file after the software is added.{" "} | |
{getSupportedScriptTypeText(pkgType)}{" "} | |
<CustomLink | |
url={`${LEARN_MORE_ABOUT_BASE_LINK}/exe-install-scripts`} | |
text="EXE uninstall scripts must be built manually." | |
newTab | |
/>{" "} | |
Fleet can automatically build install and uninstall scripts for MSI | |
packages and Fleet-maintained Apps. | |
For Windows, Fleet only creates uninstall scripts for .msi packages. $PACKAGE_ID will be populated with the software name from the .exe file after it's added. | |
{getSupportedScriptTypeText(pkgType)}{" "} | |
<CustomLink | |
url={`${LEARN_MORE_ABOUT_BASE_LINK}/exe-install-scripts`} | |
text="Learn more" | |
newTab | |
/> |
return ( | ||
<> | ||
For Windows, Fleet only creates install scripts for .msi packages. Use the $INSTALLER_PATH variable to point to the installer. {" "} | ||
{getSupportedScriptTypeText(pkgType)}.{" "} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{getSupportedScriptTypeText(pkgType)}.{" "} | |
{getSupportedScriptTypeText(pkgType)}{" "} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this may result in a double period.
frontend/pages/SoftwarePage/components/PackageAdvancedOptions/PackageAdvancedOptions.tsx
Outdated
Show resolved
Hide resolved
frontend/pages/SoftwarePage/components/PackageAdvancedOptions/PackageAdvancedOptions.tsx
Outdated
Show resolved
Hide resolved
url={`${LEARN_MORE_ABOUT_BASE_LINK}/exe-install-scripts`} | ||
text="Learn more" | ||
newTab | ||
/>{" "} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/>{" "} | |
/> |
We don't need this right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This inserts a space, so not unless there's text after it.
@@ -389,6 +392,9 @@ func (svc *Service) UpdateSoftwareInstaller(ctx context.Context, payload *fleet. | |||
if uninstallScript == "" { // extension can't change on an edit so we can generate off of the existing file | |||
uninstallScript = file.GetUninstallScript(existingInstaller.Extension) | |||
} | |||
if uninstallScript == "" { | |||
return nil, ctxerr.New(ctx, fmt.Sprintf("uninstall script must be provided for %s packages", strings.ToUpper(existingInstaller.Extension))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@iansltx I think we want the "Couldn't add. Install script is required for .exe packages":

Same tweak for uninstall error.
@iansltx jumping on finishing this now |
31ef6a3
to
9796ebf
Compare
Since the form originally has the Add software button disabled, I added validation to keep it disabled if .exe file was chosen but install and uninstall scripts are not filled out. See screenshots below. WDYT? @iansltx @noahtalerman ![]() ![]() ![]() |
Deferring to @noahtalerman on copy here, but the behavior LGTM! Nice and clear, and keeps folks from doing something that we know will fail server-side. |
7a68265
to
c7234d9
Compare
a56f5cb
to
1282182
Compare
…l/uninstall scripts on EXE upload For #27267. TODO: * Tests * GitOps requirements changes * Disabling add button/adding errors when required scripts aren't specified
…PackageAdvancedOptions.tsx Co-authored-by: Noah Talerman <47070608+noahtalerman@users.noreply.github.com>
…PackageAdvancedOptions.tsx
…PackageAdvancedOptions.tsx
…, revise uninstall copy based on @noahtalerman's suggestion
Still need to fix the integration test
1282182
to
20d860b
Compare
…s with parse errors when validating YAML If the URL path doesn't end with .exe, we'll still catch EXEs later in the process when the package is downloaded by Fleet, but for easier cases we might as well fail early.
@ghernandez345 Assigning you here since Rachel and I have both touched this on the FE side so this should get a separate set of eyes. @ksykulev Your review responsibilities are backend + gitops + associated tests only. |
For #27267.
Below is what's shown immediately after selecting an EXE:
TODO:
Checklist for submitter
If some of the following don't apply, delete the relevant line.
changes/
,orbit/changes/
oree/fleetd-chrome/changes
.See Changes files for more information.
SELECT *
is avoided, SQL injection is prevented (using placeholders for values in statements)