CMake build system for Windows


git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4171 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/win/CMakeLists.txt b/win/CMakeLists.txt
new file mode 100644
index 0000000..ee0a5c0
--- /dev/null
+++ b/win/CMakeLists.txt
@@ -0,0 +1,12 @@
+add_definitions(-D_WIN32_IE=0x0500 -D_WIN32_WINNT=0x0500)
+
+include_directories(${CMAKE_SOURCE_DIR}/common ${CMAKE_SOURCE_DIR}/win)
+
+configure_file(resdefs.h.in resdefs.h)
+
+add_subdirectory(rfb_win32)
+add_subdirectory(vncviewer)
+if(BUILD_WINVNC)
+add_subdirectory(vncconfig)
+add_subdirectory(winvnc)
+endif()
diff --git a/win/Makefile.am b/win/Makefile.am
index 7f2d96c..372b699 100644
--- a/win/Makefile.am
+++ b/win/Makefile.am
@@ -4,4 +4,4 @@
 SUBDIRS += vncconfig winvnc
 endif
 
-EXTRA_DIST = logmessages/messages.h
+EXTRA_DIST = logmessages/messages.h CMakeLists.txt
diff --git a/win/README_BINARY.txt b/win/README_BINARY.txt
index 36dff10..fbef352 100644
--- a/win/README_BINARY.txt
+++ b/win/README_BINARY.txt
@@ -5,6 +5,7 @@
 Copyright (C) 2002-2004 RealVNC Ltd.  All Rights Reserved.
 Copyright (C) 2000-2004 Constantin Kaplinsky.
 Copyright (C) 2004-2009 Peter Astrand for Cendio AB
+Copyright (C) 2009-2010 D. R. Commander
 
 This software is distributed under the GNU General Public Licence as
 published by the Free Software Foundation.  See the file LICENCE.TXT
diff --git a/win/resdefs.h.in b/win/resdefs.h.in
new file mode 100644
index 0000000..b61db53
--- /dev/null
+++ b/win/resdefs.h.in
@@ -0,0 +1,4 @@
+#define __VERSIONSTR "@VERSION@\0"
+#define __RCVERSION @RCVERSION@
+#define __RCVERSIONSTR "@RCVERSION@\0"
+#cmakedefine WIN64
diff --git a/win/rfb_win32/CMakeLists.txt b/win/rfb_win32/CMakeLists.txt
new file mode 100644
index 0000000..60af6db
--- /dev/null
+++ b/win/rfb_win32/CMakeLists.txt
@@ -0,0 +1,48 @@
+set(RFB_WIN32_SOURCES
+  AboutDialog.cxx
+  CKeyboard.cxx
+  Clipboard.cxx
+  CPointer.cxx
+  CurrentUser.cxx
+  DeviceContext.cxx
+  DeviceFrameBuffer.cxx
+  Dialog.cxx
+  DIBSectionBuffer.cxx
+  DynamicFn.cxx
+  EventManager.cxx
+  LaunchProcess.cxx
+  ListViewControl.cxx
+  LowLevelKeyEvents.cxx
+  MonitorInfo.cxx
+  MsgWindow.cxx
+  OSVersion.cxx
+  ProgressControl.cxx
+  RegConfig.cxx
+  Registry.cxx
+  ScaledDIBSectionBuffer.cxx
+  SDisplayCorePolling.cxx
+  SDisplayCoreWMHooks.cxx
+  SDisplay.cxx
+  Security.cxx
+  Service.cxx
+  SInput.cxx
+  SocketManager.cxx
+  TCharArray.cxx
+  Threading.cxx
+  ToolBar.cxx
+  TsSessions.cxx
+  Win32Util.cxx
+  WMCursor.cxx
+  WMHooks.cxx
+  WMNotifier.cxx
+  WMPoller.cxx
+  WMShatter.cxx
+  WMWindowCopyRect.cxx)
+
+if(BUILD_WINVNC)
+  set(RFB_WIN32_SOURCES ${RFB_WIN32_SOURCES} CleanDesktop.cxx)
+endif()
+
+add_library(rfb_win32 STATIC ${RFB_WIN32_SOURCES})
+
+target_link_libraries(rfb_win32 user32.lib comctl32.lib version.lib)
diff --git a/win/rfb_win32/Makefile.am b/win/rfb_win32/Makefile.am
index 74f74e8..80d9286 100644
--- a/win/rfb_win32/Makefile.am
+++ b/win/rfb_win32/Makefile.am
@@ -104,3 +104,5 @@
 
 librfb_win32_la_CPPFLAGS = -I$(top_srcdir)/common -I$(top_srcdir)/win
 librfb_win32_la_LIBADD =
+
+EXTRA_DIST = CMakeLists.txt
diff --git a/win/tigervnc.iss b/win/tigervnc.iss
deleted file mode 100644
index ae7697a..0000000
--- a/win/tigervnc.iss
+++ /dev/null
@@ -1,42 +0,0 @@
-

-[Setup]

-OutputDir=.

-AppName=TigerVNC

-AppVerName=TigerVNC 1.0.90

-AppVersion=1.0.90

-AppPublisher=TigerVNC project

-AppPublisherURL=http://tigervnc.org

-DefaultDirName={pf}\TigerVNC

-DefaultGroupName=TigerVNC

-LicenseFile=LICENCE.txt

-

-[Files]

-Source: "Release\winvnc4.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace; 

-Source: "Release\wm_hooks.dll"; DestDir: "{app}"; Flags: ignoreversion restartreplace; 

-Source: "Release\vncviewer.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace; 

-Source: "Release\vncconfig.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace; 

-Source: "README_BINARY.txt"; DestDir: "{app}"; Flags: ignoreversion

-Source: "LICENCE.txt"; DestDir: "{app}"; Flags: ignoreversion

-

-

-[Icons]

-Name: "{group}\TigerVNC Viewer"; FileName: "{app}\vncviewer.exe";

-Name: "{group}\Listening TigerVNC Viewer"; FileName: "{app}\vncviewer.exe"; Parameters: "-listen";

-

-Name: "{group}\VNC Server (User-Mode)\Run VNC Server"; FileName: "{app}\winvnc4.exe"; Parameters: "-noconsole";

-Name: "{group}\VNC Server (User-Mode)\Configure VNC Server"; FileName: "{app}\vncconfig.exe"; Parameters: "-user";

-

-Name: "{group}\VNC Server (Service-Mode)\Configure VNC Service"; FileName: "{app}\vncconfig.exe"; Parameters: "-noconsole -service";

-Name: "{group}\VNC Server (Service-Mode)\Register VNC Service"; FileName: "{app}\winvnc4.exe"; Parameters: "-register";

-Name: "{group}\VNC Server (Service-Mode)\Unregister VNC Service"; FileName: "{app}\winvnc4.exe"; Parameters: "-unregister";

-Name: "{group}\VNC Server (Service-Mode)\Start VNC Service"; FileName: "{app}\winvnc4.exe"; Parameters: "-noconsole -start";

-Name: "{group}\VNC Server (Service-Mode)\Stop VNC Service"; FileName: "{app}\winvnc4.exe"; Parameters: "-noconsole -stop";

-Name: "{group}\License"; FileName: "{app}\LICENCE.txt";

-

-[Tasks]

-Name: installservice; Description: "&Register new TigerVNC Server as a system service"; GroupDescription: "Server configuration:"; 

-Name: startservice; Description: "&Start or restart TigerVNC service"; GroupDescription: "Server configuration:";

-

-[Run]

-Filename: "{app}\winvnc4.exe"; Parameters: "-register"; Tasks: installservice

-Filename: "net"; Parameters: "start winvnc4"; Tasks: startservice

diff --git a/win/tigervnc.iss.in b/win/tigervnc.iss.in
new file mode 100644
index 0000000..2d967a4
--- /dev/null
+++ b/win/tigervnc.iss.in
@@ -0,0 +1,57 @@
+[Setup]
+#ifdef WIN64
+ArchitecturesInstallIn64BitMode=x64
+AppName=TigerVNC 64-bit
+AppVerName=TigerVNC 64-bit @VERSION@ (@BUILD@)
+#else
+AppName=TigerVNC
+AppVerName=TigerVNC v@VERSION@ (@BUILD@)
+#endif
+AppVersion=@VERSION@
+AppPublisher=TigerVNC project
+AppPublisherURL=http://tigervnc.org
+DefaultDirName={pf}\TigerVNC
+#ifdef WIN64
+DefaultGroupName=TigerVNC 64-bit
+#else
+DefaultGroupName=TigerVNC
+#endif
+LicenseFile=@CMAKE_SOURCE_DIR@\LICENCE.txt
+
+[Files]
+#ifdef BUILD_WINVNC
+Source: "@CMAKE_CURRENT_BINARY_DIR@\win\winvnc\{#BUILD_DIR}winvnc4.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace; 
+Source: "@CMAKE_CURRENT_BINARY_DIR@\win\winvnc\{#BUILD_DIR}wm_hooks.dll"; DestDir: "{app}"; Flags: ignoreversion restartreplace; 
+Source: "@CMAKE_CURRENT_BINARY_DIR@\win\vncconfig\{#BUILD_DIR}vncconfig.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace; 
+#endif
+Source: "@CMAKE_CURRENT_BINARY_DIR@\win\vncviewer\{#BUILD_DIR}vncviewer.exe"; DestDir: "{app}"; Flags: ignoreversion restartreplace; 
+Source: "@CMAKE_SOURCE_DIR@\win\README_BINARY.txt"; DestDir: "{app}"; Flags: ignoreversion
+Source: "@CMAKE_SOURCE_DIR@\LICENCE.txt"; DestDir: "{app}"; Flags: ignoreversion
+
+
+[Icons]
+Name: "{group}\TigerVNC Viewer"; FileName: "{app}\vncviewer.exe";
+Name: "{group}\Listening TigerVNC Viewer"; FileName: "{app}\vncviewer.exe"; Parameters: "-listen";
+
+#ifdef BUILD_WINVNC
+Name: "{group}\VNC Server (User-Mode)\Run VNC Server"; FileName: "{app}\winvnc4.exe"; Parameters: "-noconsole";
+Name: "{group}\VNC Server (User-Mode)\Configure VNC Server"; FileName: "{app}\vncconfig.exe"; Parameters: "-user";
+
+Name: "{group}\VNC Server (Service-Mode)\Configure VNC Service"; FileName: "{app}\vncconfig.exe"; Parameters: "-noconsole -service";
+Name: "{group}\VNC Server (Service-Mode)\Register VNC Service"; FileName: "{app}\winvnc4.exe"; Parameters: "-register";
+Name: "{group}\VNC Server (Service-Mode)\Unregister VNC Service"; FileName: "{app}\winvnc4.exe"; Parameters: "-unregister";
+Name: "{group}\VNC Server (Service-Mode)\Start VNC Service"; FileName: "{app}\winvnc4.exe"; Parameters: "-noconsole -start";
+Name: "{group}\VNC Server (Service-Mode)\Stop VNC Service"; FileName: "{app}\winvnc4.exe"; Parameters: "-noconsole -stop";
+#endif
+Name: "{group}\License"; FileName: "{app}\LICENCE.txt";
+Name: "{group}\Uninstall TigerVNC"; FileName: "{uninstallexe}"; WorkingDir: "{app}";
+
+#ifdef BUILD_WINVNC
+[Tasks]
+Name: installservice; Description: "&Register new TigerVNC Server as a system service"; GroupDescription: "Server configuration:"; 
+Name: startservice; Description: "&Start or restart TigerVNC service"; GroupDescription: "Server configuration:";
+
+[Run]
+Filename: "{app}\winvnc4.exe"; Parameters: "-register"; Tasks: installservice
+Filename: "net"; Parameters: "start winvnc4"; Tasks: startservice
+#endif
diff --git a/win/vncconfig/CMakeLists.txt b/win/vncconfig/CMakeLists.txt
new file mode 100644
index 0000000..9883dbd
--- /dev/null
+++ b/win/vncconfig/CMakeLists.txt
@@ -0,0 +1,18 @@
+include_directories(${CMAKE_BINARY_DIR}/win)
+
+# Disable auto-generated manifests, since we have our own
+if(MSVC)
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
+endif()
+
+add_executable(vncconfig WIN32
+  Legacy.cxx
+  PasswordDialog.cxx
+  vncconfig.cxx
+  vncconfig.rc)
+
+target_link_libraries(vncconfig rfb_win32 rfb Xregion network rdr ws2_32.lib)
+
+install(TARGETS vncconfig
+  RUNTIME DESTINATION .
+)
diff --git a/win/vncconfig/Makefile.am b/win/vncconfig/Makefile.am
index 84d1b0f..b22b28c 100644
--- a/win/vncconfig/Makefile.am
+++ b/win/vncconfig/Makefile.am
@@ -14,7 +14,7 @@
 	$(top_builddir)/common/rdr/librdr.la -lws2_32 -lgdi32 -lversion -lole32 \

 	-lcomctl32 resources.o

 

