rohitgarg20
Posts: 31
Joined: Thu Mar 13, 2014 6:31 am

Conditional DLL install Based on Outlook Bitness value

Hi

I have a requirement which is mentioned below:

I have two Dlls. One is for 64 Bit Outlook and other is for 32 bit outlook. I have to create an installer where I need to install appropriate dll out of these two depending on the Outlook bitness value available in Registry.

I.e. If Outlook bitness value is x86 then install 32bit.dll and if it is x64 then install 64bit.dll

Also any outlook version may be installed on the target computer from office 2003 to office 2013 or 365.

-So first I need to get outlook bitness value for the installed office (the version I obviously wouldn't be knowing)
- And then depending on the bitness value detected, I need to install appropriate dll out of two available dlls.

This is an urgent task. How it can be achieved.

Thanks in advance for your valuable answers.

Rohit Garg
R
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Conditional DLL install Based on Outlook Bitness value

Hello Rohit and welcome to Advanced Installer forums,
Also any outlook version may be installed on the target computer from office 2003 to office 2013 or 365.
In order to achieve that, you can go in the Search page and create a Registry value with a specified content - Extended Search. The result is given by the presence of a registry value with a certain content. You will be given the option to specify how the comparison is made. If the search is successfully, then the property assigned to the Search operation will be set, otherwise it will be empty.
You can take a look om the below image to have a better view about this:
Search Outlook.png
Search Outlook.png (12.31 KiB) Viewed 41629 times
So, you can add a search for each version of Microsoft Office and also check for each Bitness value: x86 or the x64 version.
If Outlook bitness value is x86 then install 32bit.dll and if it is x64 then install 64bit.dll
Please note that once you had added the DLLs to your installation package, a new component has been created in the Organization page.
So, you can add your search name in the Condition field of the related component
e.g.
For the component associated with the 32bit dll you can have something like that in the condition field:

Code: Select all

OUTLOOK_32_OFFICE2003 OR OUTLOOK_32_OFFICE2007 OR OUTLOOK_32_OFFICE20010 OR OUTLOOK_32_OFFICE2013 OR OUTLOOK_32_OFFICE365
where OUTLOOK_32_OFFICE2003 and OUTLOOK_32_OFFICE2007 and so on are the public properties associated with your searches from the Search page.
So, if any of these searches is true then your .32 bit DLL should get installed.

Add something similar for the 64 bit dll.

Please let us know if you have other questions.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rohitgarg20
Posts: 31
Joined: Thu Mar 13, 2014 6:31 am

Re: Conditional DLL install Based on Outlook Bitness value

Hi Dan

I tried it with only Office 15 right now. It worked like a charm. Will Try it with all Office version conditions as well, which i think should be working as well.

Thanks for your valuable answer.

Best Regards
Rohit Garg
R
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Conditional DLL install Based on Outlook Bitness value

You're welcome Rohit,

Please let me know if there is anything else I can help with.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rohitgarg20
Posts: 31
Joined: Thu Mar 13, 2014 6:31 am

Re: Conditional DLL install Based on Outlook Bitness value

Hi Dan

I hope you are doing fine.

I went through certain cases for installing 32 and 64 bit files. It worked for some small conditions. But I would like you to point out to me about the following project requirement:

"If Outlook version is earlier than Outlook 2010 OR no Outlook is installed OR operating system is 32 bit, you can safely assume that it is 32bit only and you install 32bit files. "

"If No outlook version is installed I need to install 32 bit files only regardless of the operating system"

"And if operating system is 64 bit, I need to test outlook bitness. If it is x64 then 64 bit files, otherwise 32 bit files"

Can you kindly guide me in making conditions handy and as small as possible.

Best Regards
Rohit Garg
rohit.aggrawal90@gmail.com
Last edited by rohitgarg20 on Fri Mar 21, 2014 8:41 am, edited 1 time in total.
R
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Conditional DLL install Based on Outlook Bitness value

Hi Rohit,

Please correct me if I'm wrong.
The 64bit dll will be installed only if the bitness value of Outlook is 64. (you cannot install a 64 bit installation package on a 32bit Operating System).

The 32bit dll will be installed every time when the 64bit dll is not installing.

Is my assumption correct?

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rohitgarg20
Posts: 31
Joined: Thu Mar 13, 2014 6:31 am

Re: Conditional DLL install Based on Outlook Bitness value

Hey Dan

Yes.

if Operating System is 64 bit and bitness is 64 as well then dll to install is 64 bit.

If operating system is found to be 64 bit but no outlook bitness found, then install 32 bit as we don't know what the user choses to install later on.

If operating system is not 64 bit then it will be 32 bit files.

I hope you are getting me. looking forward to see from you

Best Regards
Rohit Garg
rohit.aggrawal90@gmail.com
R
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Conditional DLL install Based on Outlook Bitness value

Hi Rohit,

Starting with Office 2010, Outlook is available as a 32-bit application or as a 64-bit application. So, in order to install the 64 bit DLL you only need to check the following registry keys:

Office 2010
  • • Registry path: HKEY_LOCAL_MACHINE\Software\Microsoft\Office\14.0\Outlook
    • Registry key: Bitness
    • Value: x64.
Office 2013
  • • Registry path: HKEY_LOCAL_MACHINE\Software\Microsoft\Office\15.0\Outlook
    • Registry key: Bitness
    • Value: x64.
In order to achieve that, you can go in the Search page and add a Registry value with a specified content – extended search for Outlook 2010 (e.g. OUTLOOK_64_2010 ) and another Registry value with a specified content – extended search for Outlook 2013 (e.g. OUTLOOK_64_2013 ).
Your extended searches properties can look something like:
SearchPage.png
SearchPage.png (14.61 KiB) Viewed 41538 times
Then, in the Organization page, you can add in the condition field from the component properties of your 64 bit DLL a condition like that:

Code: Select all

( VersionNT64 AND OUTLOOK_64_2010 ) OR ( VersionNT64 AND OUTLOOK_64_2013 )
OrganizationPage.png
OrganizationPage.png (17.94 KiB) Viewed 41538 times
Please note that VersionNT64 - property is set only if the system is running on a 64-bit computer (it is empty if the package runs on a non-64 bit computer).
Using this statement in the condition field, the 64 bit DLL will only be installed if the Operating System is on 64 bit and the Outlook bitness is 64 (Office 2010 and Office 2013), otherwise the 32 bit DLL should be installed.

So, you can add in the condition field from the component properties of your 32 bit DLL a condition like that:

Code: Select all

NOT ( OUTLOOK_64_2010 OR OUTLOOK_64_2013 )
Using this condition, since there is no Outlook 64 bitness, the 32 bit DLL will be installed.

Please let me know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rohitgarg20
Posts: 31
Joined: Thu Mar 13, 2014 6:31 am

Re: Conditional DLL install Based on Outlook Bitness value

Hey Dan

Thanks for posting the detailed answer. Yeah your suggestions have been helping till now. I will further check it out when creating final setup for release and let you know in case of problems.

Best Regards
Rohit Garg
rohit.aggrawal90@gmail.com
R
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Conditional DLL install Based on Outlook Bitness value

You're welcome Rohit,

If there is anything else I can help with, please let me know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rohitgarg20
Posts: 31
Joined: Thu Mar 13, 2014 6:31 am

Re: Conditional DLL install Based on Outlook Bitness value

Hi Dan

A new method has been specified in determining the outlook bitness installed. I am mentioning the algorithm and don't know how to do it using Advanced Installer or whether it allows this or not.

Algo:

bitness = 32;
If(OSVersion==64)
{
--> Get Value of Outlook.Application key from HKEY_CLASSES_ROOT. it gives value in the form of 'Outlook.application.X' where X is outlook version.
--> I want this X only.
--> Check if this X (Version) is greater than 12 i.e. Outlook 2007.
--> If Yes get Bitness registry value of Corresponding office version from Registry i.e. Software\Microsoft\Office\15.0\Outlook
--> Then set bitness =32 or bitness=64 depending on the bitnes value of the corresponding office registry key.
}

Is it possible to write algorithm or method like as written above so that I can get easily what I want.

Thanks in Advance.

Best Regards
Rohit Garg
rohit.aggrawal90@gmail.com
R
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Conditional DLL install Based on Outlook Bitness value

Hi Rohit,

In order to achieve that, you can create a .DLL custom action as a custom action written in C# or a custom action written in C++. Within your custom action you can set a property according to your search result.

Then you can go in the “Custom Actions” page and add a predefined Launch attached file custom action with sequence. This type of custom action can execute an application (EXE or DLL) or run a script (VBScript or Java script). Also, the source file will be embedded in the MSI file but will not be deployed at install time with the other application files.

Please let us know if you need any help.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rohitgarg20
Posts: 31
Joined: Thu Mar 13, 2014 6:31 am

Re: Conditional DLL install Based on Outlook Bitness value

Hi Dan

Yeah that seems excellent way of doing so. Custom actions are great.
I am going to implement this for sure and share my experience with installer with you.

really appreciate your help and support.

Thanks & Best Regards
Rohit Garg
R
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Conditional DLL install Based on Outlook Bitness value

You're welcome Rohit,

If there is anything else I can help you with, please let me know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rohitgarg20
Posts: 31
Joined: Thu Mar 13, 2014 6:31 am

Re: Conditional DLL install Based on Outlook Bitness value

Hi Dan

My Custom DLL install problem got solved. Thanks to your valuable suggestions.

Please help me with the following.

1) After creating the installer I am getting the following errors when running the built package (I have custom actions with a VB Script and Custom uninstall/Install):
Error : the dialog errordialog has error style bit set..
Error: Error Reading from file Microsoft\Installer\{some temp key}\OctopiSetup.mst

(Most possibly above error coming because of improper uninstallation of previous version)

2) Now I have a new requirement which is as follows:
Requirements which I have got:
--> it should only write onto program files folder if 'ALL Users' install mode is selected. Only if login user is Admin then Program files must be install directory otherwise localappdata directory.
--> If install folder is program files, then write a script to install in program files (x86) or program files folder depending on the 'executable' bitness. As I am creating mixed mode installation type, which doesn't seem to support automatic install in respective program files?

In Client Words:
if it is All Users Mode, it means that it is accesible to all windows login, hence, it should be installed on program files folder.
but of course, elevation should happen when installing on program files.

Elevation: only users with admin rights can install on program files folder.
so, if a windows standard user is installing the app, it cannot install to program files.
hence, elevation will be required but that should be handled by the installer.

Basically I am able to achieve everything I require with using: 'AI_ProgramFiles'.
But the contradiction lies when the OS is 64 bit and Outlook installed is 32 bit. In that case if AI_ProgramFiles is being used, the app and the outlook 32 dll wil be installed in ProgramFiles64 folder. But the outlook software is in 32 bit Program Files folder. So outlook 32 dll will not pick the Outlook installed in x86 folder.

Waiting for your kind reply.

Thanks and Best Regards,
Rohit Garg
Last edited by rohitgarg20 on Mon Apr 28, 2014 6:44 am, edited 1 time in total.
R

Return to “Common Problems”