velopack icon indicating copy to clipboard operation
velopack copied to clipboard

Adding true MSI support

Open Keboo opened this issue 9 months ago • 6 comments

This is a major update to the msi files that Velopack can create for Windows. This is a breaking change for the vpk CLI. The only MSI deployment tool is replaced with this new --msi option. There is a sample branch under kdb/msi-example showing the usage with the Avalonia sample application. The updates are under the dev-scripts. Unlike the previous MSI deployment tool that was modeled after the Clowd.Squirrel (and parent Squirrel project) that just injects a registry key to run on the startup of each user and perform a per-user install, this MSI is a true installer that can be used as a replacement for the Setup.exe.

The MSI currently has the following behavior:

  • It will always display a UI
  • It leverages the previous --msiVersionOverride <Version> option to allow setting the MSI version as it is more restrictive than the normal version number.
  • It will default to a per machine level install, giving the user the option to select per user. The assumption here is that by using the MSI rather than the Setup.exe that the intent is either to support a sys admin or GPO install. Optionally the developer can remove this screen my specifying --instLocation perUser or --instLocation perMachine when running vpk pack to specify the location ahead of time. In these cases, the installation location dialog will not be shown to the user.
  • An optional license can be specified with --instLicense <License Markdown File>.
  • It offers very limited customization for the text content. It supports --instWelcome <Welcome Markdown File>, --instReadMe <Readme Markdown File>, and --instConclusion <Conclusion Markdown File>. Be aware that though these are markdown files, the MSI really only supports plain text in these fields so nearly all formatting is stripped out.
  • It does not currently expose the ability to leverage any localization parameter (this is expected to be handled with #60)
  • It supports setting the header and background bitmaps via the --msiBanner <Banner Bitmap> and --msiLogo <Background Bitmap> respectively. More discussion is needed on appropriate defaults for these.
  • It does not do the same bootstrapping of dependencies that the Setup.exe does.

Fixes #389

Keboo avatar Apr 08 '25 07:04 Keboo

Maybe side tracking but looking at the code, will this finally bring the option to launch the Uninstall.exe program as an elevated user ? https://github.com/velopack/velopack/pull/606/files#diff-0dd4454dd2f206a9de82749be468cdaeba3a0b81c37093e1fced6b0902698e72R13-R23

Really looking forward to this as I need to run commands before uninstalling my program like cleaning machine env variables which the current context doesn't allow ...

ubertil avatar Aug 20 '25 15:08 ubertil

This brings full elevation support if the program is installed for all users. All hooks will be elevated in that case.

caesay avatar Aug 20 '25 15:08 caesay

This brings full elevation support if the program is installed for all users. All hooks will be elevated in that case.

Awesome. Can't wait to have this available !

ubertil avatar Aug 20 '25 16:08 ubertil

Codecov Report

:x: Patch coverage is 39.14373% with 1393 lines in your changes missing coverage. Please review. :white_check_mark: Project coverage is 40.82%. Comparing base (fa48e3c) to head (cab8891). :warning: Report is 7 commits behind head on develop.

Files with missing lines Patch % Lines
src/lib-rust/src/process_win.rs 49.84% 166 Missing :warning:
src/bins/src/windows/splash.rs 25.11% 158 Missing :warning:
src/bins/src/shared/dialogs_windows.rs 0.74% 134 Missing :warning:
src/wix-dll/src/msi.rs 0.00% 97 Missing :warning:
src/vpk/Velopack.Packaging/Rtf/RtfRenderer.cs 0.00% 71 Missing :warning:
src/wix-dll/src/lib.rs 0.00% 71 Missing :warning:
src/lib-rust/src/process_unix.rs 0.00% 58 Missing :warning:
src/lib-rust/src/manager.rs 0.00% 52 Missing :warning:
...c/vpk/Velopack.Packaging.Windows/Msi/MsiBuilder.cs 55.65% 43 Missing and 8 partials :warning:
src/lib-rust/src/wide_strings.rs 57.14% 48 Missing :warning:
... and 59 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #606      +/-   ##
===========================================
- Coverage    40.87%   40.82%   -0.06%     
===========================================
  Files          244      267      +23     
  Lines        18355    19457    +1102     
  Branches      2045     2128      +83     
===========================================
+ Hits          7503     7943     +440     
- Misses       10497    11125     +628     
- Partials       355      389      +34     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Sep 16 '25 04:09 codecov[bot]

@Keboo, is this code going to be merged at some point? We're looking for an MSI installer for a project, and would love to use VeloPack. The app consists of a WPF client, a console client, and a Windows service. Because of the Windows service, I don't think we can currently use VeloPack. Thanks!

jaspet avatar Nov 03 '25 19:11 jaspet

@jaspet Yes this is what we are working on trying to get merged. However, this is only going to add support for generating an MSI and support for installing an application for all users vs per user. It does not add support for system services. This is on our roadmap but no ETA to report for that feature right now.

Keboo avatar Nov 05 '25 00:11 Keboo