diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7f80c1e44..3c86d4dfb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -60,6 +60,13 @@ set(CPACK_NSIS_MUI_UNIICON "${CMAKE_CURRENT_SOURCE_DIR}/icinga-app\\\\icinga.ico
set(CPACK_NSIS_INSTALLED_ICON_NAME "sbin\\\\icinga2.exe")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt")
set(CPACK_SOURCE_IGNORE_FILES "/.git/" "/debian/" "/.vagrant/" "/release/" "/debug/" "/build/" )
+
+if(MSVC)
+ set(CPACK_NSIS_EXECUTABLES_DIRECTORY "sbin")
+ set(CPACK_PACKAGE_EXECUTABLES "Icinga2SetupAgent;Icinga 2 Agent Wizard")
+ set(CPACK_NSIS_MUI_FINISHPAGE_RUN "Icinga2SetupAgent")
+endif()
+
include(CPack)
if(WIN32)
diff --git a/tools/icinga2-setup-agent/Icinga2SetupAgent.csproj b/tools/icinga2-setup-agent/Icinga2SetupAgent.csproj
index 23ea4aac7..8819cea3a 100644
--- a/tools/icinga2-setup-agent/Icinga2SetupAgent.csproj
+++ b/tools/icinga2-setup-agent/Icinga2SetupAgent.csproj
@@ -3,7 +3,7 @@
Debug
- AnyCPU
+ Win32
{A86F1159-66E8-4BDB-BF28-A2BDAF76517C}
WinExe
Properties
@@ -12,7 +12,7 @@
v4.5
512
-
+
x86
true
full
@@ -22,7 +22,7 @@
prompt
4
-
+
x86
pdbonly
true
@@ -31,7 +31,7 @@
prompt
4
-
+
x86
pdbonly
true
@@ -40,7 +40,7 @@
prompt
4
-
+
x86
pdbonly
true