two versions of dll, 32 bit & 64 bit - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

rand
Posts: 22
Joined: Tue Sep 29, 2009 4:10 pm

two versions of dll, 32 bit & 64 bit

AI 7.6.1
Installer for a java application that uses a dll file.

The current installer works perfectly for 32 bit machines.
Install Parameters - Package Type - 32-bit package.
Creates one msi file that contains everything.

Switching to Install Parameters - Package Type - Mixed 32/64 bit matching the platform creates msi's, cabs, etc.
We want everything to be built into one msi file.

So what I want to accomplish is both the 32 bit and 64 bit dll (same file name) is contained in the msi file and during install the proper one is installed based on 32/64 bit os.

Do I add the 64 bit dll in Resources - Files and Folders and then in Deployment - Organization add the conditional?
The 32 or 64 bit versions need to have the same file name and one or the other be installed in the same folder, I don't see how to add a file with the same name as an existing file.

Am I on the right track here?

Thank you
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: two versions of dll, 32 bit & 64 bit

Hello,

Perhaps the installing different versions of a file based on the operating system would be useful.
Let me know if there is anything else I can assist you with.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
rand
Posts: 22
Joined: Tue Sep 29, 2009 4:10 pm

Re: two versions of dll, 32 bit & 64 bit

Thanks, that did the trick.

Now the proper dll is installed based on the os version.

I'm still struggling with trying to put together one msi file that will run correctly on 32 & 64 bit windows.

This may not be an AI issue at all, just thought someone might have exp. with this sort of thing.

Create MSI with:
Install Parameters - Package Type - 32-bit package
It will run fine on a 32 bit machine running a 32 bit jre
It will run fine on a 64 bit machine running a 32 bit jre
It will not run on a 64 bit machine running a 64 bit jre (error points to not being able to load the jvm.dll) although it exists at the path in the error message.

Change the MSI:
Java Products - Application - check 64-bit application checkbox
It will not run on a 32 bit machine with a 32 bit jvm - I suppose because it's looking for a 64-bit jvm and one isn't found? Nothing happen the application never starts, no error, etc. Fair enough
It will not run on a 64 bit machine with a 32 bit jvm - JRE not found error. Fair enough
It will run fine on a 64 bit machine with a 64 bit jre

So where I am now is that I can build one msi for both if the following applies (which will not work as a requirement)
If you are running the software on a 64 bit machine, you must have ONLY a 32 bit jre

Is there a way to add conditional to check the 64-bit application checkbox in Java Products? (I think that might do the trick)
Since java code should not care what the underlying os is, what is the real meaning of this checkbox? If it is checked the application will only use a 64 bit jre? Unchecked only uses a 32 bit jre?
Am I missing something else?

Thank you
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: two versions of dll, 32 bit & 64 bit

Hello,

I am afraid conditioning the type of java product is a feature we haven't yet implemented. It is on our list, however, and will be implemented in a future version of Advanced Installer.

In the meantime, you can create two java products, one for 32 and one for 64bit platforms. Place the files for each java product in a separate component, and conditionally install each component depending on the platform. That should work.

Let me know what you think.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
rand
Posts: 22
Joined: Tue Sep 29, 2009 4:10 pm

Re: two versions of dll, 32 bit & 64 bit

Gabriel,

Thanks for the reply.
I'm not sure about your suggestion, as far as java is concerned it doesn't care about 32 or 64 bit.

I have a little more information on my understanding on what is happening:

Right now, running on either 32 or 64 the application is installed correctly, the problem is running the application.
The problem lies the launching of the jvm from the Advanced Installer created exe (I think)

- Install on 64 bit windows, 32 bit jre, jvm launches correctly, all good
- Install on 64 bit windows, 64 bit jre, jvm will not launch, error attached
- Install on 64 bit windows, 64 bit jre & 32 bit jre, jvm will not launch, error attached

Also, if I run the application jar directly from the command line the application works correctly, using the 64 bit jre

So it seems that the issue something in the way that the exe attempts to launch a jvm.
Perhaps not having the 64-bit application checkbox checked means the exe will not be able to launch a 64 bit jre at all?
Java itself doesn't care as seen in the fact that the jar runs fine from the command line using the 64 bit jre, but it seems that AI cannot launch the 64 bit jre for some reason
Can you explain the logic behind that 64-bit checkbox, what exactly it does?

One more twist, if I change the installer and check the Java Product as 64-bit, both cases above DO launch the jvm correctly.
My problem then is that this will not work on 32 bit windows, so I've come full circle.

I also thought that perhaps something in the AI logic for Java Products - Virtual Machine - Virtual Machine Type & Source & Provider might be incorrect.
Maybe a sun 64bit jre not being recognized by AI as a sun provided jre and not being able to launch because of that.
I tried many different combinations of these three settings, made no difference, still got the attached error

Thanks for any insight you might be able to provide.
Attachments
jvmerror.PNG
jvmerror.PNG (45.92 KiB) Viewed 13996 times
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: two versions of dll, 32 bit & 64 bit

Hi rand,

I've understood the issue correctly. The problem is the launcher is 32bit so it can not launch the 64bit jvm. That's why I'm suggesting creating two java products. One with the 64bit option checked and one not, then install them conditionally. This is so that the launcher is 64bit on 64bit systems.

Let me know if that worked.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
rand
Posts: 22
Joined: Tue Sep 29, 2009 4:10 pm

Re: two versions of dll, 32 bit & 64 bit

Excellent, that seems to be working, I'm not real sure how that will effect our updates, but I'll look at that next.

One last thing that isn't working. On install in the ExitDialog we are able to launch our application. Since the application is now a differently named exe based on OS bit version, how do I specify that conditional in the Finish Actions tab - Application box.
Also, in the process of creating the additional Java Product I renamed some of my components in the AI gui. What is strange is that in the application box when it auto completes and shows the names of properties using the [#xxxx] it is showing the old names, is there a reason these aren't refreshed when I renamed them. I see the old name in many places in the aip file.

Thanks
rand
Posts: 22
Joined: Tue Sep 29, 2009 4:10 pm

Re: two versions of dll, 32 bit & 64 bit

Based on Advanced Installer User Guide - How do I launch a file after an installation?

I've created two "Launch file or open URL" Custom Actions under Before Finalization - InstallFinalize

One for 64 bit exe with execution expression Not Installed AND VersionNT64
One for 32 bit exe with execution expression Not Installed AND NOT VersionNT64

I would like to tie those custom actions to the Finish button click, but I cannot figure out what I am supposed to put in the Finish Actions tab - Launch Application - Application text field to make that happen.
Right now, the custom action are executed at the end of the ProgressDlg, then my app is launched, leaving the installer open, changing to the finish screen only when my application is closed.

How do I tie the custom action execution to the finish button?

Thanks
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: two versions of dll, 32 bit & 64 bit

Hello again,

There is no need to rename any of your files. Simply use the "install folder content to parent folder" approach that ca be found in our user guide on:
http://www.advancedinstaller.com/user-g ... files.html
It's simpler, cleaner and you don't need to change the Finish action or your file names.
Also, in the process of creating the additional Java Product I renamed some of my components in the AI gui. What is strange is that in the application box when it auto completes and shows the names of properties using the [#xxxx] it is showing the old names, is there a reason these aren't refreshed when I renamed them. I see the old name in many places in the aip file.
I'm not sure I understand. Could you describe this in more detail, along with the steps to reproduce it?

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
rand
Posts: 22
Joined: Tue Sep 29, 2009 4:10 pm

Re: two versions of dll, 32 bit & 64 bit

Never mind the renaming issue, I'm not worried about that anymore.

Thank you for all your help, let me recount what I have done since having a project that installed flawlessly on 32bit windows.
Probably more for my own understanding then anything else.

My original java product is AFS
The additional one is AFS64

- In order to install on 64bit windows and use a 64 bit jre, I had to create an additional java product (AFS64), the only difference being that the 64-bit application is checked on the new one.
- AI does not allow this new Java Product to be named the same thing as the existing one.
- Then following the directions on http://www.advancedinstaller.com/user-g ... files.html
- I followed the first bulleted list on this page and added the NOT VersionNT64 to the condition field for my original exe of my original java product (AFS)
- For the second bulleted list on this page, I created a folder under Application Folder, checked the Install folder content into the parent folder option.
- The next step is "add the 64-bit "MyApp.exe" file in this custom folder" which I did, the difference being that the new java product (AFS64) that I created is not named the same as the original, so the file
that I added to this directory is the aijclw.exe of the new java product (AFS64) I don't see a way to add the exe directly.
- Than I go to that component and add the VersionNT64 condition.
- So, one or the other gets installed based on VersionNT64, I added Application & Desktop Shortcuts for the new java product (AFS64)

This is all working correctly at this point, please let me know if the above steps I took are correct or if their is an easier way or something that I am missing.

The only remaining problem I have is launching the application (AFS or AFS64) after the user clicks finish on the exit dialog of the installer.
This is done by using the finish tab - launch application, which points to the exe of the original java product (AFS) so right now it doesn't work when the new java product (AFS64) is the one that was install on a 64 bit windows pc, for course, because the original java product is not the one that was installed in this case.

I did not see a way to condition which exe to launch from the finish actions tab. That lead me down the path to creating two custom actions (which I can condition) which I added to the InstallFinalize standard action. This works, but changed the behavior of the installation to something less than optimal. With these custom actions in place, my application is launched at the end of the ProgressDlg, leaving the installer running in the background. Once the user exits out of my application, the installer displays the ExitDialog and the user clicks finish.

My remaining question is:
Is there a way to:
1. Condition which exe gets launched from the ExitDialog - Finish Actions tab OR
2. Move the execution of the custom actions to a different phase? Is there a phase that would allow the custom actions to execute after the Exit Dialog finish is clicked? Then I could just remove the launch checkbox and always have the application launch.

Sorry this post ended up so long.
Again, thanks for all your help.
rand
Posts: 22
Joined: Tue Sep 29, 2009 4:10 pm

Re: two versions of dll, 32 bit & 64 bit

One other thing I tried today.

Removed the custom actions and created two new UI Custom Actions Launch File or URL custom actions (one for each exe)

Then in ExitDialog on the Published Events Tab - created two DoAction events one conditioned for NOT VersionNT64 and one for VersionNT64.

Nothing is launched when running the msi file now.

Thanks
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: two versions of dll, 32 bit & 64 bit

Hello,

The steps are correct.
Why not rename the .exe for your 64bit version to the same name as your 32bit version. You can rename it from the Files and Folders page, select it and press F2 or select rename from the context menu. No need for custom actions to conditionally launch your file.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
rand
Posts: 22
Joined: Tue Sep 29, 2009 4:10 pm

Re: two versions of dll, 32 bit & 64 bit

Gabriel,

I removed the custom actions and was able to renamed the 64 bit version to the same name as the 32 bit version.

To do this I had to create a child folder and use the "Install folder content into the parent folder" option.
Doing this then created the additional java Product with the same name, something I could not do directly from the Java Products page.
So now the Finish Action is working correctly.

One last thing. The desktop shortcut doesn't work if installing on 64 bit windows. The shortcut is not created at all.
Shortcut is setup to point at the AFS.exe, wish is installed in both cases. (Edit Shortcut.gif)

If I create an additional shortcut pointed at the exe in the child folder from above it works. (Edit New Shortcut.gif)
The only drawback being it cannot be named the same thing as the original shortcut.
Is this the proper way to implement shortcuts?

Thanks again.
Attachments
Edit New Shortcut.gif
Edit New Shortcut.gif (15.16 KiB) Viewed 13941 times
Edit Shortcut.gif
Edit Shortcut.gif (15.05 KiB) Viewed 13941 times
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: two versions of dll, 32 bit & 64 bit

Hi rand,

Again, you can use the same approach as with your .exe files. Place the shortcuts inside folders and set the folders' "install content to parent folder" option. You can thus have two shortcuts with the same name.

or

You can create a shortcut to external file and set its target to [APPDIR]\afs.exe. It will point to the exe at that location, regardless which .exe it is. Just make sure the shortcut does not end up in the same component as any of the .exe, otherwise it would be conditioned by that component to only install on certain system architectures. You want to always install this shortcut, so place it in another component.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”