-EXTRA_DIST = vncconfig.ico vncconfig.rc vncconfig.exe.manifest

+EXTRA_DIST = vncconfig.ico vncconfig.rc vncconfig.exe.manifest CMakeLists.txt

 

 resources.o: vncconfig.rc

 	$(WINDRES) $^ -o $@

diff --git a/win/vncconfig/vncconfig.exe.manifest64 b/win/vncconfig/vncconfig.exe.manifest64
new file mode 100644
index 0000000..10eefa3
--- /dev/null
+++ b/win/vncconfig/vncconfig.exe.manifest64
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<assemblyIdentity
+   version="4.0.0.26"
+   processorArchitecture="AMD64"
+   name="TigerVNC.vncconfig.exe"
+   type="win32"
+/>
+<description>.NET control deployment tool</description>
+<dependency>
+   <dependentAssembly>
+     <assemblyIdentity
+       type="win32"
+       name="Microsoft.Windows.Common-Controls"
+       version="6.0.0.0"
+       processorArchitecture="AMD64"
+       publicKeyToken="6595b64144ccf1df"
+       language="*"
+     />
+   </dependentAssembly>
+</dependency>
+</assembly>
diff --git a/win/vncconfig/vncconfig.rc b/win/vncconfig/vncconfig.rc
index 7292f1a..df6cfdd 100644
--- a/win/vncconfig/vncconfig.rc
+++ b/win/vncconfig/vncconfig.rc
@@ -1,6 +1,7 @@
 //Microsoft Developer Studio generated resource script.
 //
 #include "resource.h"
+#include "resdefs.h"
 
 #define APSTUDIO_READONLY_SYMBOLS
 /////////////////////////////////////////////////////////////////////////////
@@ -438,8 +439,8 @@
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,90,0
- PRODUCTVERSION 1,0,90,0
+ FILEVERSION __RCVERSION
+ PRODUCTVERSION __RCVERSION
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -456,15 +457,20 @@
         BEGIN
             VALUE "Comments", "\0"
             VALUE "CompanyName", "TigerVNC Project\0"
+            #ifdef WIN64
+            VALUE "FileDescription", "TigerVNC Server Configuration Applet for Win64\0"
+            VALUE "ProductName", "TigerVNC Server Configuration Applet for Win64\0"
+            #else
             VALUE "FileDescription", "TigerVNC Server Configuration Applet for Win32\0"
-            VALUE "FileVersion", "1.0.90\0"
+            VALUE "ProductName", "TigerVNC Server Configuration Applet for Win32\0"
+            #endif
+            VALUE "FileVersion", __RCVERSIONSTR
             VALUE "InternalName", "vncconfig\0"
-            VALUE "LegalCopyright", "Copyright (C) 1998-2009 [many holders]\0"
+            VALUE "LegalCopyright", "Copyright (C) 1998-2010 [many holders]\0"
             VALUE "LegalTrademarks", "TigerVNC\0"
             VALUE "OriginalFilename", "vncconfig.exe\0"
             VALUE "PrivateBuild", "\0"
-            VALUE "ProductName", "TigerVNC Configurator\0"
-            VALUE "ProductVersion", "1.0.90\0"
+            VALUE "ProductVersion", __VERSIONSTR
             VALUE "SpecialBuild", "\0"
         END
     END
