Comment 23 for bug 123631

Revision history for this message
Dan Stieneke (dan-stieneke) wrote :

Single-click using RealVNC 4.1

aamonster is right, that's how I've been doing it, but here's the details:

1) Place the following files into the same directory:
  * 7zr.exe (from the 7zip extras file @ http://sourceforge.net/projects/sevenzip/files/7-Zip/4.65/7z465_extra.7z/download)
  * 7zS.sfx (from the same place. Optionally UPX compress this file)
  * winvnc4.exe (from http://realvnc.com/products/free/4.1/download.html)
  * MakeSC.cmd as shown here
==============Begin MakeSC.cmd==============================
set exeFILE=NewSingleClick.exe
set clean=1
set zFILE=NewSC.7z
set confFILE=config.txt

echo ;!@Install@!UTF-8! > %confFILE%
echo ExecuteFile="go.bat" >> %confFILE%
echo ;!@InstallEnd@! >> %confFILE%

7zr a %zFILE% winvnc4.exe go.bat -m0=BCJ2 -m1=LZMA:d25:fb255 -m2=LZMA:d19 -m3=LZMA:d19 -mb0:1 -mb0s1:2 -mb0s2:3 -mx
copy /b 7zS.sfx + %confFILE% + %zFILE% %exeFILE%
if "%clean%"=="1" (
 del %zFILE%
 del %confFILE%
)
==============End MakeSC.cmd==============================
  * go.bat as shown here
==============Begin go.bat==============================
:: Must use start because winvnc4.exe does NOT return...
:: /B = don't start a separate CMD window
@echo off
start /b winvnc4.exe > nul
echo This program starts a "standalone" version of winvnc4.
echo It may fail if you have winvnc4 installed and running as a service.

goto SkipSingleConnection
set HOST=192.168.31.23
:: There needs to be a delay between the 1st call to winvnc4 and the 2nd, either via menu or ping
ping localhost -n 3 > nul
goto CONNECT
:SkipSingleConnection

echo.
echo After the green/blue/red on white "Vnc" icon appears in your taskbar,
echo choose one of the following:
echo.
echo 1 - Bob's machine
echo 2 - Joe's machine
echo.
set /p MACHINE=Enter the number representing the target machine:
goto Machine%MACHINE%
:Machine1
set HOST=192.168.1.2
goto CONNECT
:Machine2
set HOST=joe.example.com
goto CONNECT
:CONNECT
echo Attempting to connect to %HOST%
winvnc4.exe -connect %HOST% > nul

echo.
echo **********************************************
echo Close this windows to stop sharing your screen
echo **********************************************
echo.
title ***** Close this window to stop sharing your screen *****</verbatim>
==============Begin go.bat==============================

2) Modify MakeSC.cmd and go.bat as appropriate:
  a. set IP addresses
  b. change exeFILE to the preferred name of the final file
  c. set clean to 1 to delete temporary files, anything else to leave them in place
3) Run MakeNewSC.cmd
4) Run your new "NewSingleClick.exe". If you UPX'd the .sfx, it should be under 300K