-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Windows: Cpack wix installer #6153
Conversation
interesting ! |
b6ab529
to
30223b7
Compare
Should be ready for review now. |
CMakeLists.txt
Outdated
set(CPACK_CREATE_DESKTOP_LINKS ${PROJECT_NAME}) | ||
|
||
set(CPACK_WIX_PRODUCT_ICON "${CMAKE_CURRENT_SOURCE_DIR}/misc/minetest-icon.ico") | ||
# Supported languages can be found at http:https://wixtoolset.org/documentation/manual/v3/wixui/wixui_localization.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line too long
CMakeLists.txt
Outdated
|
||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/doc/lgpl-2.1.txt") | ||
|
||
# The correct way would be to include both x32 and x64 into one installer and install the approitive one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too long here too
EDIT: approitive -> appropriate (?)
README.txt
Outdated
In Visual Studio 2017 Installer select "optional Features" -> "Wix Toolset" | ||
|
||
Build the binaries like described above, but make shure you unselect "RUN_IN_PLACE". | ||
"RUN_IN_PLACE" builds are not designed for installations and leads to errors if installd on newer Windows since XP! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* make sure
and leads to errors.
(shorten and remove "installed" misspelling)
src/CMakeLists.txt
Outdated
@@ -727,8 +727,8 @@ if(MSVC) | |||
set(CMAKE_CXX_FLAGS_DEBUG "/MDd /Zi /Ob0 /Od /RTC1") | |||
|
|||
# Flags for C files (sqlite) | |||
# /MT = Link statically with standard library stuff | |||
set(CMAKE_C_FLAGS_RELEASE "/O2 /Ob2 /MT") | |||
# /MD = Link statically to MSVCRT.lib and dynamically to MSVCR<version>.DLL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is worded confusingly, just say dynamically link to MSVCR dll
src/porting.cpp
Outdated
path_share = std::string(buf) + "\\.."; | ||
path_share = exepath + "\\.."; | ||
if (detectMSVCBuildDir(exepath)) { | ||
// The msvc build dir schould normaly not present if properly installed, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... not be present
...
# Include all dynamically linked runtime libaries | ||
include(InstallRequiredSystemLibraries) | ||
|
||
if(RUN_IN_PLACE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this whole process seems to require building on Windows,
shouldn't it still generate ZIPs for RUN_IN_PLACE=0 compiled via MinGW?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would not make much sense.
Also this would cause much confusion to players if accidentally shared.
e.g. forum posts like this would occur:
"PLASE HELP Mods don't load", "Where is my minetest.conf?"
It does not explicit requires building with MSVC, maybe even MinGW is supported. There is a standalone package available: http:https://wixtoolset.org/
It just depends on CMake to support that. (not tested)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what happens if I compile using MinGW on Linux (-> no WiX toolset) with RUN_IN_PLACE=0 and run make package
?
Also this would cause much confusion to players if accidentally shared.
Why? It would use the exact same runtime paths as if it was installed using the installer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what happens if I compile using MinGW on Linux (-> no WiX toolset) with RUN_IN_PLACE=0 and run make package?
a) nothing
b) it prints an error message
c) it prints a warning and generates a zip package anyway
d) it generates a zip package without any other message
e) it downloads and installs the wix toolset and generates a msi package
Well I don't know. 😆 How did you generate your 7zip packages you uploaded here? You could probably do the same only as zip format.
Why? It would use the exact same runtime paths as if it was installed using the installer.
The problem is to tell the kiddies that "zip package 1" finds its mods and conf in a different place then "zip package 2" 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I don't know. 😆 How did you generate your 7zip packages you uploaded here? You could probably do the same only as zip format.
I use make package
but that's not the point.
The problem I have here is that you are willfully breaking package creation when cross-compiling for Windows with RUN_IN_PLACE=0
(also since you didn't seem to understand: the WiX toolset does not work on Linux, like not at all)
The problem is to tell the kiddies that "zip package 1" finds its mods and conf in a different place then "zip package 2" 🤔
That's true I guess.
But IMO trying to protect devs from building broken packages is not useful, previously the build system did not prevent building RUN_IN_PLACE=0 ZIP packages either.
Note that it's not required for the users to accept the LGPL license in order to play Minetest, so the "license" step of the installer can be removed (to make installation a bit quicker). (GPL FAQ) |
db1d443
to
03bbfb9
Compare
The problem is, if no licence file is speciefied, CMake generates and shows a dummy file. This reads like "The package creator was too lazy to choose a real license". So its imo the best to show users that Minetest is open source, licensed under LGPL. Other OS programs shows the GPL or LGPL license file too while installing e.g. Gimp |
README.txt
Outdated
In Visual Studio 2017 Installer select "optional Features" -> "Wix Toolset" | ||
|
||
Build the binaries like described above, but make sure you unselect "RUN_IN_PLACE". | ||
"RUN_IN_PLACE" builds are not designed for installations and leads to errors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is also confusing because creating RUN_IN_PLACE=1 installer builds is impossible (prevented by the build system)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can remove the last sentence if think its better.
892b156
to
b493275
Compare
c6ce24f
to
b6ab203
Compare
Rebased. |
b6ab203
to
4882f6b
Compare
BTW, why it says "this feature requires 0 kb" on screenshot N3? |
This is not true; you can create user-wide Start Menu entries in It's probably a wiser idea to install user-wide by default, it makes for a smoother experience for nearly everyone as no UAC prompts are displayed when installing.
Can you please link justification for that? As far as I know, Microsoft C++ redistributables fall under the "system library" exception as defined by the (L)GPL. |
I had already installed it, and reinstalled it with a installer that had a different signature/timestamp/whatever but 0 bytes difference. 8)
I guess you did misunderstand me. The "Installed Programs" is not the list in the startmenu. Its the list displayed in system control under "Add and remove Programs" or "All Apps" on Windows 10.
https://www.gnu.org/licenses/gpl-faq.en.html#WindowsRuntimeAndGPL |
I've rechecked 32 bit installer, works fine to me, installing textures/games/mods into %appdata%/minetest works, few wishes:
|
Indeed, as an example, my Godot installer appears in Programs and Features once installed. |
Maybe it is MSI windows installer limitation? |
Oh, I have to apologize, you both were right. MSI supports perUser installation and the WixToolset too. (http:https://wixtoolset.org/documentation/manual/v3/xsd/wix/package.html) The problem is, that CMake/CPack does not offer a switch for it (https://cmake.org/cmake/help/v3.10/module/CPackWIX.html). It would possible to workaround that using a patch file, but that would make it more complex and thus more unlikely to merge. the multilanguage installer is a feature request since many years for cmake: https://gitlab.kitware.com/cmake/cmake/issues/14925 The empty folders may added later, first this have to be merged, everything else would wasted time. That may also a good idea for the linux users, since their installed version is also missing them. |
I'd like to see this for 0.5.0. What remains to be done? |
From my side its ready. I would also like to see this in 0.4.17+ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested by multiple users, code looks ok
@adrido Would you be able to resolve the merge conflict please? |
f8b23e1
to
ccde870
Compare
Co-Authored-By: adrido <[email protected]>
Create CPack WIX msi Installer for RUN_IN_PLACE=0 builds Correct paths on Windows for RUN_IN_PLACE=0 Install only required font files Games have their own components, and "minimal" is optional
This allows CMake/CPack to use the Windows Installer XML (WIX) to create a Installer package.
The Installer package is only available if its not a
RUN_IN_PLACE
build. For that the zip package is generated.Todo:
Uninstaller should clean the cache dir.*Question: should uninstaller also remove the minetest.conf?**= Applications are installed for all users, while config file and cache is per user. Removing this while uninstalling is neither a good idea nor supported by MSI.
Related: #4931, #3596
Fixes: #4528, #3802, #4697
Download:
Minetest-0.5.0-win32.msi.zip
Minetest-0.5.0-win64.msi.zip
The installer here is packed in a zip, because Github does not allow MSI files.
Screenshots:
The minimal subgame have to be manually selected.