How does install4j handle component id duplicates?

Viewed 10

I have a project that I'm updating that creates an update installer for an application. The rules for this installer include "there are certain files you are not allowed to delete" and "a full installer erases critical information so we need a separate update installer". Until we can fix both of these rules we have a process that takes a list of files that are allowed to be deleted during update, adds the filename to a Delete File Action template, and stores it in a text file. When all is said and done, that text file is then used to replace a TEMPLATE_FILE string in the install4j project. I just noticed that the ids we're using for these delete file actions will conflict with existing ids in the project.

So, how does Install4j handle such conflicts? If it doesn't, I'll redo the code to change the ids assigned to the actions as they're built, but what is my limit? Max Integer?

1 Answers

Well, the answer is: yes, if the IDE is any indication, id conflicts will use the last id present in the project file. My uninstaller tree had a link to the Request Privileges in the installer tree at id 513. With duplicate ids present, the uninstaller tree showed that as a link to a delete file action instead. Which makes the uninstaller fail and the installer unpredictable as well.

So, if you are going to manually munge up your project file, pick sensible ids and pay attention to the ids already offered by the IDE.

Related