2 Replies Latest reply on Oct 25, 2009 12:57 PM by ralvy

    Providing enduser with upgrade script

    ralvy

      Title

      Providing enduser with upgrade script

      Post

      I'm trying to figure out how to provide the user with a script that would do someting like this, given that I have a data separation model:

       

      1. Put a copy of their current Data File (let's call it Data.USR) in a subfolder called Old.

      2. Delete the current Data.USR.

      3. Rename the supplied updated Data File to the proper name. For instance, rename it from Data._ to Data.USR.

      4. Import data from Old/Data.USR to Data.USR.

       

      I can easily do step 1 and 4. Steps 2 and 3 bother me. Data.USR will be open,and stay open, even if I use the Close File command in the script, because the interface file needs. I don't see a way around this. I've tried Troi File plugin, but I get an error $$32, which I would expect because Data.USR always stays open.

        • 1. Re: Providing enduser with upgrade script
          ralvy
            

          I guess I could do something like this:

           

          Create a separate Upgrade solution that moves and renames files, and have it tell the user to start up the real solution after the Upgrade solution exits. There must be a more seamless way, though.

          • 2. Re: Providing enduser with upgrade script
            ralvy
              

            Seems convoluted, but here's what I have working so far:

             

            Let's call the files the following:

             

            UI.fp7

            Data.fp7

             

            I simply added another one:

             

            Updater.fp7

             

            The user loads UI.fp7 and Data.fp7, and tests for the presence of Data._ in its folder. If it's there, Update.fp7 is opened and Updater.fp7 closes UI.fp7 and Data.fp7, otherwise it just runs as normal.

             

            Using Troi File, Updater.fp7 then copies Data.fp7 to a subfolder, and then renames Data._ to Data.fp7.

            Using Troi File, Updater.fp7 then creates an empty file called Update.txt.

            Updater.fp7 then opens UI.fp7 and closes itself.

            When UI.fp7 sees the presence of Update.txt (using Troi File), it runs an import of data from the subfolder file, Data.fp7, and then deletes Update.txt (using Troi File).

             

            The above works, but I keep thinking there's a fundamentally different, and better, way to do this.