aboutsummaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorAdam Tkac <atkac@redhat.com>2011-02-07 10:45:50 +0000
committerAdam Tkac <atkac@redhat.com>2011-02-07 10:45:50 +0000
commit8311f4e2e43af11439fa3fd79377591d67de738a (patch)
tree47ba64c36d4078908dc4985d6786fb286f8b8fcd /win
parentaf0817220ee171837b4c15019fe16c2d5de180ad (diff)
downloadtigervnc-8311f4e2e43af11439fa3fd79377591d67de738a.tar.gz
tigervnc-8311f4e2e43af11439fa3fd79377591d67de738a.zip
[Bugfix] win vncviewer: create VNC home directory during startup.
Thanks to Guillaume Destuynder. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4253 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'win')
-rw-r--r--win/vncviewer/vncviewer.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/win/vncviewer/vncviewer.cxx b/win/vncviewer/vncviewer.cxx
index f861e796..1c68808a 100644
--- a/win/vncviewer/vncviewer.cxx
+++ b/win/vncviewer/vncviewer.cxx
@@ -31,6 +31,7 @@
#include <vncviewer/OptionsDialog.h>
#include <vncviewer/ListenTrayIcon.h>
#include <network/TcpSocket.h>
+#include <os/os.h>
#include <rfb/Logger_stdio.h>
#include <rfb/Logger_file.h>
#include <rfb/LogWriter.h>
@@ -220,6 +221,17 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prevInst, char* cmdLine, int cmdSho
programInfo();
+ // Create vnc in the user's home directory if it doesn't already exist
+ char* homeDir = NULL;
+ if (getvnchomedir(&homeDir) == -1)
+ vlog.error("Could not create vnc directory: can't obtain home directory path");
+ else {
+ int result = CreateDirectory(homeDir, NULL);
+ if (result <= 0 && GetLastError() != ERROR_ALREADY_EXISTS)
+ vlog.error("Could not create vnc directory: %u", GetLastError());
+ delete [] homeDir;
+ }
+
// - Connect to the clients
if (!configFiles.empty() || !hosts.empty() || acceptIncoming) {
// - Configure the registry configuration reader