Reputation: 3830
I have an app I want to provide updates for using the Advanced Installer Updater.
After I build the update file, I have a batch file to upload the update file automatically to my server. I also want to upload the app itself, and copy it to a version directory for archival purposes.
For instance, if I release version 2.0.78, I have a script connect to my server, create a '2.0.78' directory, and copy the app into it. This is a post-build event.
I don't want to have to keep specifying the version number for my script every time it changes, so I want to pass the version number as an argument to my command-line script.
I have tried the following (and upper/lower case versions of it), but the output is blank.
How do I get the product name and version in an update project?
Upvotes: 1
Views: 749
Reputation: 11013
Those properties are not set into an updates configuration project, they are set only in the project that generates your setup package. An updates configuration project is not designed to store/manage installer properties.
The only way to read and use those properties is to create a BAT file that first gets their values from the setup project, then builds the updater project and afterwards executes your post-build operations (no longer using a post-build event), all from the same BAT file.
Upvotes: 1
Reputation: 11367
One idea would be to get this information within the batch script from the .exe file.
for /f "usebackq delims=" %%A in (`"powershell $shell = New-Object -COMObject Shell.Application; $shellfolder = $shell.Namespace('C:\Folder\Subfolder'); $shellfolder.GetDetailsOf($shellfolder.ParseName('Program.exe'), 156);"`) do set "AppVer=%%A"
This will capture the Version number of the appliction into the AppVer variable. To get other details just change the GetDetailsOf number. 176 = Product Name, 156 = Product Version, etc...
Upvotes: 1