topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 12:08 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: DcuHelper.exe v1.10 (7/12/11) - Update checking for your apps (dcupdater compat)  (Read 111300 times)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
latest version of the dcuhelper.exe utillity.

So if you want to add update checking support to your program, you can do so by creating a .dcupdate file in your program directory, and distributing this dcuhelper.exe program with your program.  When you or the user wishes to check for updates, you simply execute this utility (e.g. ShellExecute) and it will:
  • Locate the DcUpdater installed on the user's computer and invoke it for your program (and any plugins your program might have).
  • OR if the DcUpdater tool is not installed, it will do a quick update check and let them know if a new version is available, and bring them to the web page where they can download and install it if so.

Size: 117k (could be compressed if you like to make it even smaller).
Download Latest: https://www.donation...nloads/dcuhelper.zip

The dcuhelper.exe tool can also be used to "register" your program with DcUpdater so that it will appear in the default list of installed programs known by DcUpdater which can be checked for updates.

Version info:
  • v1.10.01 - July 12, 2011 - if launched as a hidden window (common in old versions of dcuhelper) the new dialog would not display; thanks worstje
  • v1.09.01 - July 2, 2011 - now bypasses cache explicitly when checking for version update -- could cause old files on some pcs; thanks wortje
  • v1.08.01 - Mar 23, 2011 - completely new dialog with buttons to open web pages shown when update detected; support for showing whats new
  • v1.07.01 - Jan 5, 2011 - improved the -u unregister parameter; added icon to dcuhelper to improve message boxes (thanks Worstje)
  • v1.06.01 - Jan 4, 2011 - added overide and redirect options in versioninfo file (see readme)
  • v1.05.01 - October 8, 2010 - added better help
  • v1.04.01 - Decmeber 30, 2009 - added new built-in quick web version checking into dcuhelper itself; see https://www.donation....msg189826#msg189826 for more info
  • v1.03.01 - August 1, 2008 - added -t commandline option; fixed bug in opening dcupdater page; improved dialog on updater not installed; if no commandline options are passed it will try to load .dcupdate file in current dir and check for updates
  • v1.02.02 - September 8, 2007 - added a few more easier exported funcs.
  • v1.02.01 - September 8, 2007 - added dll exports, improved help; opens program webpage if updater not installed; added version info to usage display (invoke with no arguments).
  • v1.01.01 - August 16, 2007 - first public release
« Last Edit: September 15, 2011, 05:03 PM by mouser »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
This is early release without much documentation, so you'll surely need some initial help from me getting everything to work, so don't hesitate to ask.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
I need to say a bit more about using DcUpdater to add update checking support to your programs/downloads:

  • There are a lot of other update checking tools (commercial + free) -- hey we should start a thread in dev corner listing all the ones we can find.
  • Most of them either compile into your program, or are a dll you load into your code and invoke.
  • Some are standalone executables that your program can launch.

The DcUpdater tool is most similar to #3, in that it is a standalone update checking executable, which does not have to be compiled into your code.

However where it differs from other such tools is that the full update checker tool is not really meant to be included with each individual program that uses it.

Instead, the intention is for the DcUpdater tool to be installed like any other application on a users computer, and provide a centralized update checking system for many programs.

That is, the user installs DcUpdater to their system, and other programs can "invoke it" to check for updates.  You can see this at work in my software -- so far 8 of my programs know how to invoke the DcUpdater tool to check for updates.



The tiny 100k dcuhelper.exe tool is not the updater itself(!)  It's a helper utility meant to be packaged in your program, whose only job is to find and communicate with the main big DcUpdater tool installed on the user's computer, OR help the user to download and install it if it's not already (if they want to).



What this means to you as a developer, is that your users will have to go through an extra step if this is the yours is the first program they have installed that uses the DcUpdater tool and they haven't installed it yet.  They may find this confusing and irritating.

So probably you want to go find yourself an update checking solution that is self-contained and you probably don't want to use DcUpdater.

However, if you do want to use it, i'm here to help.  It may be a good match for you if one or more of the following is true:
  • You are a programmer who hangs out at DonationCoder.
  • You have a bunch of tools, each of which needs update support.
  • You use plugins or other user-written content and want an easy way to check for updates for lots of independent items.
  • You like the idea of not bloating up each program with its own update checking code.
« Last Edit: August 16, 2007, 09:03 PM by mouser »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
ps. you can use dcupdater and dcuhelper to add update support to pure data/file packages that contain no executable component at all -- just provide a shortcut that invokes the dcuhelper.exe tool.

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Oh wow just in time!
I was considering writing your dcupdater invoke code as Autohotkey code to include, but this even easier :)

and by the way mouser i've started creating that document we talked about comparing various updater programs during lunch hours. I hope to have it finished next week.
« Last Edit: August 17, 2007, 04:31 AM by justice »

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
What happens:
I have the dcuhelper.exe in a subfolder "dcuhelper" inside my program installation folder (d:\scripts\PutAside01).
I also made svd-putaside.dcupdate in the program folder.

My program runs the command if it hasn't been run before:
d:\scripts\PutAside01\dcuhelper\dcuhelper.exe -r "PutAside" "d:\scripts\PutAside01"

a commandline window flashes up with no text in it, and my program is not recognised by dcupdater.
If I run svd-putaside.dcupdate then dcupdater comes up for my program only (not for the other installed programs).

What i was expecting:
I was expecting that by running the dcuhelper program it would add my program to the list of all the other programs recognised by dcupdater. if this was not the case then I thought the first time I would run my .dcupdate it would also register it.

I don't fully understand what "program_labelname" should be, should this correspond with the filename part of my dcupdate file, should it correspond to the local -> label  value or can it be anything (if so what's the use?)



mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member

I don't fully understand what "program_labelname" should be, should this correspond with the filename part of my dcupdate file, should it correspond to the local -> label  value or can it be anything (if so what's the use?)

yeah sorry i should have explained what that was used for.. it's just used to name the file that is created in, for example:
C:\Documents and Settings\All Users\Application Data\DonationCoder\DcUpdater\RedirectFiles\PROGRAM_LABEL.dcupdateredirect

so the answer is it doesn't really matter what you pass, as long as it's unique to other programs.


getting back to your comment about running it with -r:
a commandline window flashes up with no text in it, and my program is not recognised by dcupdater.

the -r says to create that file above, it does nothing else.  That file just allows DcUpdater to find your program when DcUpdater is run independently (like from Start Menu), rather than being launched from within your program.  You should call ShellExecte with the SW_HIDE parameter so that the user doesnt see the blank window pop up.

You can make the -r call every time your program starts, or just once, OR you can use the -ri commandline parameter mode with dcuhelper to create that file each time you invoke it to check for updates.

To actually call the updater to check for updates from your program you use the -i or -ri commandlie options for dcuhelper.

Does that clarify things a bit?

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Ah right it now checks for updates. Many thanks.

quick glance
if I run dcuhelper with -ri options it does run DCUpdater and checks for my program, but if I run DCUpdater on itself my program is not in the list.

The way I still think it should work is that you register it, after this act the registered program is part of the regular update cycle. At the moment it's not.

I'll look at it again on the monday.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
After the -r call, launching DcUpdater by itself should list your program in the complete list of all known stuff that can be updated.  If it doesn't, check to see if the file "C:\Documents and Settings\All Users\Application Data\DonationCoder\DcUpdater\RedirectFiles\PROGRAM_LABEL.dcupdateredirect" is being created, and if the contents of that file point to the directory of your program.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
An example of suggested way to invoke update check from your program using dcuhelper.exe, from a C++ program:

ShellExecute(NULL,"open",dcufullpath,comlineargs,NULL,SW_HIDE);

where:
  • dcufullpath is the full path to the dcuhelper.exe you installed with your program, e.g.: C:\Program Files\ProcessTamer\dcuhelper.exe
  • comlineargs is: -ri ProcessTamer "C:\Program Files\ProcessTamer" "Warning" -show


mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
ps.
If you use Inno Setup, here is a line you can add to your [Run] section which will use the dcuhelper.exe to automatically register your newly installed program with the updater so the updater itself will know how to check for updates to your program, even before the first use of your program:

Filename: {app}\dcuhelper.exe; WorkingDir: {app}; Description: Create Update Check Helper File..; Flags: nowait runhidden; Parameters: "-r PROGRAM_LABEL ""{app}"""

Basically this just invoked the dcuhelper to create the file described above, silently at end of install (user is not prompted).  Note that this doesnt invoke an update check and doesn't require the updater tool to be installed on the user's computer.  It just creates the dcupdateredirect file so that the dcupdater tool can find it if/when it's installed.
« Last Edit: August 19, 2007, 01:46 PM by mouser »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Another fun tip for Inno Setup users:

What if you want to add a "Check for Updates" item to the start menu group of your program?

Just add this one line to your inno script, in the Icons section:
  • Name: {group}Check for updates; Filename: {app}\dcuhelper.exe; WorkingDir: {app}; Parameters: "-ri PROGRAM_LABEL ""{app}"" ATTENTION -show"; IconFilename: {app}\YOUR_MAIN_PROGRAM.exe; Flags: runminimized

