This is a minimalist 2-click MSI installer generator for your pet projects for Windows (not necessarily pet ones, preferably written in C/C++ but not necessarily again).
Magic works on MS Visual Studio as all you need is to populate _configMSI.yml with your own values, set BUILD_SUBDIR to .\build\Release, then:
- Run ___generate_msi_template.bat.
- Run __build_msi_installer.bat - it uses a MS Visual C compiler selected by _configMSI.yml values MSVC*.
Magic works now on MSYS2/MINGW64 as well: set BUILD_SUBDIR to .\build2\Release, then:
- Run ./___generate_msi_template.sh.
- Run ./__build_msi_installer.sh - it uses a compiler found at MSYS2 PATH, defaults to GCC.
And voila! Magic is coming!
C++ compiler is just needed to compile your CUSTOM_DLL_NAME.dll, a "hidden" part of your MSI installer (to ensure it may actually have the arbitrary capabilities to configure your installation and operating system). Note, CUSTOM_DLL_NAME.dll is not a part of your app (that can be written in any language).
Screenshots... | Screenshots... |
---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
-
MSI installer is a modern, standard and recommended way to install your applications on Windows, it deserves more trust of end-users and achieves less false-positive detection of antivirus software than any executable-based installer like InnoSetup. MSI installer supports a transaction/checkpoint-based installation, where a failed attempt could be rolled back.
-
Sad but truth: creating a MSI installer is a too complicated workflow, based on a *.wxs configuration file that is a sophisticated XML variant. WiX Toolset has three different versions 3, 4, 5 that are somewhat incompatible with each other. Furthermore, a vendor has no single conceptual approach what is indeed a correct way to create the MSI installers - whether all stuff should be generated from source files, or an MSI installer should be created by developer's hands as a Microsoft Visual Studio project of a special type, and all things should be done by a developer visually via the Visual Studio plugin and the GUI.
-
Meanwhile, most pet projects are sufficiently simple (and not only pet ones) in means of installation process. And even if that is not the case, we want to preserve generality, allowing to create an installer of an arbitrary complexity via calling predefined functions form a custom DLL.
-
Your project has a single main executable to install and arbitrary set of DLLs shipped with the executable. If your project has several executables, consider to implement a feature to run them from each other.
-
Your project can be upgraded and downgraded easily without controlling a version info by the installer. Simple file copying is used always.
-
Your project has only one configuration file that is preserved and copied by the installer between the versions of the program during its upgrade/downgrade sequence. We recommend to use SQLite since it is a mature ACID-transactional database library that implements a small, fast, self-contained, high-reliability, full-featured, SQL database engine. SQLite is the most used database engine in the world.
-
Your project is shipped with a custom DLL that has two exported functions: OnInstall() and OnUnInstall(). OnInstall() will be called during installation process (first-install/upgrade/downgrade/repair) after all project files are copied from the embedding installer cabinet file to the installation folder on disk. OnUnInstall() will be called during uninstall before all project files are removed from disk, only if no installed product should remain on disk. OnUnInstall() will not be called during upgrade/downgrade.
-
Your application does not require to escalate privileges.
-
MSI installer creates a standard record about your installed product in a special Windows database with TITLE value from _configMSI.yml.
-
Product version is in 3-digit format, it is set by VERMSI. It is shown with HELPLINK in the Windows' Control Panel\Programs\Programs and Features and Settings->Apps and features.
-
Default installation folder is %LOCALAPPDATA%\CNAME, we recommend to avoid space symbols in this variable.
-
End-user can change the installation folder, and the application's configuration file SETTINGS will be automatically copied and preserved across the versions of your product.
-
If another version of your product was installed before, installer detects it via a registry key property Root="HKCU" Key="Software\CNAME" Name="InstallPath" Type="string". In this case, default installation folder will be the detected location.
-
During first-install/upgrade/downgrade end-user is prompted to check a "Launch TITLE" application checkbox after installation. This checkbox will not be shown during a repair.
-
Your license to agree should be in *.rtf format with recommended font size 6pt, its disk path is set by LICENSE.
-
Your top background image to be shown the installer should be in 24-bit RGB, no color space, *.bmp format, its disk path is set by IMG_TOP. We recommend a single-color, pale saturated image.
-
Your dialog background image to be shown the installer should be in 24-bit RGB, no color space, *.bmp format, its disk path is set by IMG_DIALOG. We recommend a single-color, pale saturated image.
-
Installer creates a "Desktop" shortcut and a "Start Menu Programs" folder and shortcut from the icon embedded in the main executable, MAIN_SOURCE_FILE.
-
See _configMSI.yml for further example. Do not forget to set your unique GIUDs.
-
For your convenience, CMake generates a MS Visual Studio project named test_CUSTOM_DLL_NAME and console target executable test_CUSTOM_DLL_NAME.exe with test_msi.c source file to perform your unit tests on a CUSTOM_DLL_NAME.dll.
-
Python version 3.x, we use Python v3.11 as most advanced yet stable one. See example %PATH% from ___generate_msi_template.bat. Set the PYTHON_ROOT value. Don't forget to pip install jinja2, yaml.
-
CMake version 3.15.x, we use 3.27.7. Set the CMAKE_ROOT and MSVC values.
-
MS Visual Studio 2019/2022 professional or enterprise as we build the custom DLL with /MT code generation flag (Static MultiThreaded Config). Set the MSVC_ROOT and MSVC_CL_SUBDIR values.
-
WiX Toolset (version 5). Could be downloaded right from GitHib as an MSI installer to use from CLI. Set the WIX_TOOLSET_EXE value.
-
Optionally, WinRAR (currently not used in the example).
-
Installed gcc or clang, binutils, cmake, ninja, python, mingw-w64-x86_64-python-jinja, mingw-w64-x86_64-python-yaml. Note, in this case PYTHON_ROOT, CMAKE_ROOT, MSVC, MSVC_ROOT, MSVC_CL_SUBDIR values are unused.
-
WiX Toolset (version 5). Could be downloaded right from GitHib as an MSI installer to use from CLI. Set the WIX_TOOLSET_EXE value.
After standard git clone, from within TFMCfW_Example_MSI/ folder:
set BUILD_SUBDIR to .\build\Release
- Run ___generate_msi_template.bat to generate a build configuration.
- Run __build_msi_installer.bat to build it it uses a MS Visual C compiler selected by _configMSI.yml, values MSVC, MSVC_ROOT, MSVC_CL_SUBDIR.
set BUILD_SUBDIR to .\build2\Release
- Run ./___generate_msi_template.sh.
- Run ./__build_msi_installer.sh - it uses a compiler found at MSYS2 PATH, defaults to GCC.
This is a proposed future installer for The-Fastest-Mouse-Clicker-for-Windows.