Jump to content

Automatic Upgrade/Downgrade from Installer


Recommended Posts

I have dutifully been creating new Executable Versions each time I make any changes to my application and then creating New Installers with this new executable.

 

For the Installer I did not click on the "Generate" button to change the Upgrade Code in the Version Information category - the Installer does this automatically.  ie. each new Installer had a new Upgrade Code.

 

Now each time I have run the NEW Installer version it automatically uninstalls the old version and installs the new version - all very nice and simple :)

 

But today I needed to go BACK a version so I ran the previous installer expecting it to automatically do the same thing, but it won't let me.

 

My questions are:

1) Firstly can this be done, or can you only upgrade to newer versions?

2) What is the "Generate" button for if the NI Installer generates a new Upgrade Code anyway?

3) How can I get the NI Installer to upgrade and downgrade and application?

 

Chris

 

Link to comment

I have dutifully been creating new Executable Versions each time I make any changes to my application and then creating New Installers with this new executable.

 

For the Installer I did not click on the "Generate" button to change the Upgrade Code in the Version Information category - the Installer does this automatically.  ie. each new Installer had a new Upgrade Code.

 

Now each time I have run the NEW Installer version it automatically uninstalls the old version and installs the new version - all very nice and simple :)

 

But today I needed to go BACK a version so I ran the previous installer expecting it to automatically do the same thing, but it won't let me.

 

My questions are:

1) Firstly can this be done, or can you only upgrade to newer versions?

2) What is the "Generate" button for if the NI Installer generates a new Upgrade Code anyway?

3) How can I get the NI Installer to upgrade and downgrade and application?

 

Chris

 

The Generate button generates a new Product ID. A product ID identifies a product and as long as the installer uses the same product ID it will update previous version with the same product ID. However the installer will NOT overwrite a product with the same product ID but a newer version.

 

If you really want to install an older version on your machine over a new version, the easiest solution would be to completely deinstall your product and start your previous installer to install your application from scratch. Trying to trick the installer into installing your older version over a newer version is a pretty complicated and troublesome operation that will go more often wrong than right.

Link to comment

OK got it - manually uninstall the current version if you want to install a previous version - fair enough.

 

I'm still a little unclear on the actions of the Upgrade Code though.

 

Basically I create a new Executable and Installer each time I make changes to my application as seen below.

 

post-317-0-86757600-1430360295.png

 

Each time I duplicate an Installer it automatically creates a new Upgrade Code and of course when I run the installer it automatically overwrites the previous installation.

 

But are you saying if I didn't change the Upgrade Code (ie. it remains the same) and ran the Installer it will return an error?

 

So each new Installer should really have a new Upgrade Code if you want it to automatically install over a previous version?

Link to comment

OK got it - manually uninstall the current version if you want to install a previous version - fair enough.

 

I'm still a little unclear on the actions of the Upgrade Code though.

 

Basically I create a new Executable and Installer each time I make changes to my application as seen below.

 

attachicon.gifBuild Specifications.png

 

Each time I duplicate an Installer it automatically creates a new Upgrade Code and of course when I run the installer it automatically overwrites the previous installation.

 

But are you saying if I didn't change the Upgrade Code (ie. it remains the same) and ran the Installer it will return an error?

 

So each new Installer should really have a new Upgrade Code if you want it to automatically install over a previous version?

 

It's not an upgrade code but a Product ID. Technically it is a GUID (globally unique identifier). It is virtually guaranteed to be different each time a new one is generated. This Product ID is stored inside the Build Spec for your executable. If you create a new Build Spec this product ID is each time newly generated. If you clone a Build Spec, the Product ID is cloned too.

 

The Installer stores the Product ID in the registry and when installing a new product it will search for that Product ID and if it finds it it will consider the current install to be the same product. It then checks the version and if the new version is newer than the already installed version, it will proceed to install over the existing application. Otherwise it silently skips the installation of that product.

 

Now, please forgive me but your approach of cloning Build Specs to make a new version is most likely useless. As you create a new version of your application you usually do that because you changed some functionality of your code. But even though your old build spec is retained, it still points to the VIs on disk as they are now, most likely having been overwritten by your last changes. So even if you go back and launch an older build spec, you most likely will build the new code (or maybe a mix of new and old code, which has even more interesting effects to debug)  :cool: with the only change being that it claims to be an older version.

 

The best way to maintain a history of older versions is to use proper source code control. That way you always use the same build spec for each version (with modifications as needed for your new version), but if you need to, you can always go back to an earlier version of your app.

 

A poor mans solution is to copy the ENTIRE source tree including project file and what else for each new version. I did that before using proper source code control, also zipping the entire source tree up but while it is a solution, it is pretty wasteful and cumbersom. Here again, you don't create a new Build Spec for each version but rather keep the original Build Spec in your project.

  • Like 2
Link to comment

What rolfk says is very true.  There is little practical reason to have multiple applications, or installers in a project, for the same build if all you are doing is changing the version.  Have one EXE and one installer.  Some times I see another EXE for debug, which is the same as the normal but has debug enabled which includes block diagrams.  And some times I see another installer which includes all run-time additional installers to have it work on a fresh clean machine.

 

But with these exceptions there is no reason to have multiple versions.  Are you trying to have it so that a new version, goes into a new folder?  This could be changed but I thought I remember hearing about a feature in the application builder that allowed for this, I never used it so I'll need to search for it.

 

So with your one EXE and one installer, just up the revision of each, and then build the EXE, then build the installer.

 

It's not an upgrade code but a Product ID. 

LabVIEW calls it an Upgrade code, which is where the term comes from.

 

EDIT: Found it, on this page under Destination Path

 

http://zone.ni.com/reference/en-XX/help/371361K-01/lvdialog/destination_settings_db/

 

There it states you can use [VersionNumber] in the Destination Directory path in the build.  So you can have C:\My Application [VersionNumber].  Then all you need to do is up the revision of the software, and build it and a new folder will be made and the old ones you may have on disk won't be overwritten.

 

Double Edit:  Looks like it was a new feature of 2013 http://zone.ni.com/reference/en-XX/help/371361K-01/lvupgrade/labview_features/

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.