@@ -482,7 +488,11 @@
 // 24
 //
 
+#ifdef WIN64
+IDR_MANIFEST            24      DISCARDABLE     "vncconfig.exe.manifest64"
+#else
 IDR_MANIFEST            24      DISCARDABLE     "vncconfig.exe.manifest"
+#endif
 #endif    // English (U.K.) resources
 /////////////////////////////////////////////////////////////////////////////
 
diff --git a/win/vncviewer/CMakeLists.txt b/win/vncviewer/CMakeLists.txt
new file mode 100644
index 0000000..863e2d0
--- /dev/null
+++ b/win/vncviewer/CMakeLists.txt
@@ -0,0 +1,28 @@
+include_directories(${CMAKE_BINARY_DIR}/win)
+
+# Disable auto-generated manifests, since we have our own
+if(MSVC)
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
+endif()
+
+add_executable(vncviewer WIN32
+  buildTime.cxx
+  CConn.cxx
+  CConnOptions.cxx
+  CConnThread.cxx
+  ConnectingDialog.cxx
+  ConnectionDialog.cxx
+  DesktopWindow.cxx
+  InfoDialog.cxx
+  OptionsDialog.cxx
+  UserPasswdDialog.cxx
+  ViewerToolBar.cxx
+  vncviewer.cxx
+  vncviewer.rc)
+
+target_link_libraries(vncviewer rfb rfb_win32 Xregion network rdr
+  ws2_32.lib)
+
+install(TARGETS vncviewer
+  RUNTIME DESTINATION .
+)
diff --git a/win/vncviewer/Makefile.am b/win/vncviewer/Makefile.am
index db398ae..1a48625 100644
--- a/win/vncviewer/Makefile.am
+++ b/win/vncviewer/Makefile.am
@@ -42,7 +42,7 @@
 vncviewer_LDFLAGS = -I$(top_srcdir)/win -mwindows
 
 EXTRA_DIST = vncviewer.rc vncviewer.ico cursor1.cur vncviewer.exe.manifest \
-	vncviewer.bmp toolbar.bmp
+	vncviewer.bmp toolbar.bmp CMakeLists.txt
 
 resources.o: vncviewer.rc
 	$(WINDRES) $^ -o $@
diff --git a/win/vncviewer/vncviewer.rc b/win/vncviewer/vncviewer.rc
index 076d5b8..60aa636 100644
--- a/win/vncviewer/vncviewer.rc
+++ b/win/vncviewer/vncviewer.rc
@@ -1,6 +1,7 @@
 //Microsoft Developer Studio generated resource script.
 //
 #include "resource.h"
+#include "resdefs.h"
 
 #define APSTUDIO_READONLY_SYMBOLS
 /////////////////////////////////////////////////////////////////////////////
@@ -67,8 +68,8 @@
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,90,0
- PRODUCTVERSION 1,0,90,0
+ FILEVERSION __RCVERSION
+ PRODUCTVERSION __RCVERSION
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -85,15 +86,20 @@
         BEGIN
             VALUE "Comments", "\0"
             VALUE "CompanyName", "TigerVNC Project\0"
+            #ifdef WIN64
+            VALUE "FileDescription", "TigerVNC Viewer for Win64\0"
+            VALUE "ProductName", "TigerVNC Viewer for Win64\0"
+            #else
             VALUE "FileDescription", "TigerVNC Viewer for Win32\0"
-            VALUE "FileVersion", "1.0.90\0"
+            VALUE "ProductName", "TigerVNC Viewer for Win32\0"
+            #endif
+            VALUE "FileVersion", __RCVERSIONSTR
             VALUE "InternalName", "free4/vncviewer/win\0"
-            VALUE "LegalCopyright", "Copyright (C) 1998-2009 [many holders]\0"
+            VALUE "LegalCopyright", "Copyright (C) 1998-2010 [many holders]\0"
             VALUE "LegalTrademarks", "TigerVNC\0"
             VALUE "OriginalFilename", "vncviewer.exe\0"
             VALUE "PrivateBuild", "\0"
