This article covers all possible commandline options for wyUpdate and what they do. If you're looking how to build your updates and/or wyUpdate by commandline then see the "Building from Commandline" article.
Also, it should be noted that most of the following commandline options can be used within the AutomaticUpdater by using the
wyUpdateCommandline property. For instance:
au.wyUpdateCommandline = "-cdata=\"C:\\Location\\To\\client.wyc\"";
When wyUpdate runs it uses the folder it's currently sitting in as the "base directory". That is, the "Your program's folder" in wyBuild. You can override this directory by using the "-basedir" commandline switch.
For instance, if you want to put wyUpdate.exe and the client.wyc file in a subfolder (not in your "base" program folder) then you'll need to tell wyUpdate where your base folder is:
wyUpdate.exe -basedir="C:\Program Files\YourApp"
wyUpdate uses the "client.wyc" file sitting in the same folder as wyUpdate.exe. Use the "-cdata" commandline switch to specify the exact file you want to use.
When wyUpdate runs it detects the system language of Windows and matches it with any included languages in the client.wyc file. You can choose to force a language by specifying the country code. For example:
Run wyUpdate with the commandline switch alone to begin updating silently from a Windows Service. See the "How to Silently update a Windows Service" article.
wyUpdate.exe /quickcheck /justcheck
When updating from a service you can write out the success or error message to a file. This can only be used with the "/fromservice" commandline switch; otherwise it's ignored:
wyUpdate.exe /fromservice -logfile="C:\Path\To\Log.txt"
wyUpdate.exe /quickcheck /noerr
When used together with "/quickcheck /justcheck", "/quickcheck /noerr", or even "/quickcheck /justcheck /noerr" arguments wyUpdate will output the update information or error to the STDOUT or to a file. For example:
wyUpdate.exe /quickcheck /justcheck /noerr /outputinfo
In this example wyUpdate will output info to STDOUT. If wyUpdate exits with the error code 1 (i.e. an error happened) then the error details will be output on the STDOUT. If wyUpdate exits with the error code 2 (i.e. there are updates available) then the version number will be output on the STDOUT, followed by a "Windows newline" (\r\n), then the full update details will be output.
If you specify a filename, like the example below, then wyUpdate will output to a file instead of STDOUT:
wyUpdate.exe /quickcheck /justcheck /noerr /outputinfo="C:\Location\To\file.txt"
If you're specifying a file you must make sure wyUpdate has permission to write to the file, otherwise nothing will be written.
If you encrypted your update using a password, and you didn't store the password in the client.wyc file, then to install the update you'll need to tell the password to wyUpdate so it can decrypt your update.
wyUpdate.exe -password:"your password"
By default wyUpdate reads the proxy settings from Internet Explorer to download files. To ignore the system proxies and specify a custom proxy use the "-proxy" commandline switch:
You can also use "-proxyu" to specify a username, "-proxyp" to specify a password, and "-proxyd" to specify a domain:
wyUpdate.exe -proxy:"http://proxyserver:80/" -proxyp:"PASSWORD" -proxyu:"USERNAME" -proxyd:"OPTIONAL_DOMAIN"
See the "Proxies in wyUpdate" article.
To silently check for updates all you need to do is run wyUpdate with the "/quickcheck" switch. wyUpdate will start hidden, and only show itself if there are updates available. Otherwise it will silently close itself and return 0. See: How to Silently Check for Updates.
See the "How to Silently Check for Updates" article for usages and example code.
Use the "-server" commandline argument to specify an alternative server site than the one embedded in the client.wyc file.
If you want to silently check for updates then jump right into installing the update, first run wyUpdate in silent mode and check if the return code is "2":
wyUpdate.exe /quickcheck /justcheck /noerr
If the return code is "2" this means there is an update. From there you can prompt the user within your app if they want to update. If they agree, then launch wyUpdate with the "/skipinfo" commandline argument:
This "/skipinfo" argument will tell wyUpdate to skip the "update information" page and instead jump straight into downloading and installing the update.
The executable to start if an error happens during the update. wyUpdate will start this executable then close itself. The executable will be run as the same elevation as the shell process. If it can't run at the same elevation as the shell process, wyUpdate will start the executable at the same elevation as wyUpdate.
wyUpdate.exe -startonerr="C:\Location to your\Executable.exe"
Arguments to start your application with. Using this commandline argument requires using -startonerr with a valid executable.
wyUpdate.exe -startonerr="C:\Location to your\Executable.exe" -startonerra="some args to pass"
Use the "/uninstall" switch to remove any newly added files, folders, registry, etc. since your app was installed. You should call this in your app's uninstaller:
Use the "-updatepath" commandline argument to replace an "%updatepath%" variable in the download site. For example, if you specify your update site like this:
And if you pass in an url to wyUpdate:
wyUpdate will replace the %updatepath% variable with you passed in url to form: http://example.com/updates/%file%
Use the "-urlargs" commandline argument to replace the "%urlargs%": variable in the download site.