Skip to content

[FEATURE REQUEST] Pre/Post install hooks #3221

Closed

Description

Please confirm these before moving forward.

  • I have searched for my feature proposal and have not found a work-in-progress/duplicate/resolved/discarded issue.
  • This proposal is a completely new feature. If you want to suggest an improvement or an enhancement, please use this template.

Describe the new feature

The feature would allow users to create/specify an arbitrary script Batch/PowerShell to be executed pre-install and/or post-install of a package.

Describe how this new feature could help users

For me personally, the primary motivation is that some packages will persistently fail to install, due to part of them being in use by other software, for example OBS as mentioned in #3095.

Allowing the user to add a pre-install script would allow them to kill off the processes using that package in their preferred way, have the install proceed without failure due to the example issue, and then perhaps restart them post-install if they so wish.

This is more of a convenience thing IMO as some interactive installers allow this (as noted in that issue), although as also noted in that issue, many do not have such feature. Besides that, being able to automate it without user interaction would be very convenient.

Activity

  1. added
    new-feature
    on Jan 23, 2025
  2. marticliment commented on Jan 23, 2025

    @marticliment
    Collaborator

    Duplicate of #3038 and #2160

  3. PurplProto commented on Jan 23, 2025

    @PurplProto
    Author

    Not sure how I missed #3038, my bad! I'll be following that thread, thanks 🙂

  4. the-sloth commented on Apr 25, 2025

    @the-sloth

    Any updates on this feature request regarding the implementation of Pre/Post install hooks?

  5. marticliment commented on Jun 20, 2025

    @marticliment
    Collaborator

    Hello,

    I have published a PreRelease version of UniGetUI that allows to specify pre/post install/update/uninstall commands/scripts. I'd appreciate if you could test it and provide some feedback.

    Thanks!
    Download link: 3.2.1-beta1 (release)

  6. PurplProto commented on Jun 23, 2025

    @PurplProto
    Author

    Hey Martí Climent (@marticliment), I got around to giving this a try and so far, I've noticed just one minor issue. It seems the changes are not saved unless you perform an action like install, uninstall or update the package.

    For example:

    • Search for an installed package, i.e. OBS
    • Right click and select package details
    • Click on the "Close apps before installing" tab
    • Add "notepad.exe"
    • Click the Close X button on the package details dialogue
    • Right-click the package again and select package details
    • Navigate back to the "Close apps before installing" tab
    • Observe an empty list of apps to terminate

    I've noticed this happens for other options too, i.e. checking the interactive installation option doesn't seem to persist either unless you perform an action, i.e. uninstall and then cancel when it asks "Are you sure..." afterwards. I've checked this on v3.2.0 and the same issue occurs there. Therefore, I believe this isn't a newly introduced problem, but it could potentially cause some headaches for users in the future. Perhaps they need to update the list or change a pre/post install hook, but there's no update for the package they're changing this on. Since there's no explicit save button, one would assume it would save automatically when closing the dialogue, but it does not.

    Back to the new feature though, it seems to be working well for me! Appreciate the addition of admin required to enable this as well, especially for imported package bundles. I've not tried the package bundle import yet, but if it doesn't exist already, it would definitely be worth adding a warning on import if it does contain pre/post hooks, even when the user has the option for it enabled. You can't be too safe! 🙂

  7. marticliment commented on Jun 24, 2025

    @marticliment
    Collaborator

    It seems the changes are not saved unless you perform an action like install, uninstall or update the package.

    Perhaps a dumb question, but just to make sure: are you clicking the save and close button?

    Image

  8. marticliment commented on Jun 24, 2025

    @marticliment
    Collaborator

    Back to the new feature though, it seems to be working well for me! Appreciate the addition of admin required to enable this as well, especially for imported package bundles. I've not tried the package bundle import yet, but if it doesn't exist already, it would definitely be worth adding a warning on import if it does contain pre/post hooks, even when the user has the option for it enabled. You can't be too safe! 🙂

    When a bundle has pre/post hooks, UniGetUI will warn you, will show you the actual hooks, and will tell you if they will be ignored or not (depending on your settings)

  9. PurplProto commented on Jun 24, 2025

    @PurplProto
    Author

    It seems the changes are not saved unless you perform an action like install, uninstall or update the package.

    Perhaps a dumb question, but just to make sure: are you clicking the save and close button?

    Image

    I do not seem to have these buttons 😅

    Image

    Looks like I have the correct beta installed too 🤔

    Image

    I ran the 3.2.0 installer and I don't have buttons there either to save and close. The logs don't seem to show apparent issues/errors even on the Information (debug) level. Happy to try any suggestions you have to see why this is happening.

  10. marticliment commented on Jun 25, 2025

    @marticliment
    Collaborator

    Oh, I see where the confusion comes from.
    There are two way to open install options, from package details or right-clicking a package -> install options.

    There is no save button on the package details page, and I will fix this

  11. PurplProto commented on Jun 25, 2025

    @PurplProto
    Author

    Oh, I see where the confusion comes from. There are two way to open install options, from package details or right-clicking a package -> install options.

    Ahh, that route is working great!

    Appreciate the feature. I've tried it a handful of times now with different packages as updates have become available, and a few installations and uninstalls with OBS, at least. No issues found! 🙂

  12. marticliment commented on Jul 3, 2025

    @marticliment
    Collaborator

    Next version will have a "Save" button also on the InstallOptions dialog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

new-feature

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions