Welcome Guest.   Make a donation to an author on the site October 25, 2014, 11:51:28 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2014! Download dozens of custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: Prev 1 [2] 3 4 Next   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: DcuHelper.exe v1.10 (7/12/11) - Update checking for your apps (dcupdater compat)  (Read 46398 times)
mouser
First Author
Administrator
*****
Posts: 33,597



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #25 on: September 04, 2007, 07:00:55 PM »

I wanted to describe one thing i will be adding very soon to the dcuhelper.exe utility.

Right now, when your program launches it to check for updates, it finds the dcupdater tool installed on the user's computer and invokes it.

If the main dcupdater tool is not installed, then dcuhelper will tell the user about it, and open the dcupdater web page for them so they can install it if they want.

I'm going to change this slightly so that if the dcupdater tool is not found, it will display a message explaining this to the user and offer them 3 choices:
1. Open the dcupdater web page to learn more about the updater and download it.
2. Open the program's own web page (the program they asked to check for updates for) so they can manually look for an update.
3. Cancel and do nothing.

In this way, even users who do not want to use the updater can be redirected to the program website to check for updates manually.
Logged
mouser
First Author
Administrator
*****
Posts: 33,597



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #26 on: September 08, 2007, 02:30:33 AM »

I've uploaded a new version of dcuhelper.exe:

from readme:
Quote
//---------------------------------------------------------------------------
This tiny helper utility will let your program check for updates by invoking the
 isntalled DcUpdater tool on their computer, or explaining to them how to get it
 and directing them to the DcUpdater web page (and your program's web page)
 if it's not installed.

For help, more examples, sample scripts, see this thread on our forum:
 http://www.donationcoder....um/index.php?topic=9607.0

Main DcUpdater web page:
 http://www.donationcoder....Mouser/Updater/index.html
//---------------------------------------------------------------------------


//---------------------------------------------------------------------------
Version info:
   v1.01.01 - August 16, 2007 - first public release
   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).
//---------------------------------------------------------------------------


//---------------------------------------------------------------------------
1. To register your program's directory with the system updater:
   dcuhelper.exe -r "program_labelname" "full_path_to_app_directory"

2. To invoke the updaterwith various commandline options:
   dcuhelper.exe -[r]i "program_labelname" "full_path_to_app_directory" "missingupdatertitle_or_._for_silent" [commandline options to be passed to updater]
   e.g. if they explicitly ask to check for updates, do so and report results no matter what:
    dcuhelper.exe -ri "ProcessTamer" "C:\Program Files\ProcessTamer" "Error"
   e.g. or if you want to check for updates at startup silently (dont report if no update found):
    dcuhelper.exe -ri "ProcessTamer" "C:\Program Files\ProcessTamer" "."

3. To UNregister your program's directory with the system updater (not really necessary):
   dcuhelper.exe -u "program_labelname"

Note: program_labelname is just a unique arbitrary label that is used to create the redirect files (see below).
//---------------------------------------------------------------------------



//---------------------------------------------------------------------------
How does dcuhelper.exe register your program with the updater?
It creates a file:
   %COMMONAPPDATA%\\DonationCoder\\DcUpdater\\RedirectFiles\program_labelname.dcupdateredirect
Which points to your program's directory.
//---------------------------------------------------------------------------



//---------------------------------------------------------------------------
You can also load the dcuhelper.exe from within your program as if it were
 a dll, and invoke it that way (and check for updater path/existence):

extern "C" __declspec( dllexport ) int DLLMainCall(int argc, char** argv);  // returns 0 on success
extern "C" __declspec( dllexport ) char* DLLGetDcUpdaterPath(char *appdir); // blank on not installed
//---------------------------------------------------------------------------
Logged
lanux128
Global Moderator
*****
Posts: 6,109



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #27 on: September 12, 2007, 10:45:13 PM »

If the main dcupdater tool is not installed, then dcuhelper will tell the user about it, and open the dcupdater web page for them so they can install it if they want.

mouser, what if the dcupdater tool is installed in a custom folder? i get the message box saying it's not installed..
Logged

mouser
First Author
Administrator
*****
Posts: 33,597



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #28 on: September 13, 2007, 04:19:51 AM »

Quote
mouser, what if the dcupdater tool is installed in a custom folder? i get the message box saying it's not installed..
i'll be fixing this soon.
Logged
lanux128
Global Moderator
*****
Posts: 6,109



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #29 on: September 13, 2007, 06:54:20 PM »

thanks mouser.. Thmbsup
Logged

seedling
Charter Member
***
Posts: 129



View Profile Give some DonationCredits to this forum member
« Reply #30 on: February 01, 2008, 03:34:11 PM »

here's some code to drop into your project to call the dcupdater
(this is borland builder code. adjust for your compiler)

[copy or print]
// store application path
AnsiString AppPath = ExtractFilePath(Application->ExeName);

           // fix working path to AppPath
SetCurrentDir(AppPath);

// dcupdate filename without extension
AnsiString AppName = "<yourappname>";

// append path with dcuhelper file
AnsiString dcufullpath = (AppPath + "\\dcuhelper.exe");

// create command line arg string
AnsiString comlineargs = ("-ri " + AppName + " \"" + AppPath + "\" \"warning\" -show");

// run dcupdater tool
ShellExecute(NULL,"open",dcufullpath.c_str(),comlineargs.c_str(),NULL,SW_HIDE);
Logged
mouser
First Author
Administrator
*****
Posts: 33,597



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #31 on: February 01, 2008, 03:35:02 PM »

Thanks for posting that seedling  thumbs up
Logged
Deozaan
Charter Member
***
Posts: 6,420



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #32 on: July 31, 2008, 12:47:02 AM »

I've got some weird behavior with dcuhelper that we talked about in IRC. But I thought I'd post about it here in case you needed more information on what was happening.

I've been getting dcuhelper to work with my Universe project. Following along with the methods mentioned in this thread, I've placed dcuhelper in it's own directory inside the application directory, and I call dcuhelper.exe with a batch file in the Universe directory. Directory structure is like so:

Universe\dcuhelper\dcuhelper.exe
Universe\universe.dcupdate
Universe\update.bat

The batch file contains the following:

[copy or print]
dcuhelper\dcuhelper.exe -ri "Universe" "%CD%" "Attention"

Running this batch file on a PC that doesn't have DcUpdater installed brings up a dialog box that says something to the effect that "DcUpdater isn't installed but is required to check for updates. The Universe website and the DcUpdater website will now be opened in your browser."

Then it opens up the Universe website (as defined in the .dcupdate file) and an error 404 for the DcUpdater. The URL it opens to is http://www.donationcoder.com/Software/Mouser/Updater&app=Universe. I'm not sure why it includes the information about the application, but all it needs to do is change the & to an ? and it works properly, redirecting to http://www.donationcoder.com/Software/Mouser/Updater/?app=Universe

The interesting thing about this is that if I supply the wrong path or no path to the .dcupdate file, it only opens the site to download the DcUpdater, with the following (working) URL: http://www.donationcoder.com/Software/Mouser/Updater. It doesn't open the Universe site because it obviously can't find the site if it doesn't have a .dcupdate file to read.
« Last Edit: July 31, 2008, 03:43:46 AM by Deozaan » Logged

mouser
First Author
Administrator
*****
Posts: 33,597



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #33 on: July 31, 2008, 11:15:32 AM »

i will fix this in next day or two and then try to implement your other ideas through august.
Logged
mouser
First Author
Administrator
*****
Posts: 33,597



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #34 on: August 01, 2008, 07:51:49 PM »

dcuhelper.zip has now been updated, download from here: http://www.donationcoder....m/Software/Mouser/Updater

  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
Logged
Deozaan
Charter Member
***
Posts: 6,420



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #35 on: August 01, 2008, 08:38:01 PM »

Very nice! It's much improved and works like a charm!
Logged

skwire
Global Moderator
*****
Posts: 4,116



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #36 on: February 13, 2009, 02:11:24 PM »

Here's an excerpt of AHK code from my post-compile script that I use to automatically generate the necessary trout.dcupdate and versioninfo.xml files for my Trout audio player.  You will need Skan's FileGetVersionInfo() function.  Obviously, change paths and other specific information to suit your app and environment.

[copy or print]
; Get verion and define paths.
AppName           := "Trout"
Version_String    := FileGetVersionInfo( A_ScriptDir . "\" . AppName . ".exe", "FileVersion" )
Version_Info_Dir  := A_ScriptDir . "\setup"
DcUpdate_Info_Dir := A_ScriptDir . "\setup\trout"

; Generate other needed bits.
myTime := A_Now
FormatTime, Version_Month, %myTime%, M
FormatTime, Version_Day  , %myTime%, d
FormatTime, Version_Year , %myTime%, yyyy

; Generate versioninfo.xml file contents.
Version_Info =
(
<?xml version="1.0"?>
<root>
<Program_Version>%Version_String%</Program_Version>
<Program_Release_Month>%Version_Month%</Program_Release_Month>
<Program_Release_Day>%Version_Day%</Program_Release_Day>
<Program_Release_Year>%Version_Year%</Program_Release_Year>
</root>
)

; Delete and recreate Version_Info file.
FileDelete, %Version_Info_Dir%\versioninfo.xml
FileAppend, %Version_Info%, %Version_Info_Dir%\versioninfo.xml

; Generate .dcupdate file contents.
DcUpdate_Info =
(
<?xml version="1.0" ?>

<Local>

<!-- basic info to display in updater-->
<Label>%AppName%</Label>
<IconFile>%AppName%.exe</IconFile>


<!-- version info of locally installed current version, and simple remote version file -->
<Version>%Version_String%</Version>
<VersionFileRemote>http://skwire.dcmembers.com/apps/trout/versioninfo.xml</VersionFileRemote>


<!-- where to get more info about the app remotely, only queried once an update is discovered -->
<InfoFileRemote></InfoFileRemote>
<WebPage>http://www.donationcoder.com/forum/index.php?topic=16157.0</WebPage>

<!-- ok how to conduct updates; could be: "Run" (download and run program), or "Visit" (visit website), or "Unzip" (download zip and unpack over files) -->
<UpdateMethod>run</UpdateMethod>
<CloseForUpdate>trout.exe</CloseForUpdate>
<UpdateFile>http://skwire.dcmembers.com/apps/trout/trout_setup.exe</UpdateFile>

</Local>
)

; Delete and recreate DcUpdate file.
FileDelete, %DcUpdate_Info_Dir%\%AppName%.dcupdate
FileAppend, %DcUpdate_Info%, %DcUpdate_Info_Dir%\%AppName%.dcupdate
Logged

justice
Supporting Member
**
Posts: 1,889



Solve issues simply.

View Profile WWW Give some DonationCredits to this forum member
« Reply #37 on: February 13, 2009, 04:23:17 PM »

Oh nice one bookmarked.
Logged

mouser
First Author
Administrator
*****
Posts: 33,597



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #38 on: February 26, 2009, 05:23:47 AM »

I had a thought.. without adding much size to dcuhelper.exe i could add a minimialist built in update check into dcuhelper.exe.

In other words, right now what dcuhelper does is if the dcupdater big utility is not installed, it opens the program web page so user can check version themself.

But it wouldnt be hard or add much size to add a really quick and dirty version check into dcuhelper.exe itself, so that it could inform the user when there is a new version and then open the program website, or do nothing if a new version is not ready.

The advantage of this is that it would be more useful to people who don't want to install the larger dcupdater tool and make it viable to use dcuhelper.exe itself as a very lightweight update checker.
Logged
skwire
Global Moderator
*****
Posts: 4,116



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #39 on: February 26, 2009, 05:25:45 AM »

I like this idea.   cheesy
Logged

justice
Supporting Member
**
Posts: 1,889



Solve issues simply.

View Profile WWW Give some DonationCredits to this forum member
« Reply #40 on: February 26, 2009, 05:36:00 AM »

yep me too.
Logged

mouser
First Author
Administrator
*****
Posts: 33,597



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #41 on: December 30, 2009, 01:05:16 AM »

I'm not proud to say it only took me 11 months to add this feature, but i'm happy to say that i have implemented it, and will upload it in the next few days.

The new version of dcuhelper works as follows:

You bundle dcuhelper.exe (still about 100k) with your executable, and invoke it to check for updates.
As before, if the user has the full dcupdater installed, that will be used to check for updates and manage their installation if any are found.

What's changed is the behavior if the user does NOT have the main dcupdater tool installed.

In the past, the dcuhelper.exe would open the program web page and dcupdater page, where they could manually check to see if an update had been released.

Now, dcuhelper.exe will actually check on it's own if an update is available (note this only works with installs that have a single .dcupdate file and won't recursively check plugin updates).

If dcuhelper detects a new version available (or an error), it will behave as before and open the program web page in the browser for user to download and install the new version manually.

If there is no update, dcuhelper will behave like dcupdater and silently exit without bothering the user.

I hope this new feature will offer people the best of both worlds -- very lightweight update checking for people who don't want a full fledged update downloader and prefer to do things manually, and a full featured update tool for people who prefer an automated solution, and for complicated cases like plugins, etc.  The bottom line is that in the past users HAD to install the main dcupdater tool to get any useful benefit -- whereas now dcuhelper.exe on its own will be good enough for most users.  This should make bundling dcuhelper with your application more clearly a good thing to do.

I'll post the new version in a few days and would appreciate any help testing.
« Last Edit: December 30, 2009, 01:08:58 AM by mouser » Logged
mouser
First Author
Administrator
*****
Posts: 33,597



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #42 on: December 30, 2009, 02:54:17 AM »

I've posted a copy of the new version at:
http://www.donationcoder....loads/alpha/dcuhelper.zip

Let me know how it works for you.  Remember it should work the same as before except when run on a machine without the main dcupdater program installed on it.
Logged
mouser
First Author
Administrator
*****
Posts: 33,597



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #43 on: December 30, 2009, 04:01:33 AM »

Just a note that i've tested dcuhelper on windows versions from win98 to win7, all working.
Logged
skwire
Global Moderator
*****
Posts: 4,116



Another Coding Snack request? Om nom nom...

see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #44 on: December 30, 2009, 10:31:51 PM »

I'll try to find some time to test this new release once I get caught up on NANY and holiday and who knows what else.  =]
Logged

jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #45 on: January 10, 2010, 01:21:10 PM »

I like this update a lot!
I'm including it on my new release of GridMove Wink
Logged

mouser
First Author
Administrator
*****
Posts: 33,597



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #46 on: January 28, 2010, 06:48:34 PM »

anyone care to test and report?
Logged
jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #47 on: January 28, 2010, 06:58:29 PM »

I've been using the new version in GridMove since the last release (January 11 or something like that).
I tested it in a virtual machine before and it worked great! Wink
Logged

mouser
First Author
Administrator
*****
Posts: 33,597



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #48 on: January 28, 2010, 06:59:29 PM »

thanks jgp!  Kiss
Logged
Markham
Honorary Member
**
Posts: 404


see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #49 on: February 03, 2010, 11:16:38 PM »

Mouser,

I've read this thread with interest as I've been toying with the idea of including something along these lines in Circle Dock. However, I have some questions:

1. Circle Dock makes use of Mutexes. Assuming only one installation of the program, when CD starts, it checks for its Mutex and, if already allocated, it switches to the original instance and the second instance terminates. If there are multiple installations (in different folders), multiple instances can be run and each "knows" about the others' presence. Is DCU mutex-aware (as Inno Setup is) ?

2. How are "non-versioned" files (eg text or help files) handled?



Mark
Logged
Pages: Prev 1 [2] 3 4 Next   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.052s | Server load: 0.35 ]