Skip to content

Win installer - add option to install in Current User (default) or All Users#5276

Open
arnonm wants to merge 1 commit intoportfolio-performance:masterfrom
arnonm:WindowsInstaller
Open

Win installer - add option to install in Current User (default) or All Users#5276
arnonm wants to merge 1 commit intoportfolio-performance:masterfrom
arnonm:WindowsInstaller

Conversation

@arnonm
Copy link
Contributor

@arnonm arnonm commented Dec 31, 2025

Add ability to install in Current User w/o Admin rights (default) or to All Users
Can be specificed in command line /CurrentUser or /AllUsers, or via GUI if no command line is given.

The addition of the GUI and Command line require two nsis add-ons which are not available on MacOS, only on Windows, which means the windows executable has to be build on Windows.
Added a flow on windows to build the windows artifact

Currently active on a WinInstaller branch. Leaving it up to the maintainer to decide when this github Actions is called

@buchen
Copy link
Member

buchen commented Dec 31, 2025

Hi @arnonm,

let me share an initial reaction.

First, it would be super helpful to squash these many commits into one. That makes it much easier to review. Additionally, it is always helpful if you rebase your contributions instead of merging the upstream master into your branch. Can you be so kind and force push the squashed changes into this pull request?

Second, about the add-ons:

The addition of the GUI and Command line require two nsis add-ons which are not available on MacOS, only on Windows, > which means the windows executable has to be build on Windows.

I was able to build it successfully on macOS.
Can you elaborate which add-ons are not available on macOS?

[INFO] --- exec:3.6.3:exec (build-installer) @ portfolio.product ---
Command line defined: "SOFTWARE_VERSION=0.81.1-SNAPSHOT"
Processing script file: "/Users/asbn/Code/portfolio-currencies/portfolio-product/installer/installer.nsi" (UTF8)

Processed 1 file, writing output (x86-unicode):

Output: "../target/products/PortfolioPerformance-0.81.1-SNAPSHOT-setup.exe"
Install: 3 pages (192 bytes), 1 section (1 required) (4120 bytes), 2151 instructions (60228 bytes), 1676 strings (169466 bytes), 1 language table (230 bytes).
Uninstall: 1 page (128 bytes), 1 section (4120 bytes), 35 instructions (980 bytes), 70 strings (2020 bytes), 1 language table (194 bytes).
Datablock optimizer saved 447507 bytes (~0.3%).

Using zlib compression.

EXE header size:              241664 / 39936 bytes
Install code:                  25102 / 232580 bytes
Install data:              112897057 / 230091038 bytes
Uninstall code+data:            1484 / 2130 bytes
CRC (0x6F5B6F76):                  4 / 4 bytes

Total size:                113165311 / 230365688 bytes (49.1%)
Bildschirmfoto 2025-12-31 um 18 04 58

Third, on the Github action workflow.

I am building the release installer locally and signing with my code signing certificate (on a secure stick).
Therefore I do not know how I would be able to sign the executables on the Github server.
Plus I do not want to distribute intermediate installer - not every commit is a valid release.
This is especially important if there are changes to the file structure - which must be backward compatible.
For all this reasons, I am skeptical of a GitHub action workflow that is building the executable. I would prefer to not have that workflow (I understand it is there only because the installer is not building on macOS, but this is - see above - not the issue).

@buchen buchen added enhancement github_actions Pull requests that update GitHub Actions code labels Dec 31, 2025
@buchen buchen added the needs discussion Pull request needs discussion before going into the nitty gritty details of the code change label Dec 31, 2025
@buchen buchen self-assigned this Dec 31, 2025
@buchen
Copy link
Member

buchen commented Dec 31, 2025

Besides the comments above: I think it is a reasonable feature to allow the users to pick the installation method and have the registry keys written accordingly. Before the recent change it was unfortunate: a user specific location and global keys.

@arnonm
Copy link
Contributor Author

arnonm commented Dec 31, 2025 via email

Copy link
Member

@buchen buchen left a comment

Choose a reason for hiding this comment

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

Moving this pull request to "changes requested":

  • squash and rebase the many changes to master
  • remove the GitHub workflow
  • undo the changes to the pom.xml

<version>${tycho-version}</version>
<executions>
<execution>
<id>materialize-products</id>
Copy link
Member

Choose a reason for hiding this comment

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

I believe this configuration is not needed here.

<argument>PortfolioPerformance-${project.version}-setup.exe</argument>
</arguments>
<skip>${installer.skip}</skip>
<skip>${exesigner.skip}</skip>
Copy link
Member

Choose a reason for hiding this comment

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

The problem here is: this section should be skipped either if the installer is not being build (then it cannot be signed) or if the signing is skipped (then we want to skip the signing). Unfortunately, I was not able to figure out how to check for two properties here. And I did not want to introduce yet another combined property.

Therefore one can pick either of both properties. I picked the installer because I (more often) skip the windows installer while still wanting to sign the executable in the update site. I know it can be either/or, but I would prefer not to change this here.

@github-project-automation github-project-automation bot moved this to In Progress in Feature Shortlist Jan 3, 2026
… users

Issue: portfolio-performance#5276
Signed-off-by: arnonm <3808041+arnonm@users.noreply.github.com>
[squashed commits; rebased to master]
Signed-off-by: Andreas Buchen <andreas.buchen@gmail.com>
@buchen
Copy link
Member

buchen commented Jan 6, 2026

@arnonm, FYI, for readability, I have squashed all commits and force pushed them into the pull request

Copy link
Member

@buchen buchen left a comment

Choose a reason for hiding this comment

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

I propose to uncomment the GrantOnFile.

Comment on lines -52 to +144

AccessControl::GrantOnFile "$INSTDIR" "(BU)" "GenericRead + GenericWrite + Delete"
Pop $0
${If} $0 == error
Pop $0
DetailPrint `AccessControl error: $0`
${EndIf}
# AccessControl plugin not available in standard NSIS installation
# AccessControl::GrantOnFile "$INSTDIR" "(BU)" "GenericRead + GenericWrite + Delete"
# Pop $0
# ${If} $0 == error
# Pop $0
# DetailPrint `AccessControl error: $0`
# ${EndIf}
Copy link
Member

@buchen buchen Jan 6, 2026

Choose a reason for hiding this comment

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

I understand that the plugin is not available in a standard NSIS installation. It needs to be installed.

The purpose is this: if the application is installed into the system location, then the self-update of Eclipse needs the additional permissions. I added this a long time ago because otherwise users get error messages when updating the installation.

My thinking is: we can "just" keep it here as it is. Why? If the user installs for "All users", then he must already have the permission to run GrantOnFile. If the user installed for the current user only, it is not really needed, but it also does not make a difference if it is called.

What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. It is not worth the overhead of installing the additional plugin

@buchen buchen removed the github_actions Pull requests that update GitHub Actions code label Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement needs discussion Pull request needs discussion before going into the nitty gritty details of the code change

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants