Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: https://forum.uvnc.com/viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: https://forum.uvnc.com/viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://x.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

Exe creation script

Single Click discussions / bugs
Post Reply
skyjumpr

Exe creation script

Post by skyjumpr »

I've created a script to create the exe and made it available for download at: http://www.onehawk.com/uvncsc.asp

The zip file consists of just the scripts, directory structure, and a few custom files. You'll still need to download the 3rd party tools (all freeware) as well as generating at least one exe via UltraVNC's web site. Instructions for use as well as links to the 3rd party tools are contained on the web site as well as in the "readme.txt" file located in the zip file.

Note: READ the info in the readme.txt before editing or running the script. There are files that need to be copied into place in order for the script to work correctly. Customization is still done as per the instructions on www.ultravnc.com but you can now also include custom version info for the exe.

The zip file located at the URL listed above needs to be extracted to the C: drive. It will create a C:\UVNCSC directory.

I would have zipped up all of the required tools and files but I believe that would have been against the policies of some of the authors.


skyjumpr
jschein

Post by jschein »

Sky,

Well compiled "how to" list with links for applicable programs. I will post this link elsewhere in this forum as someone was just looking for the info.

Good job and thank you for your time in putting this together.
tim71
8
8
Posts: 16
Joined: 2005-02-08 09:11
Location: Finland
Contact:

Post by tim71 »

Got the script and needed binaries.
However I ran into one problem with it - when I did my own zip with my own connection parameters and own rc4 key and then generated exe-file from it, then I got exe-file with "default" parameters as result - just the one like generated from unmodified 'custom.zip' on VNC SC page...

I have doubts - have I done everything right? I tried to follow the "readme" that came with the package and got all needed binaries. Everything seems to be working and there are no errors displayed during generation process - however the result is not what it supposed to be - exe is named after my self-made zip, but file in itself is generated from unmodified parameters :|
Guest

Post by Guest »

tim71 wrote:Got the script and needed binaries.
However I ran into one problem with it - when I did my own zip with my own connection parameters and own rc4 key and then generated exe-file from it, then I got exe-file with "default" parameters as result - just the one like generated from unmodified 'custom.zip' on VNC SC page...

I have doubts - have I done everything right? I tried to follow the "readme" that came with the package and got all needed binaries. Everything seems to be working and there are no errors displayed during generation process - however the result is not what it supposed to be - exe is named after my self-made zip, but file in itself is generated from unmodified parameters :|
Almost sounds as though the zip was not extracted to the work directory and so it used the default files instead. Verify the following steps were completed.

As long as the UVNCSC directory is sitting off the root of c: (c:\uvncsc) and all the subdirectories (bin, custom, inc, work) are directly below that the script should work. Did you copy the zip to the uvncsc directory? And did you run the command using the zip filename as the parameter (without the zip extension ie: myfile.zip would be passed as "create_exe.cmd myfile")?

I've created a new cmd file with logging included to http://www.onehawk.com/freefiles/uvncsc/create_exe2.cmd
This works the same as before but creates a log file called c:\uvncsc\uvncsc.log
It lists the contents of the work directory after file deletion, after copying from the inc directory and after extraction of the zip. You can compare times and dates to verify that the zip extracted to the work directory.
Guest

Post by Guest »

Anonymous wrote:
tim71 wrote:Got the script and needed binaries.
However I ran into one problem with it - when I did my own zip with my own connection parameters and own rc4 key and then generated exe-file from it, then I got exe-file with "default" parameters as result - just the one like generated from unmodified 'custom.zip' on VNC SC page...

I have doubts - have I done everything right? I tried to follow the "readme" that came with the package and got all needed binaries. Everything seems to be working and there are no errors displayed during generation process - however the result is not what it supposed to be - exe is named after my self-made zip, but file in itself is generated from unmodified parameters :|
Almost sounds as though the zip was not extracted to the work directory and so it used the default files instead. Verify the following steps were completed.

As long as the UVNCSC directory is sitting off the root of c: (c:\uvncsc) and all the subdirectories (bin, custom, inc, work) are directly below that the script should work. Did you copy the zip to the uvncsc directory? And did you run the command using the zip filename as the parameter (without the zip extension ie: myfile.zip would be passed as "create_exe.cmd myfile")?

I've created a new cmd file with logging included to http://www.onehawk.com/freefiles/uvncsc/create_exe2.cmd
This works the same as before but creates a log file called c:\uvncsc\uvncsc.log
It lists the contents of the work directory after file deletion, after copying from the inc directory and after extraction of the zip. You can compare times and dates to verify that the zip extracted to the work directory.
Whoops. Make that url: http://www.onehawk.com/freefiles/uvncsc/create_exe2.txt instead. Simply save to the UVNCSC directory and rename to .cmd instead of .txt. Forgot I was filtering cmd files thru my firewall. :)
tim71
8
8
Posts: 16
Joined: 2005-02-08 09:11
Location: Finland
Contact:

Post by tim71 »

Anonymous wrote:
Almost sounds as though the zip was not extracted to the work directory and so it used the default files instead. Verify the following steps were completed.

As long as the UVNCSC directory is sitting off the root of c: (c:\uvncsc) and all the subdirectories (bin, custom, inc, work) are directly below that the script should work. Did you copy the zip to the uvncsc directory? And did you run the command using the zip filename as the parameter (without the zip extension ie: myfile.zip would be passed as "create_exe.cmd myfile")?
Just tried to generate the executable with this logging-enabled script and...

I did just like it was stated in Readme - put my own modified zip-file in C:\UVNCSC and then ran the script

