3 Replies Latest reply on Aug 7, 2018 12:46 AM by derniwi

    eScript package, how do I define what actions are taken during "repair\re-install"

    JHammo Apprentice

      I'm building several eScript packages, what can I put in the script to tell DSM what sections to run during a reinstall or repair?

       

      thanks

      Jason

        • 1. Re: eScript package, how do I define what actions are taken during "repair\re-install"
          derniwi Master

          Hi Jason,

           

          you may use the If clause to check the installation mode:

          If CheckInstallMode(imReinstall)

          or

          If CheckInstallMode(imAppRepair)

           

          You also have to enable the support for reinstallation or repairing the package.

           

          Regards

          Nils

          • 2. Re: eScript package, how do I define what actions are taken during "repair\re-install"
            SitzRieSe Expert

            I never used that, but wasnt there a variable like $BeginUninstallScript? I thought there must be a $BeginReinstallScript and $BeginRepairScript?!

            • 3. Re: eScript package, how do I define what actions are taken during "repair\re-install"
              derniwi Master

              Hi Alexander,

               

               

              no, there is only a $BeginUninstallScript...

               

               

              And, however, uninstalling means that some commands are just reversed, but this is not possible for all commands. And all executed commands are tried to be reversed. So if you copy files dureing the installation using "CopyFile" they will be removed during the uninstall process and you can't stop this.

               

               

              Repairing and reinstalling is a kind of common installation with some minor different behavior. AFAIK repair does not reinstall the user part, just the workstation part. MSI files can handle both reinstall and repair so the MsiInstallProduct command will be changed (internally) to MsiReinstallProduct during re-installation. And it will internally use the repair function for repairing the eScript package.

               

               

              Also the registry keys which are set using the RegLoad command will usually not be re-set during repair, only while re-installing. But there is a option for each value that this one will also be re-set during repair.

               

               

              So it is not as easy as it might be... ;-) and sometimes you have to play around with all the functions while creating a package. I.e. I have an update for a software which are just some files to be copied in the program folder. Using CopyFile (or InstallFile) causes the files will be deleted (DeleteFile is the reverse command for CopyFile) and in the $BeginUninstallScript part the setup.exe failed because some files are missing... The trick is to not use the InstallFile command, I have to use a script and the xcopy.exe command because there is no reverse command for ExecuteEx / RunAsEx...

               

               

              Regards

              Nils