Problem with reinstallation of software

Got a problem you cannot solve? Try here.
hankypanky99
Posts: 8
Joined: Mon Sep 06, 2010 12:13 am

Problem with reinstallation of software

Post by hankypanky99 »

Hello!

I have an interesting problem and I hope that someone out there has some answers for me.

Consider this:

I have a software (We can call it Software A) that are available in two different version (1.0 and 1.1).

To implement the updates, I use the "Receive Application Updates" and the Updates.ini file.

Both version 1.0 and 1.1 are created as a single executable installer.

The installation scenario is this:

1. I install the 1.0 version.
2. I run the update function for the software
3. The 1.1 version is downloaded and installed correctly.
4. I uninstall the software using the uninstall link
5. I install version 1.0 again.
6. I run the update function - and IA tells me that I have the latest version already.

That is not true!

The only difference between the version is that version 1.1 contains more files and that I has a different software version (1.1).

Has anyone of you experienced anything similar, or have an idea what could cause this problem?

Thanks for all help!

/Henrik
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Problem with reinstallation of software

Post by giaviv »

Dear Henrik,

I have contacted our R&D department and they explained that this happens because a file named installedupdates.dat resides in your setup.exe location (the folder which is pointed by the UninstallString). This file does not get deleted when you uninstall your software and therefore is still there when you install version 1.0 again.
As a work around, delete this file in your uninstallation script in your installer.
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
hankypanky99
Posts: 8
Joined: Mon Sep 06, 2010 12:13 am

Re: Problem with reinstallation of software

Post by hankypanky99 »

Perfect, I will try it tomorrow morning. Does this happen in every installer or is it something that I have done differently?

/Henrik
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Problem with reinstallation of software

Post by giaviv »

It happens on all installers.
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
hankypanky99
Posts: 8
Joined: Mon Sep 06, 2010 12:13 am

Re: Problem with reinstallation of software

Post by hankypanky99 »

Ciao!

The method that is described isn't really working for me.

Consider the following scenario:

1. I install v1.0
2. The installation package is added to a folder under ProgramFiles and another package of installer files are added to a folder under ProgramData.
The name of the folder under ProgramData is named exactly as the RevisionCode, we can call the folder Rev1.0.
3. When I use the Update function, v1.1 is installed (Files under ProgramFiles are replaced) and a new Revision Code folder is added. We can call it Rev1.1.
If I look into the Rev1.0 folder, the installedupdates.dat has a value of 1.1.
4. If I proceed and install v1.2 using the update folder, a new folder Rev1.2 will be added to the ProgramData folder.
If I look into the different folders, it will look like this:

Rev1.0 - installedupdates.dat with the string 1.1
Rev1.1 - installedupdates.dat with the string 1.2
Ref1.2 - no installedupdates.dat file, of course.

In the registry, I can find the Rev1.2 folder using the Product Code, but the other folders are impossible to find. There are no connection to those in
the registry as far as I can see...

So, how can I remove the installedupdates.dat files in the Rev1.0 and Rev1.1 folder?

I also doscovered that the Uninstall part of the script isn't executed "normally" when running the Update function. I added a MessageBox to that
section and it wasn't invoked when running the update function.

I did try one thing that worked and that was to comment out the row in the update script that writes the installedupdates.dat file. Everything seems to work
but I don't know the consecvences. Can you investigate this further on with the R & D team?

/Henrik
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Problem with reinstallation of software

Post by giaviv »

No matter which revision you have installed, there is only one entry to which the UninstallString is pointing to.
Deleting the installedupdates.dat file in that directory will fix your problem.
Can you elaborate on the update problem you partially described?
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
hankypanky99
Posts: 8
Joined: Mon Sep 06, 2010 12:13 am

Re: Problem with reinstallation of software

Post by hankypanky99 »

The code that was removed in the update script was row number 376, I think ;-)
It is the row that handles the creation of the installedupdates.dat file...

The problem is that if I have updated the software from v1.0 to v1.1 to v1.2, the connection to the v1.0 and v1.1 folders are missing. As you mentioned, there is only one entry in the registry that points to a folder. This means, that
if I want to remove the installedupdates.dat file during an uninstallation, it cannot be done when I am uninstalling v1.2. I can never find the v1.0 and v1.1 folders, so that I can remove their installedupdates.dat files. The connection is broken.

There are one possibility, and that is that when you are updating from v1.0 to v1.1, as an example. In the beginning of this update (from 1.0 to 1.1), the link in the registry must point to v1.0. In the end of the script, it will point to v1.1. So perhaps somewhere in the middle of the script, it might be possible to remove the installedupdates.dat.

I think that it would be good to have a good workaround for this problem. I know that this reinstallation thing isn't happening every day but it is still something that can happen and it should not be like this. Not in my world anyway ;-)

So the real question is; what will be the problem if the installedupdates.dat file isn't created at all...?

Have a nice weekend!

/Henrik
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Problem with reinstallation of software

Post by giaviv »

Hernik,

Does uninstallation that you are talking about refer to removing a version when a newer one is installed?
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Problem with reinstallation of software

Post by giaviv »

Hernik,

Does uninstallation that you are talking about refer to removing a version when a newer one is installed?
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
gsaunders
Posts: 81
Joined: Mon Aug 16, 2010 2:37 pm

Re: Problem with reinstallation of software

Post by gsaunders »

giaviv wrote:Hernik,

Does uninstallation that you are talking about refer to removing a version when a newer one is installed?
giaviv... I'll pick up where the original poster left of as I am experiencing the EXACT same thing. Here is the scenario:

1) Install v1.0 and this creates folder under Program Data. For example: c:\ProgramData\{4F5037D3-89EE-44D7-B74B-0D5615E0032B}
2) An update takes place v1.5 (automated or manual) and this updates the existing one. It puts the installupdates.dat into the above folder and then a new folder is created. For example: c:\ProgramData\{47416750-FE05-B376-6F45BD48BC80}. This second folder does not have the installupdates.dat (unless there is a second update put out and in that case the progression continues).
3) Now let's say we uninstall the application. It will remove the second folder c:\ProgramData\{47416750-FE05-B376-6F45BD48BC80}, BUT leaves the first original folder with the installedupdates.dat that was populated from the update previously done.
4) Now the user re-installs the original application... since the original folder c:\ProgramData\{4F5037D3-89EE-44D7-B74B-0D5615E0032B} all the installation did was add a few more files. BUT again the installedupdates.dat is still there from the very first install on step 1. So now if I try to update it no longer sees the update to 1.5 since the original installedupdates.ini still exists. I can manually delete the file and the update will run.

So if I had a progression of 3 versions (1.0, 1.5, 1.7) I would see the following:
Folder for 1.0 - installedupdates.dat with the string 1.5
Folder for 1.5 - installedupdates.dat with the string 1.7
Folder for 1.7 - no installedupdates.dat file, of course.

And if I uninstall the application... folders 1.0 and folders 1.5 would still exist with the installedupdates.dat files in-tact.

So how do we deal with the scenario described above?

Greg
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Problem with reinstallation of software

Post by giaviv »

Hi Greg,

We are aware of this issue. To avoid it, add a Delete File command on your uninstall script that deletes the installedupdates.dat file.
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
gsaunders
Posts: 81
Joined: Mon Aug 16, 2010 2:37 pm

Re: Problem with reinstallation of software

Post by gsaunders »

giaviv wrote:Hi Greg,

We are aware of this issue. To avoid it, add a Delete File command on your uninstall script that deletes the installedupdates.dat file.
The problem is knowing where that file is located. It is always located in the previous version (the latest version doesn't have it until an update takes place)

So how do I know where to locate it to delete it?

Maybe a better question for me would be... what exactly does an update do? Does it fully uninstall the old version first and then install new version? if so then I can definitely do the delete file, because it will know the path to the file as a part of the uninstall... but if it doesn't really do an uninstall... then how will I know the location of the installedupdates.dat file?

Greg
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Problem with reinstallation of software

Post by giaviv »

Greg,

Exactly - updates simple remove the previous version and install the new one.
Therefore, when the previous version is uninstalled, you are actually invoking the old version's installer, through which you can get the correct path for the installedupdates.dat file.
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
gsaunders
Posts: 81
Joined: Mon Aug 16, 2010 2:37 pm

Re: Problem with reinstallation of software

Post by gsaunders »

giaviv wrote:Greg,

Exactly - updates simple remove the previous version and install the new one.
Therefore, when the previous version is uninstalled, you are actually invoking the old version's installer, through which you can get the correct path for the installedupdates.dat file.
In my Perform Uninstallation region I have commands that run with NATIVE_ENGINE to TRUE and prompts the user if they want to delete the data files. When I run a manual uninstall this prompt DOES take place allowing the user to delete or retain the data. HOWEVER... if I run an UPDATE this does NOT happen. And honestly I would NOT want this to happen during an update, but what is preventing it from happening? I ask because if this is not happening during the uninstall part of an update then adding the deletion of installedupdates.dat wouldn't happen either.

All of the above is wrapped inside the if Variable REMOVE Equals TRUE. Here is the code and you see I have the MessageBox, but this never fires during when doing a full update:

Code: Select all

if Variable REMOVE Equals TRUE
  Comment: Uninstall product
  Comment: TO-DO: Insert any additional uninstall commands here
   
  Apply Uninstall (get result into variable SUCCESS)
   
  Set Variable NATIVE_ENGINE to TRUE
  Set Variable DELETEDATA to 
  Apply Uninstall (get result into variable SUCCESS)
  MessageBox: Data Preservation, Do you wish to DELETE the DATA tied to BAMPA as a part of this UNINSTALL?
  if Variable DELETEDATA Equals YES
    Set Variable DOES-BAMPAAPPDATA-EXIST to FALSE
    Does Folder Exist $BAMPAAPPDATA$ (get result into variable DOES-BAMPAAPPDATA-EXIST)
    if Variable DOES-BAMPAAPPDATA-EXIST Equals TRUE
      Comment: MessageBox: Info, Start Delete of $BAMPAAPPDATA$
      Recursively Delete Files $BAMPAAPPDATA$\*.*
      Call DLL Function kernel32.dll->RemoveDirectoryA
    end
    Set Variable DOES-BAMPAAPPDATAOLD-EXIST to FALSE
    Does Folder Exist $BAMPAAPPDATA$.OLD (get result into variable DOES-BAMPAAPPDATAOLD-EXIST)
    if Variable DOES-BAMPAAPPDATAOLD-EXIST Equals TRUE
      Comment: MessageBox: Info, Start Delete of $BAMPAAPPDATA$.OLD
      Recursively Delete Files $BAMPAAPPDATA$.OLD\*.*
      Call DLL Function kernel32.dll->RemoveDirectoryA
    end
    Set Variable DOES-BAMPAAPPDATAVIRTUAL-EXIST to FALSE
    Does Folder Exist $BAMPAAPPDATA$.VIRTUAL (get result into variable DOES-BAMPAAPPDATAVIRTUAL-EXIST)
    if Variable DOES-BAMPAAPPDATAVIRTUAL-EXIST Equals TRUE
      Comment: MessageBox: Info, Start Delete of $BAMPAAPPDATA$.VIRTUAL
      Recursively Delete Files $BAMPAAPPDATA$.VIRTUAL\*.*
      Call DLL Function kernel32.dll->RemoveDirectoryA
    end
  end
  Set Variable NATIVE_ENGINE to FALSE
   
  Set Variable PROGRESS to 100
  else
giaviv
Posts: 2039
Joined: Fri Dec 17, 2010 1:39 pm

Re: Problem with reinstallation of software

Post by giaviv »

Hi,

The old version removal is done by simply running (Un)Install MSI Setup - you can see that call in your script:

Code: Select all

  if Variable NEEDSUPGRADE Equals TRUE
    Set Variable REMOVEOLD to 
    Set Variable ERROROLD to 
    Install/Remove MSI Package $PRODUCTCODE$[REMOVE=ALL] (get result into variable REMOVEOLD)
    if Variable REMOVEOLD Equals ERROR
      MessageBox: $TITLE$ Setup, Unable to uninstall old version of $TITLE$. Please uninstall it yourself using Control Panel Add-Remove Programs before attempting to install this product.$NEWLINE$$NEWLINE$$ERROROLD$
      Terminate Installation
    end
    if Variable REMOVEOLD Equals REBOOT
      MessageBox: $TITLE$ Setup, Your computer needs to be restarted before $TITLE$ Setup can continue.$NEWLINE$$NEWLINE$Please save your work in all running programs and click OK to restart your computer. Setup will resume once your computer restarts.$NEWLINE$$NEWLINE$If you click CANCEL, setup will exit. You will have to run setup again at a later time to install $TITLE$.
      if Variable REBOOTNOW Equals OK
        Reboot Computer and Resume Setup
        else
        Terminate Installation
      end
    end
     
When Uninstall is selected in the command dialog (which it is by default in the remove old version section), REMOVE=ALL is passed to the uninstaller.
The uninstallation is definitely called, its just that you don't see the message box because the uninstall runs silently (no windows / dialogs).
Aviv Giladi
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Post Reply