1 Reply Latest reply on May 9, 2017 4:48 AM by AnonymousDefaultUser

    Installer process ID

    AnonymousDefaultUser Master

      Hello,


      Our test scripts may run many copies of Bitrock installers at the same time on the same machine, and those installers put files in the ${system_temp_directory}.  We're finding that this causes the installers to step on each other in the temp directory.  To prevent this, I want to use the installer's process ID (or similar) as part of the filename.  I could also use a timestamp, but the pid seems simpler and guaranteed to be unique.  Is there a platform-independent way of accessing the Bitrock installer's process ID?


      Thank you!
      Rose

        • 1. Re: Installer process ID
          AnonymousDefaultUser Master

          InstallBuilder does not provide the PID identifier. However, what you can do is use timestamp and random value to create a unique, temporary directory - such as:

          <createTimeStamp>         <format>%Y%m%d%H%M%S</format>         <variable>unique_timestamp</variable>     </createTimeStamp>     <generateRandomValue>         <length>10</length>         <variable>unique_random</variable>     </generateRandomValue>     <setInstallerVariable>         <name>unique_temp</name>         <value>${system_temp_directory}/${unique_timestamp}_${project.shortname}_${unique_random}</value>     </setInstallerVariable>

          You can then use <createDirectory> to create the directory and then do <deleteFile> in <postUninstallerCreationActionList> and <installationAbortedActionList> to delete the directory when installation finishes or is cancelled.