View Full Version : Simple x264 Updater


DevilsAdv0cate
19th January 2013, 22:48
Updating the x264 binaries that are supplied with the Simple x264 Launcher (http://mulder.brhack.net/#x264_x64) (a must have encoding tool!) can be a pain. Now it doesn't have to be. Download .NET 4.0 (http://www.microsoft.com/en-us/download/details.aspx?id=17851) while you're reading this, if you don't have it already (http://www.asoft.be/prod_netver.html).

http://i.imgur.com/Yt4eLAR.png
http://i.imgur.com/FOHGPry.png

Features Checks x264.nl for new builds and determines if your local copy is out of date
Downloads (and effectively updates) outdated x264 binaries from an x264.nl mirror of your choosing
It's pretty if you have Windows 7 + Aero
Very simple interface
Grammar Nazis rejoice! Programmatically generated text does its best to remain grammatically correct under varying situations. E.g. (http://pastie.org/private/ecmt5bls1a24jiayidwnkq)
Known Issues
If you have UAC enabled and you've installed the Launcher to Program Files, you need to run it "As an administrator" manually. If you're on XP or if you have UAC disabled, this doesn't affect you. You can check for updates without admin but it'll give you an error if you try to update without admin (if you need it).
If you close the main window while it's performing any kind of background operation, the background thread will continue to execute until it's done.
Planned Enhancements
Give you the option to update only specific binaries of your choosing and ignore others. The current selection logic will only update 32-bit binaries on 32-bit PCs. All binaries will be updated on 64-bit PCs.
Automatically update (or at least check for updates).
Update the launcher itself.
Update the updater.
Add easter eggs. It's way too serious as-is.
Current Version: v1.2.5180.2506 (R3)

You can download the latest and previous releases below. Please pardon attachments pending approval.

Changelog & Previous Releases
1.2.5180.2506 (R3) Support for new builds directly from VideoLAN.org
Support for the new Simple x264 Launcher toolset directory layout.
Had to remove mirror support for now. Sorry. :(
Uploaded as a zip because the 7z file size limit is a mere 200KB for some reason. Zip goes up to 300.
1.1.4714.37048 (R2) Text is easier to read on dark Aero glass
A dedicated options dialog box
All previous settings have been moved to the options box (and are now saved), decluttering the UI
x264.nl mirror selection
Aero glass can now be disabled
Simple x264 directory is now saved, useful if you have a custom installation location
"Developed by" opens a sexy About dialog
When an update operation completes, the x264 Status text will change accordingly.
Improved error and exception handling 'cause shit happens
1.0.4605.39408 (R1) Initial release

How to Use
Again, you'll need .NET 4 if you don't already have it (http://www.asoft.be/prod_netver.html). The updater is pretty self-explanatory. Just make sure that the toolset path (in the options dialog) is correct.

When reporting bugs please include the log output. Even if it doesn't seem to say anything useful it'll help me determine where the issue is.

LoRd_MuldeR
20th January 2013, 14:22
Again, you'll need .NET 4 if you don't already have it (http://www.asoft.be/prod_netver.html). The updater is pretty self-explanatory. Just make sure that the toolset path (in the options dialog) is correct.

Food for thoughts: Do we really need a ~1 GB framework to realize a simple "Updater" application like this? It's like taking a sledgehammer to crack a nut ;)

I think the same could be implemented with NSIS + Inetc and result in a fully self-contained 300 KB program file with no additional dependencies at all... (similar to the Chromium Updater that I once put together)

If you have UAC enabled and you've installed the Launcher to Program Files, you need to run it "As an administrator" manually.

Add a proper UAC manifest to your program file and this won't be needed any longer...

Alternatively, if you don't want your app to always run with "elevated rights", you could detect the problematic situation and, in that case, have your app to restart itself with "elevated" rights.

(ShellExecute with "runas" verb is your friend here)

Grammar Nazis rejoice!

What is that supposed to mean? Please explain!

Atak_Snajpera
20th January 2013, 15:59
Food for thoughts: Do we really need a ~1 GB framework to realize a simple "Updater" application like this? It's like taking a sledgehammer to crack a nut
I have the same feeling :) Besides downloading manually new binaries every 4-6 weeks from x264.nl is that hard?

DevilsAdv0cate
21st January 2013, 00:17
Food for thoughts: Do we really need a ~1 GB framework to realize a simple "Updater" application like this? It's like taking a sledgehammer to crack a nut ;)

I think the same could be implemented with NSIS + Inetc and result in a fully self-contained 300 KB program file with no additional dependencies at all... (similar to the Chromium Updater that I once put together)



Add a proper UAC manifest to your program file and this won't be needed any longer...

Alternatively, if you don't want your app to always run with "elevated rights", you could detect the problematic situation and, in that case, have your app to restart itself with "elevated" rights.

(ShellExecute with "runas" verb is your friend here)



What is that supposed to mean? Please explain!
You're completely right. I could have written a pretty small app in C or similar. I wanted to develop my C# skills though. I thought more people would have had .NET 4.0 by now but apparently not. :p I originally had it running under the Client Profile but I had to switch to the full framework for a reason I can't remember. .NET does seem to be one of those things on Windows that you can't get away without it for very long.

I've considered the manifest and automatic runas relaunch options but neither of them are implementations I'd be happy with. I'd like to practice the policy of only asking for elevated permissions when they're actually needed. My solution is to have the app call itself with CLI parameters on the update function. There would be two instances of the app running (during update), the primary one and the second elevated one. This way we don't lose the state of the GUI and the actual implementation is completely transparent to the user.

As far as the "Grammar Nazis rejoice!" part just means that I've coded in things like (pseudocode for readability)

string output = "minute";
if(numberOfMinutes != 1) {
output = output + "s";
} // 1 minute or 2 minutes


I have the same feeling :) Besides downloading manually new binaries every 4-6 weeks from x264.nl is that hard?
It's not that it's difficult it's just tedious. One would have to actually check which version he has, then which version is on the site, then download the new binaries, rename them, and then move them into the directory. That was part of my rationale for the tool.

LoRd_MuldeR
21st January 2013, 01:58
.NET does seem to be one of those things on Windows that you can't get away without it for very long.

Try C++ with Qt, if you haven't yet ;)

I have a long history in creating GUI apps with Borland Delphi. Also did a GUI project in C# for a customer. There are a lot of similarities (much more than I had expected).

Still I would always prefer Qt nowadays. This was quite an "aha! effect" when I used Qt for the first time. And now I don't want to miss!

For example: Having to update GUI controls from a background thread with delegate's and Invoke() in C# feels like using Delphi's Synchronize() method back in year 1995.

Singals and Slots conceptually is so much more elegant and cleaner...

I've considered the manifest and automatic runas relaunch options but neither of them are implementations I'd be happy with. I'd like to practice the policy of only asking for elevated permissions when they're actually needed.

I agree. Running "regular" applications with elevated rights is a no-go. But "installer" and "update" programs are the kind of applications that simply need "elevated/sudo rights" to do their job. Programs should be installed to %PROGRAMFILES% and we can assume 99% of all users will do that. Also there is a good reason (security!) why that directory is read-only for regular users. Similar to "/usr/bin" on Unix/Linux systems. Consequently I wouldn't bother to add a lot of additional complexity to my software, just to save one UAC dialog for the 1% of users that happen to have to program installed in a directory with "public" write access.

As far as the "Grammar Nazis rejoice!" part just means that I've coded in things like (pseudocode for readability)

string output = "minute";
if(numberOfMinutes != 1) {
output = output + "s";
} // 1 minute or 2 minutes

Still I don't get what this has to do with Nazis (National Socialism !?) :confused:

Anyway: In Qt we would simply use QString output = tr("%n minute", "", numberOfMinutes) and let the translation engine do its job.

See also:
http://harmattan-dev.nokia.com/docs/library/html/qt4/linguist-programmers.html#handling-plural-forms

DevilsAdv0cate
21st January 2013, 02:16
Qt is definitely something I want to look at when I sit down and actually learn C(++). There are actually a few somewhat new (4.0) functions in C# that make working with threads less archaic but I haven't taken advantage of them yet.

I just made that minute(s) code up on the spot and made it pretty verbose just to get the point across. I have a function apparently similar to Qt's tr() ;)

Edit 1/27/13: The difference (that matters for me) between the .NET 4 Client Profile and the full .NET 4 package is that the CP can be easily downloaded via Windows Update. The full package is only ~7 MB larger at about 50 MB.

DevilsAdv0cate
8th March 2014, 07:34
New release with support for new videolan.org builds and new x264 Launcher toolset directory. Attachment pending approval.