This document gives instructions on how to make your own setup.exe file which will install WinVNC. It's a bit old so you may need to rethink some steps for RealVNC4.
You can use this to install VNC to Windows 9x systems via a login script. This
approach won't work on NT/2000 as most users lack the security permissions to
perform such an install.
A working install of Windows 95, 98 or ME for testing.
Installation of IsTool (download here)
Installation of InnoSetup (download here)
Directory containing WinVNC files
Some knowledge of the registry and regedit
Ben Blackmore wrote to me saying that IsTool and InnoSetup have been significantly updated since I wrote this howto. You can use the ISS file that I built up, but you'll need to add in any new files such as VNCHooks or Omnithread2.
IsTool and InnoSetup are two very good programs that let you build your own installation routine - a single setup.exe that contains all shortcuts, registry entries and files. Cool eh? There are other methods (such as Microsoft's MSI system) and other install builders, but I started with IsTool and found it fairly easy to get on with. InnoSetup is the program that allows you write a script and compile this into the setup program. It wasn't long before a GUI arrived, IsTool, which takes all the drudge work out doing it.
Decide what version of VNC you want to roll out. Namely: vanilla VNC, Tridia, Tightvnc or Zvnc. Most people tend to stick with the major release which is vnc. In this example, I'll got with that.
Copy the necessary VNC files from the fastpush zip or find them and copy them from an existing installation (c:\program files\orl\vnc for most files and omnithread_rt.dll will be in c:\windows\system under 9x. In NT, the latter will be c:\winnt\system32).
E.g.: For VNC 3.3.3 R9, we'll need vncviewer.exe, omnithread_rt.dll, vnchooks.dll and winvnc.exe. I've put them in a folder called c:\source
Luckily for us - IsTool lets you import Windows registry files straight in. If you've got a previous install of VNC just as you like it and you've followed the instructions for making a default settings file, then you can just import that.
Failing that, you're going to need to install VNC and configure it. You could check out this quick howto for details on that.
Once you have a valid .reg file (here's a demo), you should save it in c:\source as install.reg. At the end of my demo .reg file there's a subkey called MyAdmin. This is represent a user account called myadmin (obviously you'd rename this to match the account you want to use) and that user is allowed to view the VNC properties and shutdown the program too.
You should now have a c:\source directory that contains all the WinVNC files and a install.reg file too. Load up IsTool and start a new project. Click FILE and then NEW which will fire up a wizard.
The wizard is asking for some build details. You could use my examples below, but keep in mind that your end users are likely to see this screen so keep it clean! :-)
Application name = VNC Application name including version = VNC 3.3.3 Release 9 Application publisher = AT&T Application website = http://www.uk.research.att.com/vnc/
The next step asks for details about the installation folder. Change the Application Directory name to contain "Orl\VNC" rather than "VNC". You should also untick (is that a word?) "Allow user to change the application directory" as you don't want Joe User messing about with any paths.
Click next to continue.....
With this step we need to load in each of the source files. These files will be compared and held within the final setup.exe program. You should uncheck the option marked "Allow user to start....." as that's not necessary.
Use the browse button to add each of the following files: omnithread_rt.dll; vnchooks.dll; vncviwer.exe and winvnc.exe (NB: if you're making a Tridia install you might have zlib.dll in there too).
Once you've added each of the files, you need to modified the final destination for omnithread_rt.dll - that needs to go into the Windows' system folder (or system32 with NT/2000). Click EDIT and another wizard will appear. Use the drop down list to pick "Windows system directory" and click okay.
Now click next to go on to the next stage.
Now strictly speaking you don't need these, but it doesn't take too much effort to sort this out. The Application Start Menu group name should be set to VNC and you want to uncheck the option marked "Allow user to change the Start Menu group name".
Click next to continue.
VNC is released under the GNU public license and as Joe User doesn't need to see it, I've skipped this screen. You may want to add information here if you're making the installer for an outside party.
Click next (again)
If you want the full monty that is the VNC Start Menu icons, read on. If you're not bothered about them skip on to the next step.
Still here? Okay - click on the Icons button from the Sections' Tree. The right hand window pane will show "groups". Under this is an item marked "VNC" - delete this as it's not what we want.
Right click on the group object and select New Item. You'll get a window that looks like the one below (a bigger version is available by clicking it).
The image above is an example of adding a WinVNC shortcut for the listen mode icon. You need to add a icon for each of WinVNC's functions. The only part you need to do any typing in are the Name and Parameter boxes as everything else is a drop down list. The filename box has a drop down listing each file you added in the source files wizard (above). These are the entries you need to add.
Name = {group}\Run VNCViewer (Listen Mode)
Filename = {app}\vncviewer.exe
Parameters = -listen
Name = {group}\Run VNCViewer
Filename = {app}\vncviewer.exe
Name = {group}\Run WinVNC (App Mode)
Filename = {app}\winvnc.exe
Name = {group}\Show About Box
Filename = {app}\winvnc.exe
Parameters = -about
Name = {group}\Show User Settings
Filename = {app}\winvnc.exe
Parameters = -settings
Now we need to add the Administrator Tools subfolder. Click the group item again and choose to make a new item. In the name folder you'll need to prefix the shortcut name with the new folder. Eg: "{group}\Administrative Tools\Install Service Helper".
Name = {group}\Administrative Tools\Install WinVNC Service
Filename = {app}winvnc.exe
Parameter = -install
Name = {group}\Administrative Tools\Remove WinVNC Service
Filename = {app}winvnc.exe
Parameter = -remove
[NB: Should you include this if the user can't shutdown or alter the VNC properties? It's your call]
Name = {group}\Administrative Tools\Run Service Helper
Filename = {app}winvnc.exe
Parameter = -servicehelperName = {group}\Administrative Tools\Show Default Settings
Filename = {app}winvnc.exe
Parameter = -defaultsettings
Name = {group}\Administrative Tools\Start WinVNC Service
Filename = c:\winnt\system32\net.exe
Parameter = start winvnc
Name = {group}\Administrative Tools\Start WinVNC Service
Filename = c:\winnt\system32\net.exe
Parameter = stop winvnc
Select the Registry icon from the left hand pane and in the right hand side, right click and choose "Import from File". You'll want to load in the default.reg file that you saved earlier. Now would be a good time to save your work! :-) You should have a screen showing the various registry keys you saved earlier.
By the way - do you want a warning to come up on the user's screen? If you, add these settings in:
[HKEY_LOCAL_MACHINE\SOFTWARE\ORL\WinVNC3] "AuthHosts"="?"[HKEY_LOCAL_MACHINE\SOFTWARE\ORL\WinVNC3] "AuthHosts"="?"[HKEY_LOCAL_MACHINE\SOFTWARE\ORL\WinVNC3\Default] "QueryTimeout"=dword:0000001e "BeepConnect"=dword:00000001
This will make WinVNC throw up a warning box listing the viewer's IP address. This will stay open for 30 seconds and unless you choose to click yes - it shuts and the viewer is denied access. The vanilla version of WinVNC always defaults to no, but the Tridia version allows you to change this to yes by default.
Appolgies to Shakespeare but this is fairly important. In most installs you'd want WinVNC to be started when the machine boots, not on user request. However, for home users (or power users) you may want VNC to only start when YOU decide.
To install VNC in what's called application mode - namely there isn't a service - it would be handy to have a deskop icon that Joe User can click. To do this go back into the Icons section and add a new item.
Name = {commondesktop}Start VNC Filename = {app}\Winvnc.exe Working dir: = {app}
This will add the icon "Start VNC" to the user's desktop, indeed it should add it to the "all users" desktop. If you want a different icon name, just change the text as necessary. Also click on the Install Run section and delete the entry marked {app}\WinVNC.exe.
To install VNC as a service you'll need to click the left hand window marked Install Run. They'll be an entry marked {app}\WinVNC.exe which you'll need to alter. Firstly, add "-install" to the Parameters box and change the status message to say "Please wait while VNC installs as a service". You should also uncheck all the tick boxes and change the description entry to "Install VNC as a service".
This is shown by the two images below:
Now that the service is being registered by the installer, we need to add in something to start the service and something to fire off the servicehelper. Right click the window and make a new item. The images below show what you need to add. Note that the net start winvnc command has the Run Minimized option on.
Now save your file again.
The next stage is to add a command to the Uninstall Delete section in the left hand window. Select the icon from the left hand side and then right click in the right hand side window to add a new option.
Add an option called net - although you'll need to type this
in, it won't be in the drop down list. Add "stop winvnc"
to the parameters and click okay.
Now add an item by using the drop down list and use the WinVNC.exe entry. This entry will be used to remove the service. Add "-remove" to the Parameters section. Again, just click okay to finish.
Once we've stopped and removed the service, it's only good housekeeping to remove the files we no longer need. Click the Uninstall Delete icon from the left hand side - and in the right hand window, right click and make a new item. In the bottom window, choose File and/or directories from the drop down list. While in the top window type in "{app}\*.*" to delete VNC. Now make another delete entry and this time select "{sys}\omnithread_rt.dll" and choose files from the Type drop down box
Now save the file to c:\source as we're nearly done (honest!). Click PROJECT off the title bar and then SETUP OPTIONS and finally COMPILER. Alter the screen to match the settings I've used below.

Then click Pages to view the next panel and adjust as per the image below:

Save your project and it's time to compile your program and crunch it into a single exe. Choose PROJECT and COMPILE SETUP. A wizard will fire off and (fingers crossed) you won't get any error messages. If you do, it may be due to missing files, the fact that the program can't find the compiler. Check through these instructions.
However, if everything goes to plan - you'll see something like this:

That's it.... all you need to do now is use that file to install VNC to Windows 9x or to NT if the local user has admin rights.