Can I access installer variables after the installation is finished?

Answered

Comments

1 comment

  • Avatar
    wojciechka

    The format of uninstall.dat file is internal and it is not possible to read and/or modify the values of the InstallBuilder variables from it. However, you can store the files as INI or XML files. For example:

    <postInstallationActionList>
      <iniFileSet>
        <file>${installdir}/variables.ini</file>
        <key>installdir</key>
        <section>Variable</section>
        <value>${installdir}</value>
      </iniFileSet>
      <iniFileSet>
        <file>${installdir}/variables.ini</file>
        <key>datadir</key>
        <section>Variable</section>
        <value>${datadir}</value>
      </iniFileSet>
      <addFilesToUninstaller>
        <files>${installdir}/variables.ini</files>
      </addFilesToUninstaller>
    </postInstallationActionList>
    

    This way you can store the values you want to access from your application.

    You may also read some of the variables by doing:

    <preUninstallationActionList>
      <iniFileGet>
        <file>${installdir}/variables.ini</file>
        <key>datadir</key>
        <section>Variable</section>
        <variable>datadir</variable>
      </iniFileGet>
    </preUninstallationActionList>
    

    This way the application can read and write the variables and installer will read the values before uninstallation and running actions related to uninstallation.

Please sign in to leave a comment.