Files are saved using a full path in the rollback directory, which makes the installation non-relocatable on Linux. Is it possible to specify a rollback rule saving relative-to-installation-directory path?

asked 27 Nov '11, 04:39

GigaG's gravatar image

GigaG
419911
accept rate: 0%


It was implemented using the full path to allow backing up any file in the system. If a relative path to the installdir is used, just files overwritten inside the installation directory will be easily reproduced in the backup but it would be hard to determine the destination of a file in the home directory.

In any case, I see your point. We will add your suggestion to our bug tracking system.

As a workaround, what you could do is move the contents of the backup to another directory, relative to the installation directory:

<postInstallationActionList>
    <actionGroup>
        <actionList>
            <createDirectory>
                <path>${installdir}/backup</path>
            </createDirectory>
            <renameFile>
                <destination>${installdir}/backup</destination>
                <origin>${project.rollbackBackupDirectory}/${installdir}</origin>
            </renameFile>
            <deleteFile>
                <path>${project.rollbackBackupDirectory}</path>
            </deleteFile>
        </actionList>
        <ruleList>
            <isTrue>
                <value>${project.enableRollback}</value>
            </isTrue>
            <fileExists>
                <path>${project.rollbackBackupDirectory}/${installdir}</path>
            </fileExists>
        </ruleList>
    </actionGroup>
</postInstallationActionList>
link

answered 28 Nov '11, 11:52

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

So, in pre-uninstall stage I will have to detect the current installation root directory and restore the rollback contents where the installation expects them?

(29 Nov '11, 00:56) GigaG

If you want to restore the backup after uninstalling, you could use the <postUninstallationActionList>. You can get the current installation directory (in case you want to take into account manually moving the application) using the built-in variable ${installer_directory}.

(29 Nov '11, 16:16) juanjo ♦♦

I guess this can be implemented, but I hope you'll add an option to store relative-to-installation paths for files inside the install tree. This is especially useful on Linux for auto-mounted paths. I'm currently investigating other issues related to this and I'll post more messages later.

(30 Nov '11, 01:08) GigaG

It is not currently possible to configure the prefix. The rollback directory uses the full path to the files to allow restoring modified files at any location in the system. If you are just interested in backing up the contents of the installation directory (or a subdirectory), you could manually create the backup using:

<readyToInstallActionList>
    <createTimeStamp>
        <format>%Y%m%d%H%M%S</format>
        <variable>timestamp</variable>
    </createTimeStamp>
    <createBackupFile>
        <destination>${installdir}/backups/${timestamp}</destination>
        <path>${installdir}/importantFiles</path>
    </createBackupFile>
</readyToInstallActionList>
link

answered 28 Nov '11, 09:42

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

I would be interested in the automatic rollback facilities provided by InstallBuilder. I wonder why this was implemented using a full path?

It it going to create problems when installing to auto-mounted paths. The paths are expanded and there's an ugly /.automount/server/volume/path type of prefix in the rollback directory.

(28 Nov '11, 11:22) GigaG
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×28
×13

Asked: 27 Nov '11, 04:39

Seen: 2,837 times

Last updated: 03 Jun '13, 15:32