cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jkehoe
Level 4

Best way to include platform specific executables?

Hi,

I'm new to InstallAnywhere (and installers in general). I need to develop an installer that will place C-code executables that are specific for various platforms (Solaris, Windows, etc.). I've gone through the tutorials and searched through the help and can't find a good example of how to place these files. Is there a recommended way to include files in the project & have them installed only on the proper OS (like move actions with rules)?

Thanks in advance,
JK
Labels (1)
0 Kudos

(10) Replies
jkehoe
Level 4

I've been playing around defining components like "Common Files", "Linux Files" and "Windows Files". I've added rules for the Linux & Windows components so that they are only installed on the proper platforms.

Does that seem like the best way to handle this?
0 Kudos
jijujacob27
Level 6

Hi jkehoe,
There are multiple ways by which you can do this. However, I will attempt to describe the simplest of all ways (the rules route, that you already explored)

Let us say you have the following scripts.
[LIST=1]
  • solaris.sh
  • linux.sh
  • allunix.sh

    If you want to ship solaris.sh for solaris platform, then add the file to install phase, and then add a Check Platform Rule with Solaris on the perform list and all other platforms on the Do Not Perform list.

    Similarly, for linux.sh, put linux alone on the perform list
    Similarly, for allunix.sh, put linux, hpux, solaris, macos, macosx on the perform list.

    Another Way to do this:
    You can also achieve this by using Tags which was introduced in IA 2010. Though I would not recommend Tags for such simple scenarios, I would recommend that you go through Tags. Probably it might help you in some thing else.

    Thanks,
  • 0 Kudos
    jkehoe
    Level 4

    Thanks for the response. The rules seem to work really well, but I haven't tried tags yet. I'll look into that.

    I'm going to have a LOT of files to install. And some of them will have the same names for Solaris, Linux, etc. So to make the organization a little easier I was thinking about using the component route. Is there a problem with doing that?
    0 Kudos
    jkehoe
    Level 4

    OK, I'm not having much luck with tags. I've tried defining components and adding tags or just adding tags to specific files in the "Install" tab. No matter what I do I get the following error:

    Tags not consistent with either of parents in the "Visual Hierarchy", "Feature", or "Component"

    I'm trying to get the installer for each platform to contain only the files for that platform since I'll be placing a LOT of files.

    Any help would be greatly appreciated.
    0 Kudos
    jrokicki
    Level 4

    I would suggest placing the files in an action group, then placing the platform rule on the action group.

    That way the rule is only specified once and applies to all files in it.
    0 Kudos
    jijujacob27
    Level 6

    Hi jkehoe & jrokicki,

    We need to understand how tags work w.r.t all the visual hierarchy to understand the error.

    The hierarchy is as follows for install phase:
    OS Host
    |__ Feature
    |___ Component
    |___ (parent actions)
    |_____actions


    For pre /post install and pre/post uninstall, the hierarchy is just very simple.

    The tag association error tells you that you have an element that qualifies with much more tags than one in the parent hierarchy. i.e., the element will not execute.

    Note for OS host alone, the tag customizer is not directly available. Try adding a dummy jee / db host and then you can see the tag customizer visible for the os host too ( organization > hosts tab) and then you can remove the dummy host...

    Please let me know if you have any specific queries related to tags.

    Thanks,
    Jiju

    (PS: if you hold the control key down while launching IA, then the command window opens up and when you change the tag associations, you can actually see some printlines that are printed on console which can pinpoint the association which fails.. not a published feature though)
    0 Kudos
    bostonian
    Level 2

    1. what is the difference between rules (check by platform/check by architecture) vs tags

    2. when do u use tags and when do u use rules

    3. tags weird results:

    - lets say i have two files, abc.java (eg 200KB) and def.java (eg 400KB)
    - abc.java needs to install on windows 32 and def.java needs to install on windows 64.
    - in the install section, i tag abc.java with the tag created as WINDOWS32 and def.java with the tag created as WINDOWS64
    - in the build configuration section, i have a win32 build configuration which has the WINDOWS32 tag created and a win64 build configuration which has the WINDOWS64 tag created.
    I have selected optimize for platforms and tags checkbox as well.
    - when i run the build all, i get two win32setup.exe and win64setup.exe,
    - THIS IS THE FUNNY THING: I see that both win32setup.exe and win64setup.exe are 600KB which means both abc.java and def.java are present physically in the both the setups. However when i install the win32setup.exe on win32 i get only abc.java deployed which makes sense as per the tag WINDOWS32.

    So my question is shouldnt win32setup.exe be only 200kb with only abc.java and win64setup.exe be only 400kb with only def.java

    Please help clarify, I cannot find any reference anywhere on the web/documents or even the 3 day course notes.
    0 Kudos
    pv7721
    Level 20

    1. Check by platform: is it Windows, is it Linux, is it Solaris etc. (Should have been named Check by OS, actually)
    Check by architecture: is it x86 or AMD64 (for Intel) or is it SPARC etc etc (so what's the processor architecture).
    So you would actually need both in order to test for a combination like:
    is it a Win 64 or is it a Solaris on x86?

    2. Tags must be a new feature in IA 2010, which I'm yet to use, so I have no experience with it. However, rules existed I think right from the 1st version of IA, I always used rules and they work pretty well. They also got improved, I think, because initially rules were to be evaluated only at run time (thus having installers with components that are not needed for a given combination of platform and architecture, and if they were evaluated at build time, too, such components should not even added in the first place.

    3. You know, Windows executables are nothing but a little more elaborated self-extracting archives, so you can peek with an archiving tool (I personally use WinRar) in order to check what's actually bundled inside a setup.exe This way you can be completely sure if both files are bundled or not in the final setup.
    0 Kudos
    garyb101
    Level 3

    bostonian, I am not sure if this will help. I haven't played with tags yet, but I noticed a checkbox in the build -> Build configurations -> Distribution tab.

    It is listed as "Optimize Installer Size by Platform and Tags". It is unchecked by default.

    Checking this might fix your problem
    0 Kudos
    pv7721
    Level 20

    What you may want to do is to group your files per platform then use SpeedFolders (otherwise it'll be quite complicated to manage the IA project, I guess).
    0 Kudos