roll your own vnc package

February 11, 2005

I have been looking into providing remote desktop support for my clients. I tried unattended installs with fastpush, but had some issues with remote registry editing being disabled by default in XP and not wanting to deal with figuring out admin passwords for workgroup computers. I finally decided to roll my own VNC package that is a one click install for the end-user. It includes setting up the server password and changing the default port number for security.

Just a caveat, never run VNC over the internet without some sort of VPN or encryption.
I chose RealVNC to start although I may move to TightVNC as it has some nice features coming down the road soon including file transfers. These instuctions are an updated subset of the one’s found here.

  1. Install RealVNC on a machine and configure it exactly how you want it to install on the remote machine.
  2. Export the following registry key HKLM/Software/RealVNC/WinVNC4 to a file
  3. Download and install the Quick Start Pack from Inno Setup
  4. In ISTool drag the following files from C:\Program Files\RealVNC\VNC4
    • winvnc4.exe
    • wm_hooks.dll
    • logmessages.dll

    into Files and Dirs and select {app} for the DestDir.

  5. Drag your registry dump into Registry
  6. Goto Project > Setup Options > Application and chose an application name and version.
    Under the App Directory tab type {pf}\RealVNC\VNC4 and check ‘Disable directory page’
    Under Pages check ‘Disable startup prompt’ and ‘Disable finished page’
    Under Compiler, choose your output directory and output base filename (.exe will be appended automatically)
  7. Project > Compile Setup

Now you’ve got your own setup routine, but I wanted a few more options to make life easier. Namely, I wanted VNC to be registered as a service, start automatically, open XP firewall ports, and allow users to easily enable or disable the service.

  1. Created a file ‘enable.bat’ in the VNC4 directory that contains the following commands:
    winvnc4 -register
    net start winvnc4
  2. Created a file ‘disable.bat’ in the VNC4 directory that contains the following commands:
    net stop winvnc4
    winvnc4 -unregister
  3. Now create nice shortcuts to the batch files and give them friendly names such as “Enable Remote Access” and nice icons.
  4. Add the 4 new files to ISTools. Put the batch files in {app} and the shortcuts on {userdesktop}.
  5. To start the service on install, click on ‘Install Run’ and right click in the right pane to ‘Create a new item.’ Filename is {app}\enable.bat. To make sure this does not get run on 9x, change the minimum versions under the Common tab.
  6. To open up the XP firewall create another new item. Filename: netsh and Parameters: firewall add portopening TCP 5900 VNC_Port. If you changed the default port in your original setup, change it here as well. To make sure this command only gets run on XP change the minimum versions under the Common tab.
  7. Now do the same for Uninstall Run, except use disable.bat and netsh delete portopening 5900

There you have it.

2 Responses to “roll your own vnc package”

  1. N3LDAN Says:



  2. Fencer Says:

    Hi! I’m not sure if you’re able – and willing – to help me, but I’m so desperate I’ll give it a try! According to my ISP, my cable connection’s been very slow lately because I have some spyware in my PC (using Windows XP). I ran AdAware and Spybot, but couldn’t find anything. Then, they asked me if I had VNC installed. And I do, because a couple of months ago I tested a wireless router. So, they told me I should uninstall VNC Server 4.0 or format my HD. I tried to uninstall it, using the remove software option in control panel, but the icon keeps on showing in the startup bar, even when I disable all programs in msconfig. Do you think there’s something you can do to help me avoid formatting the HD?
    Thanks in advance,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: