Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Ksnip as MSI Package for windows #546

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

Closed
amenk opened this issue Jan 20, 2021 · 46 comments
Closed

Ksnip as MSI Package for windows #546

amenk opened this issue Jan 20, 2021 · 46 comments
Assignees

Comments

@amenk
Copy link
Contributor

amenk commented Jan 20, 2021

Are there any plans for MSI packages for the Windows version?

This would ease the rollout of ksnip for our Windows users.

@DamirPorobic
Copy link
Member

We have this one here #155 and now after you have asked this question and I started looking into this I run into this InnoSetup that one of the users already provided a script for. So this might speed things up. I'll close this one, further discussion please in #155

@DamirPorobic
Copy link
Member

DamirPorobic commented Jan 20, 2021

Ok, InnoSetup seems to be not supporting creating MSI, might be a more complex task.

I'm checking on the Qt forum is anyone has experience with that.

@DamirPorobic
Copy link
Member

Would a standard setup exe work for you?

@amenk
Copy link
Contributor Author

amenk commented Jan 20, 2021

I believe we need an MSI to automate deployment. I can also try to look into it. Where are the windows releases currently assembled? Is there something like GitHub actions or travis for this or is it done manually on some windows computer?

@DamirPorobic
Copy link
Member

Everything is done by Travis-CI, the yml is the entry point https://github.com/ksnip/ksnip/blob/master/.travis.yml

@amenk
Copy link
Contributor Author

amenk commented Jan 20, 2021

WIX Toolkit seems the way to go, and somehow cmake has a WIX capability? Documentation

@DamirPorobic
Copy link
Member

Looks like a good starting point, we might give it a try. Thanks for the hint :)

@DamirPorobic
Copy link
Member

Another alternative seems to be Qbs with Wix Module https://doc.qt.io/qbs/qml-qbsmodules-wix.html

@amenk
Copy link
Contributor Author

amenk commented Jan 30, 2021

Which option is easier / better?

@DamirPorobic
Copy link
Member

No clue, both is new territory for me. We use cmake and Qt so both might work. For cmake there is a mailing list where you can usually get feedback from people that know the stuff. Qt usually has good documentation but it might be harder to reach people of knowledge. I think I would check out for what can I find any kind of example or tutorial and give it a try.

@amenk
Copy link
Contributor Author

amenk commented Jan 30, 2021

Let my try cpack

amenk added a commit to amenk/ksnip that referenced this issue Jan 30, 2021
…dd -x flag to build script to see commands
amenk added a commit to amenk/ksnip that referenced this issue Jan 30, 2021
@amenk
Copy link
Contributor Author

amenk commented Jan 31, 2021

I tried cpack on travis, but there is no way to debug this properly with the current delay.

While waiting for travis I tried a GitHub actions setup but it's also not trivial to convert to build to GitHub actions. There is a nice workaround to debug with SSH on the GitHub actions runner, which looked promising, but still the build would needed to be converted to GitHub actions, which is additional effort.

Is there anyone with a windows build environment who could try cpack locally?

@DamirPorobic
Copy link
Member

I don't have Windows anymore, would need to buy it and install it somewhere first. @fnkabit is also a Linux user as far as I know.
I can try to get my hands on a digital windows version and set it up in a VM but won't probably have time for it today, best I could do is during the week.

Have you tried running the Windows script locally? The CI is also set up from scratch for every run, there should be everything you need. Thinking again about it, cmake, git and VS is probably preinstalled there.

@amenk
Copy link
Contributor Author

amenk commented Jan 31, 2021

Have you tried running the Windows script locally?

The funny part is that I am asking for MSI packages without having windows :) I am a Linux user myself, the MSI is for our colleagues. But I probably can get hold of a Windows machine or VM.

Still I think it needs quite some preinstalled tools, such as nmake, bash and so on..

@amenk
Copy link
Contributor Author

amenk commented Jan 31, 2021

Actually it is possible to get trial Windows VMs for (Browser) development here: https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/

The travis build env is described here:

https://docs.travis-ci.com/user/reference/windows/#support

Maybe it's enough to install Chocolatey and Git bash plus the packages written there.

@DamirPorobic
Copy link
Member

Funny indeed, two Linux users try setup MSI packages :)

nmake comes with Visual Studio I think, I can't remember installing it. For the bash I have used the bash that comes installed with Git. I think when you install Visual Studio Community version, Git and Cmake you should have all the tools.

@DamirPorobic
Copy link
Member

Chocolatey might work if you can install VS via it.

@amenk
Copy link
Contributor Author

amenk commented Jan 31, 2021

Yep, looks like .. trying to setup a travis like environment now locally

amenk added a commit to amenk/ksnip that referenced this issue Jan 31, 2021
* install wixtoolset
* add configs in CMakeList for WIX packaging
* change bootstrap_envars windows toolkit to the latest version from
Travis
amenk added a commit to amenk/ksnip that referenced this issue Jan 31, 2021
amenk added a commit to amenk/ksnip that referenced this issue Jan 31, 2021
amenk added a commit to amenk/ksnip that referenced this issue Jan 31, 2021
to be able to use it for cpack
amenk added a commit to amenk/ksnip that referenced this issue Jan 31, 2021
@DamirPorobic
Copy link
Member

Should I have a look at the PR and merge it into master or do you want to test further here?

@amenk
Copy link
Contributor Author

amenk commented Feb 1, 2021

@DamirPorobic you can review, thanks

@DamirPorobic
Copy link
Member

Just did a quick check with the msi package you have provided:

  1. I get this error:
    image
  2. It asks if you want to install a package from a unknown publisher, maybe we should look into that to become a known publisher

@amenk
Copy link
Contributor Author

amenk commented Feb 1, 2021

  1. Looks like fixup_bundle does not include all files?
  2. Probably you would need to purchase a code sign certificate ( let's encrypt does not work ).

@DamirPorobic
Copy link
Member

Yes, looks like something is missing there.

Regarding the certificate, that's probably the right way to go. Any idea how much this would cost annually?
Need to check if we can cover it with our donations and sponsoring.

@DamirPorobic
Copy link
Member

Something like this https://www.exemsi.com/documentation/sign-your-msi/?

@DamirPorobic
Copy link
Member

Oh boy, just had a quick look, it looks like 269€/year, together with our other costs that would be more then we get in a year.

@amenk
Copy link
Contributor Author

amenk commented Feb 1, 2021

Maybe this is an option: http://www.anse.de/programming/code-signing-for-open-source-executable no clue if they mean this package or it needs additional hardware ... https://shop.certum.eu/open-source-code-signing-code.html

@DamirPorobic
Copy link
Member

I wrote to those guys this morning, no feedback yet. I'll check with some others too regarding FOSS support.

@DamirPorobic
Copy link
Member

Could it be that we are missing the this here https://stackoverflow.com/questions/31920698/how-to-deploy-qwindowsintegrationplugin-with-cmake regarding the error message?

I think I didn't see a platform directory in the install dir.

@DamirPorobic
Copy link
Member

This might also be a hint
image

@DamirPorobic
Copy link
Member

Just had a test with the installed package, this is how it looked initially:
image

And it was not starting, after copying all missing files that are in the old zip I get this and ksnip starts without error message:
image

@DamirPorobic DamirPorobic self-assigned this Feb 7, 2021
@DamirPorobic
Copy link
Member

Still haven't had time to resolve this but I've been looking around for potential fixes, this might be a good starting point https://blog.nathanosman.com/2017/11/24/using-windeployqt-with-cpack.html

@amenk
Copy link
Contributor Author

amenk commented Mar 3, 2021

Okay, we are currently evaluating if we can install unsigned MSI files automatically. If they need to be signed for the unattended deployment, this would be annoying ;-(

Still I think it would be great if this can be easily installed within organizations and increase the user base :)

EDIT This does not look promissing: https://serverfault.com/questions/259635/need-to-allow-unsigned-msi-to-install

@amenk
Copy link
Contributor Author

amenk commented Mar 3, 2021

Oh boy, just had a quick look, it looks like 269€/year, together with our other costs that would be more then we get in a year.

There is one from comodo for 69$/yr .. still I would suggest writing to the different vendors to ask for sponsorship :)

@DamirPorobic
Copy link
Member

I wrote to three of them, best was a 20% discount but one for the more expensive :/

I would definitely go for the signed one but that is probably the last step, still haven't had time to look into the MSI packaging but it's still high on my prio list.

@DamirPorobic
Copy link
Member

@amenk have you seen this error before:
image

@amenk
Copy link
Contributor Author

amenk commented Mar 12, 2021

I believe it should not use NSIS but WiX... Maybe wrong generator somewhere specified?

@DamirPorobic
Copy link
Member

@amenk I think I got it working. It installs all required plugins and can be started.
The only thing that is now missing are does ssl libs but they are only required when you upload something to imgur.

@DamirPorobic DamirPorobic changed the title MSI Package Ksnip as MSI Package for window Mar 13, 2021
@amenk amenk changed the title Ksnip as MSI Package for window Ksnip as MSI Package for windows Mar 13, 2021
@amenk
Copy link
Contributor Author

amenk commented Mar 13, 2021

great, thanks. we will try to deploy it. I currently have some hope, that it does not need to be signed and we can sign it when importing to WSUS or whatever method we use to roll it out to our users.

@DamirPorobic
Copy link
Member

Two issue that I have identified is the missing ssl files and the translations should be one directory deeper but both should fixable and non blocking.
I still want to go with the signing, we already pay 99$/year for MacOS signing with only a handful of users so we should also pay those 69€/year for our windows users where we have a lot more users.

I hope I can resolve everything within the next week.

@DamirPorobic
Copy link
Member

Ok, this seems to be working now. Translations and ssl file are in correct place too. The only think that I'm still looking into is the signing. Getting the certificate seems to be a longer procedure that includes me taking selfies with my ID...

DamirPorobic added a commit that referenced this issue Mar 28, 2021
DamirPorobic added a commit that referenced this issue Mar 28, 2021
@DamirPorobic
Copy link
Member

MSI Package is now signed. Need to add timestamp of signing and cleanup the CI script but in general seems to be working. Currently you only see my name there as publisher and windows still says it's an unknown app but with time that warning should go away if I understand correctly when more people install the application.

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

No branches or pull requests

2 participants