locked
Remove Previous Version and Keep Files RRS feed

  • Question

  • All right, here is my problem. I developed an app that our company uses and I now have a major update to the app that includes a new data tier using SQL CE instead of an XML file. I need to be able to import the XML file into the SQL CE database. I have code written for that works for that. When I perform an upgrade, I need to uninstall the previous version, but save the XML file so I can import it into the new database. Currently when I remove the previous version, the XML file also gets deleted.

     

    I have been thinking of different ways to do this, but none of them seem to work. First I thought I can just leave the previous version, but the config file does not get overwritten when the updated version is installed. Next I thought I could force the updated version to overwrite any file, but I can't seem to find a way to do that. Third, I thought I could bootstrap a module that copies the the XML file to a temp path and pick it up from there, but I don't know how to get the location where the old version is installed. Last I thought I could write a bootstrap that uninstalls the previous version through msiexec and tell it to keep the XML file, but I don't konw if that is possible. I've been working and searching for three days now and I'm at my wits end. Any help would be greatly appreciated.

    Monday, January 14, 2008 2:31 PM

Answers

  • You can do this with a bootstrap exe, but not with msiexec commands. Your bootstrap program needs to find the Xml file or wherever the data is and copy it to a well-known location. Then run the upgrade MSI that removes the older version and installs the new one. At this point you can choose to use the bootstrap to update the database with the Xml or have something in the app, shortcut or something, that does the migration. My inclination would be to have the migration to CE in a separate program or in the product itself so that it can be run anytime, and the migration is not tied to doing the install.

     

    Wednesday, January 16, 2008 1:13 AM

All replies

  • So I've been searching all day yesterday and up until now and I have not come up with anyting. I did come across one thing in my searches that said in the list of installed components if the product code is null for a component, it will not be uninstalled. I have searched the registry and do not see a list of installed components for that Product Code GUID. Is there a list in the resgistry of installed components?

     

    Also, I thought if it was listed somewhere in the registry where the product is installed, I can copy the file to the Temp directory and copy it back after uninstall. When I look in the registry for the Product Code, the InstallLocation key is null.

     

    Tuesday, January 15, 2008 2:08 PM
  • You can do this with a bootstrap exe, but not with msiexec commands. Your bootstrap program needs to find the Xml file or wherever the data is and copy it to a well-known location. Then run the upgrade MSI that removes the older version and installs the new one. At this point you can choose to use the bootstrap to update the database with the Xml or have something in the app, shortcut or something, that does the migration. My inclination would be to have the migration to CE in a separate program or in the product itself so that it can be run anytime, and the migration is not tied to doing the install.

     

    Wednesday, January 16, 2008 1:13 AM