Extend the installer page?

Comments

1 comment

  • Avatar
    juanjo

    It is not possible to add more information to the uninstaller after the installation page finishes (the uninstaller is created at the end of the installation process). Would be possible to move the page before the installation page and execute the actions in the <postInstallationActionList>?

    If that is not an option, you can place custom pages right after installing the files and before displaying the installation finished page using the below:

    <booleanParameter>
      <name>createshortcuts</name>
      <title>Create shortcuts</title>
      <description>Create desktop shortcuts</description>
      <insertAfter>installation</insertAfter>
      <postShowPageActionList>
        <createShortcuts>
          <destination>${windows_folder_desktop}</destination>
          <shortcutList>
            <shortcut>
              <comment>Launches ${project.fullName}</comment>
              <name>Launch ${project.fullName}</name>
              <runAsAdmin>0</runAsAdmin>
              <windowsExec>${installdir}/myApp.exe</windowsExec>
            </shortcut>
          </shortcutList>
          <ruleList>
              <isTrue value="${createshortcuts}"/>
          </ruleList>
        </createShortcuts>
      </postShowPageActionList>
    </booleanParameter>
    

    And then manually revert the actions in the <preuninstallationactionlist>:

    <preUninstallationActionList> 
       <deleteFile path="${windows_folder_desktop}/Launch ${project.fullName}.lnk"/>
    </preUninstallationActionList>
    

    If you do not want to try to revert actions that may not be performed by the installed (like deletig the shortcuts regardless of if they were created by the installation), you could write a file in the installation directory that will be read at uninstallation time:

    <postShowPageActionList>
       <actionGroup>
          <actionList>
             <createShortcuts>
                ...
             </createShortcuts>
             <iniFileSet>
               <file>${installdir}/postinstall_steps.ini</file>
               <key>created_shortcuts</key>
               <section>General</section>
               <value>1</value>
             </iniFileSet>
          </actionList>
          <ruleList>
             <isTrue value="${createshortcuts}"/>
          </ruleList>
       </actionGroup>
    </postShowPageActionList>
    ...
    <preUninstallationActionList> 
      <iniFileGet>
         <file>${installdir}/postinstall_steps.ini</file>
         <key>created_shortcuts</key>
         <section>General</section>
         <variable>created_shortcuts</variable>
      </iniFileGet>
      <deleteFile path="${windows_folder_desktop}/Launch ${project.fullName}.lnk">
          <ruleList>
             <isTrue value="${created_shortcuts}"/>
          </ruleList>
      </deleteFile>
    </preUninstallationActionList>
    

Please sign in to leave a comment.