at the command "C:\UVNCSC\BIN\7z.exe e %1.zip -y -oC:\UVNCSC\WORK *.*" log states "there is no such archive"...

That must be the problem - my zip.archive is in C:\UVNCSC but extractor cannot find it and generates executable from files in /INC directory
tim71
8
8
Posts: 16
Joined: 2005-02-08 09:11
Location: Finland
Contact:

Post by tim71 »

It seems like I found, what was the problem - I changed C:\UVNCSC\BIN\7z.exe e %1.zip... to C:\UVNCSC\BIN\7z.exe e *.zip... in create_exe.cmd and now log says everything is OK...

Edit: yep, with this little correction executable generated right and when I extracted this executable for verification, then I found the right rc4.key file in it.

Now I put the right plugin in /INC directory and got executable finally to work with plugin v1.1.4

Edit: have to correct myself again: this %1.zip - argument works, if archive name is same as executable I am creating (command line <create_exe 'filename'>) - in this case if you give 'filename' to command line as name for executable and archive is not named 'filename'.zip, then script generates executable, but from wrong files. There will be a "there is no such archive"-error, but executable will still be generated from the files in INC-folder without any other warning...

It would be reasonable to add some interruption with warning message for this kind of situation to prevent the file creation from the wrong source.

Otherwise script seems to be working fine
Guest

Post by Guest »

tim71 wrote:It seems like I found, what was the problem - I changed C:\UVNCSC\BIN\7z.exe e %1.zip... to C:\UVNCSC\BIN\7z.exe e *.zip... in create_exe.cmd and now log says everything is OK...

Edit: yep, with this little correction executable generated right and when I extracted this executable for verification, then I found the right rc4.key file in it.

Now I put the right plugin in /INC directory and got executable finally to work with plugin v1.1.4

Edit: have to correct myself again: this %1.zip - argument works, if archive name is same as executable I am creating (command line <create_exe 'filename'>) - in this case if you give 'filename' to command line as name for executable and archive is not named 'filename'.zip, then script generates executable, but from wrong files. There will be a "there is no such archive"-error, but executable will still be generated from the files in INC-folder without any other warning...

It would be reasonable to add some interruption with warning message for this kind of situation to prevent the file creation from the wrong source.

Otherwise script seems to be working fine
Since I had named the zipfiles the same as I wanted for the exe's this wasn't a problem for me. I could add a second parameter for an alternate name. If there is no second parameter passed then I will use the zipfile name for the exe. I've modified the code and docs in the UVNCSC.ZIP file so you can download it again. I haven't changed the code in the create_exe2.txt

Skyjumpr
jschein

Aaargh lol

Post by jschein »

Ok... Compiled the self extracting exe with ultra vnc...

It works like a champ...

But when I mod the files and try to create my own with 7z... it doesn't compile. What exactly did you do?

I re-did this from scratch 3 times.
Guest

Re: Aaargh lol

Post by Guest »

jschein wrote:Ok... Compiled the self extracting exe with ultra vnc...

It works like a champ...

But when I mod the files and try to create my own with 7z... it doesn't compile. What exactly did you do?

I re-did this from scratch 3 times.
I sent you a reply in email. Try the new script I linked to. It may be a problem with your modified icons.

skyjumpr
jschein

thanks

Post by jschein »

Had a buddy zip his entire directory.. blew mine away and had it finally compile the .exe but the .exe was corrupt with a 7zip error and only 41kb.

Installed latest 7zip program to c:\uvncsc\bin , ran it again and VOILA... like candy. Thank you for your time and assistance.
xrxca
8
8
Posts: 11
Joined: 2004-11-15 20:59

Post by xrxca »

I've made some modifications to the creation script that may be usefull to others, the modified script is available at http://www.xrx.ca/create_exe_mod.zip, the modifications include:

The directory no longer has to be C:\UVNCSC\, the directory is determined from the command run, or current directory if no path was included in the run command. (I really hate being forced to put things in C:\, almost as much as I hate having to edit scripts when I move a directory)

ie: D:\UVSC\create_exe_mod.cmd will use D:\UVSC as its directory, and if you are at a command prompt in that directory and type simply create_exe_mod.cmd it will also find the correct directory.

WARNING: Using a relative path when running the command from a command prompt ie: ..\UVSC\create_exe_mod.cmd will FAIL, so dont.

If NO Zip file is specified it will prompt for a zip file

The zip filename passed to the program can have the .zip extension or not (it will be added if necessary), and does not need to be in the same directory as the program, this allows you to use filename completion at a command prompt, and more importantly, allows you to drag and drop a zip file onto create_exe_mod.cmd

Long filenames are handled properly (quoted etc.), and the default target archive basename is extracted from the source zips filename if it isn't specified as the 2nd parameter, if you use drag and drop, or are prompted for the zip file it will always use the zip files name.

The directory layout is the same as for the original with the following exception. I removed the rc4.key file from the INC directory, and if there is no rc4.key file in the source zip file, MSRC4Plugin.dsm will not be included in the final exe (reducing the size a bit)

You still need the original (link above), but I find the mods make it easier.

Skyjumpr: If you want to incorporate the mods into your original, go for it.
Last edited by xrxca on 2005-04-27 00:11, edited 2 times in total.
JonF
Posts: 1
Joined: 2007-06-19 23:13

Post by JonF »

From your script:
xrxca wrote:If someone knows a better way to get the directory let me know
I haven't had a chance to test it in this script yet, but %~dp0% should work, even with a UNC path. See Using batch parameters for an explanation. Oh, and a "setlocal" at the beginning and "endlocal" at the end would be nice (to avoid permanent changes to the path).
Last edited by JonF on 2007-06-19 23:24, edited 2 times in total.
Post Reply