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

feat(portable): adding splash image to portable nsis package #4425

Conversation

catdad
Copy link
Contributor

@catdad catdad commented Nov 15, 2019

This PR is meant to address #2548 and #3972 by allowing a developer to add a splash image that is displayed while the portable Windows executable is extracting files. This lets the user know that the application is doing work and will soon open.

@catdad
Copy link
Contributor Author

catdad commented Nov 15, 2019

I am opening this PR early as a draft in order to get the conversation started and get the benefit of CI. I am still working through it, but I welcome any feedback, help, or tips.

//tslint:disable-next-line:no-invalid-template-strings
artifactName: "${productName}Portable.${version}.${ext}",
splashImage: path.resolve(getFixtureDir(), "installerHeader.bmp"),
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 am not a fan of this one. However, I tried tracing through the code quickly and did not find an appropriate location to translate relative input (some-dir/my-image.bmp) to the full path (C:\\Users\\Me\\my-project\\some-dir\\my-image.bmp). I am not sure if NSIS will use a relative path (most likely yes), but it didn't work when I just followed the examples of existing tests.

I'd appreciate any help here. Where would be the best place in the code to resolve the path for this image?

@catdad catdad marked this pull request as ready for review November 20, 2019 23:41
develar pushed a commit to develar/electron-builder that referenced this pull request Nov 27, 2019
@develar
Copy link
Member

develar commented Nov 27, 2019

I applied your changes. But functionality doesn't work correctly — image disappears too quickly. Please address this issue.

@develar develar closed this Nov 27, 2019
@catdad
Copy link
Contributor Author

catdad commented Nov 27, 2019

Can you give me more details? What project did you apply this to? I tested it on two projects, and the image always disappeared immediately before the app started. How can I repro the issue you saw?

Also, why is this closed? Is there really no chance to work on improvements for PRs submitted to this projects before they are rejected?

@develar
Copy link
Member

develar commented Nov 27, 2019

@catdad This PR accepted and merged into master — 91e6183 But I didn't mention it in 22.2.0 release notes. Please try 22.2.0 — does it work for you?

@develar
Copy link
Member

develar commented Nov 27, 2019

What project did you apply this to?

Added by you test :)

@montoyaaguirre
Copy link

Is this feature working? If so, can we update the documentation?

So far I can set the splashImage. I can see that the portable exe contains the bmp image (inspecting with 7z) but the image is never displayed. (I wouldn't miss it, the extraction takes about 20 seconds)

@catdad
Copy link
Contributor Author

catdad commented Mar 12, 2020

@montoyaaguirre As far as I know, this is not actually working yet. I implemented the functionality in the NSIS script and validated that, and I had implemented part of passing a variable into the NSIS script. However, I never figured out how the internal module that runs the scripts gets options provided by the publicly-documented module. I had asked for help in a comment on the MR, but instead it was just merged in. I got distracted by other projects so I never looked back to implement the rest of the functionality. If you know more about how the options passing works, I'm happy to help implement the rest.

And yes, there are small trivial projects that unzip very fast. Those are projects that just shouldn't have a splash image. But there are also larger more involved projects that take 20 to 30 seconds to unzip, sometimes even longer, and those are the ones where this image is necessary. It is certainly not correct to include it in every project.

So to summarize, currently the NSIS scripts are working but there is no way for you to actually pass in an image.

@BotellaA
Copy link

@catdad @develar Is there still someone trying to implement this feature? My app takes 30s to extract so a splash screen would be a great feature.

@catdad
Copy link
Contributor Author

catdad commented May 19, 2020

@BotellaA I created #4990 with the remaining work in order to allow providing a relative path to a bitmap image in your config. Feel free to track that PR

@catdad catdad deleted the #2548-nsis-portable-splash-image branch May 24, 2020 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants