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

NSIS installer for Windows #474

Merged
merged 3 commits into from
May 22, 2019
Merged

Conversation

ilammy
Copy link
Collaborator

@ilammy ilammy commented May 22, 2019

Having MSYS2 packages is nice, but there are those weird Windows devs who insist on building their software using native Windows tools like Microsoft Visual Studio instead of building everything in MSYS. There are also other environments like Node.js which insist on using Visual Studio toolchain on Windows. Let's provide them with a way to install Themis into system so that they can build their software the way they want to.

NullSoft Scriptable Install System is a venerable and straightforward installation toolkit. Moreover, it's available in MSYS so it's very easy to integrate into our build system. Provide an initial script for building an installer and a makefile target nsis_installer which produces InstallThemis.exe in the build directory. Piggyback on the make install target to figure out what files need to be distributed. Include our licensing information as well. Also include MSYS2 runtime libraries which are necessary to use Themis outside of MSYS2.

We get these cool Win95-style installers as a reward:

License confirmation page

Installation directory page

Final page

Having MSYS2 packages is nice, but there are those weird Windows devs
who insist on building their software using native Windows tools like
Microsoft Visual Studio instead of building everything in MSYS. There
are also other environments like Node.js which insist on using Visual
Studio toolchain on Windows. Let's provide them with a way to install
Themis into system so that they can build their software the way they
want to.

NullSoft Scriptable Install System is a venerable and straightforward
installation toolkit. Moreover, it's available in MSYS so it's very
easy to integrate into our build system. Provide an initial script for
building an installer and a makefile target "nsis_installer" which
produce "InstallThemis.exe" in the build directory. Piggyback on the
"make install" target to figure out what files need to be distributed.
Include our licensing information as well. Alsso include MSYS2 runtime
libraries which are necessary to use Themis outside of MSYS2.
@ilammy ilammy added the O-Windows 🖥️ Operating system: Windows label May 22, 2019
@ilammy ilammy requested review from vixentael and Lagovas May 22, 2019 10:00
@ilammy ilammy requested a review from shadinua as a code owner May 22, 2019 10:00
VIAddVersionKey "CompanyName" "Cossack Labs Limited"
VIAddVersionKey "LegalCopyright" "(c) Cossack Labs Limited"
VIAddVersionKey "FileDescription" "Themis library installer"
VIAddVersionKey "FileVersion" "0.11.2"
Copy link
Collaborator

Choose a reason for hiding this comment

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

we need add to our checklist for releases where we will need to update version. maybe place here some placeholder and set correct version before using this file?

Copy link
Contributor

@shadinua shadinua left a comment

Choose a reason for hiding this comment

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

Overall looks very good.

But I'd suggest to test this PR on our CI with all other supported OS.

Makefile Show resolved Hide resolved
@makensis Themis.nsi
@rm -r "$(BIN_PATH)/install"

FORCE:
Copy link
Contributor

Choose a reason for hiding this comment

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

what means FORCE?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This empty target forces the installer to be rebuilt when make nsis_installer is run. Otherwise make sees that InstallThemis.exe already exists in the build directory and does not need to be updated.

Ideally, we should not be calling make install recursively. The nsi script could copy the binaries from the build directory and header files from the repo. This will allow us to accurately track the dependencies for make so that repeated make nsis_installer runs will rebuild the binaries and the installer only when necessary.

However, that would mean that we'd have to maintain two separate lists of installed files. Recently we have unified RPM and DEB packaging to use make install instead of their own lists. I think that we'd be better off just using make install everywhere.

Since NSIS scripts are Windows- and MSYS-specific, produce a nice
error message if the users try running "make nsis_installer" in
non-MSYS environment (e.g., on their macBook, or in a regular
terminal on Windows without proper environment configuration).
@ilammy ilammy merged commit 9aade34 into cossacklabs:master May 22, 2019
@ilammy ilammy deleted the nsis-installer branch May 23, 2019 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-Windows 🖥️ Operating system: Windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants