user285594
user285594

Reputation:

How do you make installer when the project is using many other dependencies in Java?

My main application is written in Java, which has Main.jar. I am preparing final package for deploy.

But it has other dependencies such as third party libraries need to be first available /pre-installed in Windows operating system, once that is installed my application can run, else it will show error and will not work. So i am struggling, end user has to do:

1) Thirdparty.library.msi (install manually) which is a GUI installer itself already
2) Then setup my Main.jar
3) Once it started it looks first for the third party libraries, if does not exist, software fails.

For such case, Is there any proper way to make one installer which can do the job as step 1 and then step 2, but both look like 1 installation?

Follow up: i also want my third party is not visible to the end user for presentation purpose. So i saw there is a tool exists called msi

1) Installer prepare for BATCH

Windows ® Installer. V 3.01.4000.1823 

msiexec /Option <Required Parameter> [Optional Parameter]

Install Options
    </package | /i> <Product.msi>
        Installs or configures a product
    /a <Product.msi>
        Administrative install - Installs a product on the network
    /j<u|m> <Product.msi> [/t <Transform List>] [/g <Language ID>]
        Advertises a product - m to all users, u to current user
    </uninstall | /x> <Product.msi | ProductCode>
        Uninstalls the product
Display Options
    /quiet
        Quiet mode, no user interaction
    /passive
        Unattended mode - progress bar only
    /q[n|b|r|f]
        Sets user interface level
        n - No UI
        b - Basic UI
        r - Reduced UI
        f - Full UI (default)
    /help
        Help information
Restart Options
    /norestart
        Do not restart after the installation is complete
    /promptrestart
        Prompts the user for restart if necessary
    /forcerestart
        Always restart the computer after installation
Logging Options
    /l[i|w|e|a|r|u|c|m|o|p|v|x|+|!|*] <LogFile>
        i - Status messages
        w - Nonfatal warnings
        e - All error messages
        a - Start up of actions
        r - Action-specific records
        u - User requests
        c - Initial UI parameters
        m - Out-of-memory or fatal exit information
        o - Out-of-disk-space messages
        p - Terminal properties
        v - Verbose output
        x - Extra debugging information
        + - Append to existing log file
        ! - Flush each line to the log
        * - Log all information, except for v and x options
    /log <LogFile>
        Equivalent of /l* <LogFile>
Update Options
    /update <Update1.msp>[;Update2.msp]
        Applies update(s)
    /uninstall <PatchCodeGuid>[;Update2.msp] /package <Product.msi | ProductCode>
        Remove update(s) for a product
Repair Options
    /f[p|e|c|m|s|o|d|a|u|v] <Product.msi | ProductCode>
        Repairs a product
        p - only if file is missing
        o - if file is missing or an older version is installed (default)
        e - if file is missing or an equal or older version is installed
        d - if file is missing or a different version is installed
        c - if file is missing or checksum does not match the calculated value
        a - forces all files to be reinstalled
        u - all required user-specific registry entries (default)
        m - all required computer-specific registry entries (default)
        s - all existing shortcuts (default)
        v - runs from source and recaches local package
Setting Public Properties
    [PROPERTY=PropertyValue]

OR enter image description here

2) Practical/samples

# Install Silently [works]:
C:\windows\system32\msiexec.exe /I "C:\Documents and Settings\sun\My Documents\Downloads\10.70.msi" /QN
C:\windows\system32\msiexec.exe /I "C:\Documents and Settings\sun\My Documents\Downloads\10.71.msi" /QN

# For future reference [not tested]
start /wait msiexec /i O12Conv.msi /qb
start /wait msiexec /p O12Convsp1-en-us.msp /qb
start /wait msiexec /i mpsetupedp.msi

# other samples [not tested]
msiexec /package Application.msi /quiet
msiexec /uninstall Application.msi /quiet
msiexec /update msipatch.msp /quiet
msiexec /uninstall msipatch.msp /package Application.msi / quiet

Upvotes: 1

Views: 584

Answers (3)

AlexR
AlexR

Reputation: 115338

All UI based installation tools have ability to run external programs and to run in batch mode that is controlled by command line arguments.

So, if your thirdparty.msi is what you have and have to use I's suggest you to find the ability to run it in a batch mode. Then create your own installation procedure that will invoke this 3rd party MSI.

There are various tools that for creating UI based installations programs (InstallShieled, InstallAnywhere etc).

Upvotes: 1

Ashish K Agarwal
Ashish K Agarwal

Reputation: 1172

there is a way to check if the dependent app is installed [like an env variable being set]. If not then the packaging script can install it. I have done this in Install Shield; not sure about other tools.

Upvotes: 0

toddlermenot
toddlermenot

Reputation: 1618

How about creating a DOS batch script(.bat) and call the msi installer and JAR in that particular order from there?.

Upvotes: 0

Related Questions