-            VALUE "ProductName", "TigerVNC Viewer\0"
-            VALUE "ProductVersion", "1.0.90\0"
+            VALUE "ProductVersion", __VERSIONSTR
             VALUE "SpecialBuild", "\0"
         END
     END
@@ -534,7 +540,7 @@
 // 24
 //
 
-#ifdef _WIN64
+#ifdef WIN64
 IDR_MANIFEST            24      DISCARDABLE     "vncviewer.exe.manifest64"
 #else
 IDR_MANIFEST            24      DISCARDABLE     "vncviewer.exe.manifest"
diff --git a/win/winvnc/CMakeLists.txt b/win/winvnc/CMakeLists.txt
new file mode 100644
index 0000000..811492c
--- /dev/null
+++ b/win/winvnc/CMakeLists.txt
@@ -0,0 +1,33 @@
+include_directories(${CMAKE_BINARY_DIR}/win)
+
+# Disable auto-generated manifests, since we have our own
+if(MSVC)
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
+endif()
+
+add_library(wm_hooks SHARED
+  ../wm_hooks/wm_hooks.cxx
+	../wm_hooks/wm_hooks.def
+	../wm_hooks/wm_hooks.rc)
+
+add_executable(winvnc4 WIN32
+  buildTime.cxx
+  ControlPanel.cxx
+  JavaViewer.cxx
+  ManagedListener.cxx
+  QueryConnectDialog.cxx
+  STrayIcon.cxx
+  VNCServerService.cxx
+  VNCServerWin32.cxx
+  winvnc.cxx
+  winvnc.rc)
+
+target_link_libraries(winvnc4 rfb rfb_win32 Xregion network rdr ws2_32.lib)
+
+install(TARGETS winvnc4
+  RUNTIME DESTINATION .
+)
+
+install(TARGETS wm_hooks
+  RUNTIME DESTINATION .
+)
diff --git a/win/winvnc/Makefile.am b/win/winvnc/Makefile.am
index 19f3ada..0ede921 100644
--- a/win/winvnc/Makefile.am
+++ b/win/winvnc/Makefile.am
@@ -20,7 +20,7 @@
 winvnc4_LDFLAGS = -mwindows

 

 EXTRA_DIST = winvnc.rc winvnc.ico connected.ico icon_dis.ico connecte.ico \

-	winvnc4.exe.manifest winvnc.bmp

+	winvnc4.exe.manifest winvnc.bmp CMakeLists.txt

 

 resources.o: winvnc.rc

 	$(WINDRES) $^ -o $@

diff --git a/win/winvnc/winvnc.rc b/win/winvnc/winvnc.rc
index 3cbc0a4..d514c4a 100644
--- a/win/winvnc/winvnc.rc
+++ b/win/winvnc/winvnc.rc
@@ -1,6 +1,7 @@
 //Microsoft Developer Studio generated resource script.
 //
 #include "resource.h"
+#include "resdefs.h"
 
 #define APSTUDIO_READONLY_SYMBOLS
 /////////////////////////////////////////////////////////////////////////////
@@ -58,8 +59,8 @@
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,90,0
- PRODUCTVERSION 1,0,90,0
+ FILEVERSION __RCVERSION
+ PRODUCTVERSION __RCVERSION
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -76,15 +77,20 @@
         BEGIN
             VALUE "Comments", "\0"
             VALUE "CompanyName", "TigerVNC Project\0"
+            #ifdef WIN64
+            VALUE "FileDescription", "TigerVNC Server for Win64\0"
+            VALUE "ProductName", "TigerVNC Server for Win64\0"
+            #else
             VALUE "FileDescription", "TigerVNC Server for Win32\0"
-            VALUE "FileVersion", "1.0.90\0"
+            VALUE "ProductName" "TigerVNC Server for Win32\0"
+            #endif
+            VALUE "FileVersion", __RCVERSIONSTR
             VALUE "InternalName", "winvnc\0"
-            VALUE "LegalCopyright", "Copyright (C) 1998-2009 [many holders]\0"
+            VALUE "LegalCopyright", "Copyright (C) 1998-2010 [many holders]\0"
             VALUE "LegalTrademarks", "TigerVNC\0"
             VALUE "OriginalFilename", "winvnc4.exe\0"
             VALUE "PrivateBuild", "\0"
