Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

How to display build number automatically


5 replies to this topic

garyflet

garyflet
  • Full Members
  • 36 posts

Posted 21 December 2012 - 19:56

I need to display the build number when the user installs our files. Preferably, this would be displayed on the InstallWelcome dialog. But I don't know how to edit a dialog "on the fly". I want to do it on the fly because we have a automatic nightly build that compiles and links our programs and then runs InstallShield to make a new setup.exe every night. If I didn't do it on the fly, I would have to check every evening to see if anyone made any changes to the software, and if so, then edit the InstallWelcome dialog to match the new build number. It would be so much better to have it automatically done.

I did it with my old Wise install by having the nightly build create/edit a file with the build number in it. Then the Wise install would read the number and place it in the dialog. I don't know how to do that with a Basic MSI.

If there was some way that InstallShield could read the File Version of my executable to be installed, that would be another way to get the build number.

Any help greatly appreciated.
Gary

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 26 December 2012 - 12:10

You can use properties in dialog texts, for example:
This setup will install [ProductName] version [ProductVersion].

Does that help?

garyflet

garyflet
  • Full Members
  • 36 posts

Posted 03 January 2013 - 00:46

Your solution is not what I'm looking for because I'd have to know what the Product Number (which would include the build number) was before the build was built. What happens each night is our automatic builder determines if anyone has updated source code. If they have, then it's a new build number and the automatic builder edits the source code that causes the build number to be displayed when the program is run in the "About OurProgram" dialog box. Then it builds the software and then executes InstallShield to create a setup. The question is, how can the automatic builder get the build number to InstallShield so that it is also displayed in the Welcome Install dialog? It would have to be done before executing InstallShield.

With the Wise install, I had the automatic builder write the build number to a file to be installed (of course the file was deleted before the installation was finished.) During the install, my setup.exe would read the file and display the number in the Welcome dialog.

My boss wants to know why can't I display the build number with installs created by InstallShield. I could, of course, just by checking at the end of every day whether anyone has edited and checked in any files. If they have, then I bump the build number display in the Welcome dialog and all is well. But what if I'm out, or I miss somebody's edit, or they edit after I left, or I forget? Then the build number displayed in the install isn't correct. Better to do it automatically if possible. Any ideas appreciated.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 03 January 2013 - 17:01

In general, I'd recommend updating the ProductVersion property of your msi anyway, so ypu could sue that on the Welcome dialog as mentioned before. If you are using InstallShield's command line build tool you can update the ProductVersion using the -y parameter:
ISCmdBld.exe -y "1.2.3"
You can also set any other property on the command line using the -z parameter.

If you prefer your existing method with the file, please explain how you did it with Wise. I guess you used a custom action to read the file content?

Note that setting the ProductVersion property during build instead of reading the information from a file at setup runtime has the advantage that your version number is also correctly displayed in the Add/Remove Programs (or Programs and Features) control panel.

garyflet

garyflet
  • Full Members
  • 36 posts

Posted 03 January 2013 - 20:00

Now I understand your reply! It works, thanks very much. biggrin.gif

One curiousity: Our version number is 2.701. But the "701" cannot be edited in the IDE because the first two numbers must be less than 256. On the other hand, using your command-line method of determining the value of the Product Number greater than 255 is accepted. I wonder why the IDE has the 255 limit?

Gary

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 04 January 2013 - 15:19

According to http://msdn.microsof...9(v=vs.85).aspx the first two fields of the ProductVersion have a maximum of 255 (1 byte) while the third field has a maximum of 65535 (2 bytes).
So 2.701.0 is not allowed. Apparently the command line builder doesn't catch this error, but a validation would probably flag it.
You may want to change the ProductVersion property to something line 2.70.01 or 2.0.701. For display purposes on your installer dialogs you can use a custom property (e.g. ProductVersionForDisplay or StringProductVersion or something like that) that doesn't have these restrictions.