Archive: auto updater


auto updater
i am REALLY new to NSIS just started using it a few days ago, got a nice installer made, just the basics but it's all i need

im wondering if there is a way to make an auto updater that will check a server for a new version or if there is a way to make it download a list of sections from a server every time the installer runs it gets a new list of options to choose from (if the list was updated)

i'd be happy enough if there were something like the uninstall generator that made an update checker where you give it a url and it checks if the file is updated by viewing a text file or something then has the user download it

i've seen SOMETHING about downloading used in the viralsound.com plugin and i dont know if that has anything to do with what im doing but it'd be cool anyways


It's not possible to dynamically add Sections, but you can have a look at Software Updata:
http://swupdata.sourceforge.net

Software Updata is written in NSIS and you can download the source there (although it might be hard to get you head around).

Basically, it uses the InetLoad NSIS download plugin by Takhir to do just about everything.

-Stu


cool thnx i'll have a look


alright i have no idea how to use it, but i installed both the exe and the nsis plugin stuff


If you plan on using SwUpdata, you need to read the documentation that comes with it. Otherwise just download the InetLoad plugin (search this forum).

-Stu


Hi, I am playing around with this. Now I have everything set up but the problem i am having is that the updater does not install the files in the correct sub-directories, it just puts everything in the root directory.

So if my update file has an entry like below, the file blank.dll is installed in the root install dir and not in root/mydir/blank.dll Any ideas?:

#1
me
27/09/2005 @ 16:23:46

mydir\blank.dll:2be7ad3aa547b48f562529e5092a40e4
http://myserver/mydir/blank.dll
blank.dll
2be7ad3aa547b48f562529e5092a40e4


Thanks, this has been fixed in SwUpdata 1.0.0.2
http://swupdata.sf.net

-Stu


Thanks it works.

I added /NOUNLOAD to the section below in main.nsh. Each file download would hang for 20-30secs without it on my pc but ymmv.

---------------------------------
## Download the bugger!
Delete "${Downloads}\$DownloadName"
Push /END
Push "${Downloads}\$DownloadName"
Push "$ServerURLForward$DownloadURL"
Push " (%d %s%s left)"
Push "%dkB (%d%%) of %dkB; @ %d.%01dkB/s"
Push "s"
Push "hour"
Push "min"
Push "sec"
Push "Connecting..."
Push "Downloading %s"
Push /TRANSLATE
CallInstDLL "${DLL-InetLoad}" /NOUNLOAD load


Hmm that's interesting thanks I will add that for next release.

-Stu


BTW InetLoad can take few files from server in a single session, this might work in Updater


Push /END
Push "${Downloads}\$DownloadName1"
Push "$ServerURLForward$DownloadURL1"
Push "${Downloads}\$DownloadName2"
Push "$ServerURLForward$DownloadURL2"
...

WinInet detach caused up to 60 sec delay on plug-in unload, but I was sure that I solved this problem in July' version.

I was installing trial-ware that uses InstallShield, and was interested to see that its auto-update checker was based on InstallShield (see attachment).

I was getting ready to put in a feature request that nsis implement this capability, but fortunately did a "Search" (BTW: perhaps the Search field could be at the top of the page to make it more likely to be used).

I hadn't realized that nsis is capable of accomplishing this. I'm a participant on several open-source projects, and have had it on the respective to-do lists of several of them to implement AutoUpdateCheck, but wasn't clear how to go about that. Also, this valuable capability seems to be more or less invisible in the documentation.

Maybe I'm the only one, but I had never heard of nsis' AutoUpdateCheck capabiliy (or perhaps I need to get my alertness pill medication upped in dosage :igor: ). To me, this is a VERY valuable feature ... almost up there with generating an uninstaller.

Seems like the NsisInstaller itself could/should have this capability (nsis-#.##.exe from sourceforge) ... that would give the feature much greater visibility. Also, perhaps the cleaned-up bigtest.nsi example could show how to do this (or another example)?

My impression is that the AutoUpdateCheck capability isn't particularly integrated into nsis ... fwiw, my vote would be to have it directly available, as a selectable default (unless it adds greatly to the size of the installer??).

(I suppose I would even be willing to offer to help out if this capability is a work-in-progress)


It might not be difficult for the setup to check an update site for a newer version of the setup, download it, run it and then exit. If no newer version is found, the setup continues as normal.


I can tell you how I do it in my plugins.

I update the compile NSIS script with the newest engine version, then the installer does the following:

It tries to find and load the VS Engine, if that fails it downloads it from the web server.
If it did load, it gets the version number from the engine DLL with a custom NSIS plugin/extension I made that reads the version # and compares it with the latest version. If the one on your system is older then the newest it updates it.