(you can leave off the IconFilename if you dont want to give the shortcut the icon of your main program).

When the user chooses the "Check for Updates" item from the start menu group, dcuhelper.exe will find and invoke the DcUpdater tool or show user how to install it if it isn't installed yet.

NOTE: this gives you a complete way to add update checking to your program without modifying the actual program at all.  you could even use this technique to add update checking to a package you make (which could contain multiple updatable components), consisting of programs you didn't compile yourself.
« Last Edit: August 19, 2007, 01:46 PM by mouser »

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
After the -r call, launching DcUpdater by itself should list your program in the complete list of all known stuff that can be updated.  If it doesn't, check to see if the file "C:\Documents and Settings\All Users\Application Data\DonationCoder\DcUpdater\RedirectFiles\PROGRAM_LABEL.dcupdateredirect" is being created, and if the contents of that file point to the directory of your program.
There is no C:\Documents and Settings\All Users\Application Data\DonationCoder on my XP system.
I've reinstalled 1.21.01 but after running dcupdate it still hasn't appeared.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
justice, rather than try to do tech support here let's talk in irc channel or via email and then we can post the solution here.

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Right the issue is now solved with both a bugfix in dcuhelper and code changes in my code. PutAside is now the first third-party app to support DcUpdater  :Thmbsup:

For AutoHotkey coders feel free to use the following subroutine:
Gosub,EnableAutoUpdate

EnableAutoUpdate:
; Register with DcUpdater and check for updates.
; When no updates are found nothing is displayed.
; make sure the dcuhelper.exe is in a subdirectory called 'dcuhelper' of this script's location.
cmdParams = -ri    ;r = register app, i = check for updates
uniqueID = yourprogramidhere   ;anything allowed
dcuHelperDir = %A_ScriptDir%\dcuhelper
IfExist, %dcuHelperDir%\dcuhelper.exe
{
OutputDebug, %A_Now%: %dcuHelperDir%\dcuhelper.exe %cmdParams% "%uniqueID%" "%A_ScriptDir%" . -shownew -nothingexit
Run, %dcuHelperDir%\dcuhelper.exe %cmdParams% "%uniqueID%" "%A_ScriptDir%" . -shownew -nothingexit,,Hide
}
return
« Last Edit: August 20, 2007, 08:42 AM by justice »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
very nice! thanks for sharing that justice  :up:

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Code: Autohotkey [Select]
  1. ; make sure the dcuhelper.exe is in a subdirectory called 'dcuhelper' of this script's location
If i change the "dcuHelperDir" to %A_ScriptDir%, it won't work? dcuhelper can't be in the script's dir?

Thanks for "outputdebug", i didn't know that existed! :D

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
it doesnt have to be in a subdirectory, i think he was only saying that if his script code specifies its in the subdirectory, then it has to be.  you can put it wherever you want as long as you call it properly.

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Like mouser said. My reasoning is that I like to put files that the user doesn't have to know about out of the way so they don't accidentily click on it.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
this is fantastic! thanks mouser & justice.. :Thmbsup: just a small request: put a downloadable file as well.. :)

justice

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,898
    • View Profile
    • Donate to Member
Lanux128, I created a small AHK application that you can use to check for updates for itself.
http://www.amasan.co.uk/downloads/dummy/

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
thanks Justice, i'm hoping to add DCU support very soon.. :Thmbsup:

ak_

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 223
    • View Profile
    • wopah
    • Read more about this member.
    • Donate to Member
Hmmm, i just tried to add DCu support to my program Subdude, but i can't get it to work.

First, isn't it possible to add a "Copy" method which simply overwrites an .exe file ?

Then, i tried the unzip method and tried to check for updates. From subDude itself, it told me that the program needed update only once. The other times, nothing. When i run dcupdater, it tells me that subdude need udpates, the download works then it does nothing. If i click "UPDATE NOW" again, it downloads the file again, and so on. The zip never gets unzipped.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
send me your .dcupdate file and ill check it and see if i can spot what's wrong ([email protected]).

First, isn't it possible to add a "Copy" method which simply overwrites an .exe file ?

yes i should add such a thing i suppose.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Two people have had a problem because they are specifying:
<UpdateMethod>Unzip</UpdateMethod>

DcUpdater treats this field in a case-sensitive way so it needs to be
<UpdateMethod>unzip</UpdateMethod>

I think i shall change it to be case-insensitive and add an error if a non-recognized method is specified.