-            VALUE "ProductName", "TigerVNC Server\0"
-            VALUE "ProductVersion", "1.0.90\0"
+            VALUE "ProductVersion", __VERSIONSTR
             VALUE "SpecialBuild", "\0"
         END
     END
@@ -222,7 +228,11 @@
 // 24
 //
 
+#ifdef WIN64
+IDR_MANIFEST            24      DISCARDABLE     "winvnc4.exe.manifest64"
+#else
 IDR_MANIFEST            24      DISCARDABLE     "winvnc4.exe.manifest"
+#endif
 
 /////////////////////////////////////////////////////////////////////////////
 //
diff --git a/win/winvnc/winvnc4.exe.manifest64 b/win/winvnc/winvnc4.exe.manifest64
new file mode 100644
index 0000000..be02243
--- /dev/null
+++ b/win/winvnc/winvnc4.exe.manifest64
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<assemblyIdentity
+   version="4.0.0.26"
+   processorArchitecture="AMD64"
+   name="TigerVNC.winvnc4.exe"
+   type="win32"
+/>
+<description>.NET control deployment tool</description>
+<dependency>
+   <dependentAssembly>
+     <assemblyIdentity
+       type="win32"
+       name="Microsoft.Windows.Common-Controls"
+       version="6.0.0.0"
+       processorArchitecture="AMD64"
+       publicKeyToken="6595b64144ccf1df"
+       language="*"
+     />
+   </dependentAssembly>
+</dependency>
+</assembly>
diff --git a/win/wm_hooks/wm_hooks.def b/win/wm_hooks/wm_hooks.def
index b9198ab..a70908a 100644
--- a/win/wm_hooks/wm_hooks.def
+++ b/win/wm_hooks/wm_hooks.def
@@ -1,5 +1,5 @@
 LIBRARY      "wm_hooks"
-DESCRIPTION  'Window Message Hooks Dynamic Link Library'
+; DESCRIPTION  'Window Message Hooks Dynamic Link Library'
 
 SECTIONS
 	.WM_Hooks_Shared read write shared
diff --git a/win/wm_hooks/wm_hooks.rc b/win/wm_hooks/wm_hooks.rc
index 5a11fd2..d80c983 100644
--- a/win/wm_hooks/wm_hooks.rc
+++ b/win/wm_hooks/wm_hooks.rc
@@ -1,6 +1,7 @@
 //Microsoft Developer Studio generated resource script.
 //
 #include "resource.h"
+#include "resdefs.h"
 
 #define APSTUDIO_READONLY_SYMBOLS
 /////////////////////////////////////////////////////////////////////////////
@@ -54,8 +55,8 @@
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 4,1,0,0
- PRODUCTVERSION 4,1,0,0
+ FILEVERSION __RCVERSION
+ PRODUCTVERSION __RCVERSION
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -72,15 +73,20 @@
         BEGIN
             VALUE "Comments", "\0"
             VALUE "CompanyName", "Constantin Kaplinsky\0"
+            #ifdef WIN64
+            VALUE "FileDescription", "TigerVNC Server Hooking DLL for Win64\0"
+            VALUE "ProductName", "TigerVNC Server Hooking DLL for Win64\0"
+            #else
             VALUE "FileDescription", "TigerVNC Server Hooking DLL for Win32\0"
-            VALUE "FileVersion", "4.1\0"
+            VALUE "ProductName", "TigerVNC Server Hooking DLL for Win32\0"
+            #endif
+            VALUE "FileVersion", __RCVERSIONSTR
             VALUE "InternalName", "\0"
             VALUE "LegalCopyright", "Copyright (C) 1998-2005 [many holders]\0"
             VALUE "LegalTrademarks", "TigerVNC\0"
             VALUE "OriginalFilename", "wm_hooks.dll\0"
             VALUE "PrivateBuild", "\0"
-            VALUE "ProductName", "TigerVNC Server\0"
-            VALUE "ProductVersion", "4.1\0"
+            VALUE "ProductVersion", __VERSIONSTR
             VALUE "SpecialBuild", "\0"
         END
     END