diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3e3312d..e7b13be 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,6 +28,7 @@ add_compile_definitions(PDF4QT_PROJECT_VERSION="${PDF4QT_VERSION}")
if(WIN32 AND MSVC)
option(PDF4QT_INSTALL_MSVC_REDISTRIBUTABLE "Install MSVC redistributable package" ON)
+ option(PDF4QT_INSTALL_PREPARE_WIX_INSTALLER "Prepare Wix installer for Windows" ON)
endif()
set(PDF4QT_QT_ROOT "" CACHE PATH "Qt root directory")
@@ -73,6 +74,7 @@ add_subdirectory(Pdf4QtViewerProfi)
add_subdirectory(Pdf4QtViewerLite)
add_subdirectory(Pdf4QtDocPageOrganizer)
add_subdirectory(Pdf4QtDocDiff)
+add_subdirectory(WixInstaller)
message("CMAKE_PREFIX_PATH = " ${CMAKE_PREFIX_PATH})
message("CMAKE_TOOLCHAIN_FILE = " ${CMAKE_TOOLCHAIN_FILE})
diff --git a/WixInstaller/CMakeLists.txt b/WixInstaller/CMakeLists.txt
new file mode 100644
index 0000000..728591f
--- /dev/null
+++ b/WixInstaller/CMakeLists.txt
@@ -0,0 +1,25 @@
+# Copyright (C) 2022 Jakub Melka
+#
+# This file is part of PDF4QT.
+#
+# PDF4QT is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# with the written consent of the copyright owner, any later version.
+#
+# PDF4QT is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with PDF4QT. If not, see .
+
+if(WIN32 AND MSVC AND PDF4QT_INSTALL_PREPARE_WIX_INSTALLER)
+ file(TO_NATIVE_PATH "${CMAKE_INSTALL_PREFIX}/bin" WIX_INSTALL_PREFIX)
+
+ configure_file(PDF4QT.sln.in PDF4QT.sln)
+ configure_file(PDF4QT.wixproj.in PDF4QT.wixproj)
+ configure_file(Product.wxs.in Product.wxs)
+ configure_file(explic.rtf explic.rtf)
+endif()
diff --git a/WixInstaller/PDF4QT.sln b/WixInstaller/PDF4QT.sln.in
similarity index 100%
rename from WixInstaller/PDF4QT.sln
rename to WixInstaller/PDF4QT.sln.in
diff --git a/WixInstaller/PDF4QT.wixproj b/WixInstaller/PDF4QT.wixproj.in
similarity index 94%
rename from WixInstaller/PDF4QT.wixproj
rename to WixInstaller/PDF4QT.wixproj.in
index 4f908be..2aecc75 100644
--- a/WixInstaller/PDF4QT.wixproj
+++ b/WixInstaller/PDF4QT.wixproj.in
@@ -17,7 +17,6 @@
bin\$(Configuration)\
obj\$(Configuration)\
- MyVersion=1.2.0;MyInstallDir=K:\Programming\PDF\PDF_For_Qt\bin_release\install
diff --git a/WixInstaller/Product.wxs b/WixInstaller/Product.wxs
deleted file mode 100644
index 8252eb2..0000000
--- a/WixInstaller/Product.wxs
+++ /dev/null
@@ -1,302 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/WixInstaller/Product.wxs.in b/WixInstaller/Product.wxs.in
new file mode 100644
index 0000000..054c429
--- /dev/null
+++ b/WixInstaller/Product.wxs.in
@@ -0,0 +1,343 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WixInstaller/createInstaller.ps.in b/WixInstaller/createInstaller.ps.in
new file mode 100644
index 0000000..e69de29
diff --git a/explic.rtf b/WixInstaller/explic.rtf
similarity index 100%
rename from explic.rtf
rename to WixInstaller/explic.rtf