Hello,

in my installation script I am using symbolic links on OSX (Mac) platform. I use <createsymlink> feature of the BitRock script to do that.

Excerpt:

 <postInstallationActionList>
         <createSymLink>
             <linkName>/usr/local/lib/libmchpusb-1.0.dylib</linkName>
             <target>${installdir}/my_app/Contents/Resources/some_ide/mplablibs/modules/lib/libusb-1.0.0.dylib</target>
             <ruleList>
                 <platformTest>
                     <type>osx</type>
                 </platformTest>
             </ruleList>
         </createSymLink>
   <...>

Everything works well, if I have only one (1) instance of my application installed on a customer's platform. However, if a customer installs a second instance of the same application (in a different location, but on the same computer as the first instance), and then uninstalls the first one, the sym link disappears, and the execution of the second install breaks, by not finding necessary files.

My link name is /usr/local/lib/libmchpusb-1.0.so , and its target depends on the {install-dir}, as follows: ${installdir}/my_app/Contents/Resources/some_ide/mplablibs/modules/lib/libusb-1.0.0.dylib

To clarify the scenario:

1) Install version X.1 in location A (sym link is created, with target at location A) 2) Install version X.2 in location B (same sym link, now with another target at location B) 3) Uninstall version X.1 which causes the symbolic link, libmchpusb-1.0.so in /usr/local/lib to disappear 4) The version X.2, which is still installed, now no longer works because the common symbolic link is gone.

How to possibly correct this using BitRock, please?

Is it at all possible for the uninstaller to see that upon X.1 uninstall, the soft link additionally points to not only the target that is to be deleted, but also to another target that still uses that soft link? And if so, then leave the soft link alone?

Thanks so much!

asked 07 May '12, 20:46

Sasha's gravatar image

Sasha
6212323
accept rate: 0%


I have yet to play with symlinks, so I am guessing here.

Sounds as though you should check for the existence of another version of your software and the symlink's existence, during the preUninstallationActionList. If both exist, createSymLink in the postUninstallationActionList.

I can't say that I have done or tested this. My reasoning is that it sounds like the symlink is registered to the component that creates it. The second installation of that component (i.e. component X.2) just skipped it because it already existed. So, uninstalling the first installation, X.1, uninstalls the symlink. Uninstalling X.2 would probably leave this behind. Does that fit with what you are seeing?

You would also need to add removal of the symlink to the preUninstallationActionList if there are no other versions found to ensure that it is removed.

link

answered 08 May '12, 02:49

DevHopeful_2012's gravatar image

DevHopeful_2012
176121419
accept rate: 10%

As mentioned by DevHopeful_2012, the link is being automatically registered in the uninstaller. To solve it, you could remove it from the uninstaller after creating it:

<actionGroup>
   <actionList>
      <createsymlink> 
`        `<linkname>/usr/local/lib/libmchpusb-1.0.dylib</linkname>
          <target>${installdir}/my_app/Contents/Resources/some_ide/mplablibs/modules/lib/libusb-1.0.0.dylib</target>
      </createsymlink>
      <removeFilesFromUninstaller>
         <files>/usr/local/lib/libmchpusb-1.0.dylib</files>
      </removeFilesFromUninstaller>
   </actionList>
   <rulelist> 
      <platformtest> 
`        `<type>osx</type> 
      </platformtest> 
`  `</rulelist>
</actionGroup>
link

answered 08 May '12, 06:27

juanjo's gravatar image

juanjo ♦♦
4.6k412
accept rate: 25%

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:

×38
×8
×6
×4
×4
×1

Asked: 07 May '12, 20:46

Seen: 1,219 times

Last updated: 08 May '12, 06:28

powered by BitNami OSQA