none
How can I check the bitness of outlook? RRS feed

  • Question

  • Hi

    I've an outlook addin installer for outlook 2007, 2010, 2013 and 2015. Its working fine. Right now I've two installers for 64bit and 32bit. This also working fine. Here my problem is if I try to install the 32bit Addin installer in a machine, which have 64bit outlook, my addin will easily install. I don't want to install like this. My Aim is When I try to install 32bit installer in a machine which have 64bit outlook is installed, it will show an error message and skip the installation.

    Can i check this in setup project (launch condition) or need to add custom action project?

    Thanks in advance

    Bobbin

    Tuesday, September 20, 2016 4:16 PM

Answers

All replies

  • Hello Bobbin,

    You may try to use the product code (GUID) to identify the bitness of Office applications. See How to detect whether installed MS Office 2010 is 32 or 64 bit for more information. That is a way for a launch condition.

    As for the custom actions, take a look at the Detect whether Office is 32bit or 64bit via the registry page which explains the required steps for detecting the bitness programmatically.


    [custom.development]

    • Proposed as answer by David_JunFeng Friday, September 30, 2016 2:19 AM
    • Marked as answer by David_JunFeng Friday, September 30, 2016 2:19 AM
    Tuesday, September 20, 2016 6:29 PM
  • Bobbin,

    You may add custom action (CA) to your project and schedule it to run right after "LaunchConditions"; if bitness is wrong quit installation with error message. Simple registry check as pointed Eugene will be fine.

    From my point of view, if you already going to work on installer, the best, user friendly way is to create one installer and include both dlls (32 and 64 bit). Based on bitness of Outlook (get it from CA) install and register one add-in or another.

    Best regards,


    Slava Ivanov

    Tuesday, September 20, 2016 6:49 PM
  • Hi Slava

    Thanks for your reply.

    From my point of view, if you already going to work on installer, the best, user friendly way is to create one installer and include both dlls (32 and 64 bit). Based on bitness of Outlook (get it from CA) install and register one add-in or another.

    Thanks for your reply.

    About the above point can explain a little bit. How can I install 64bit and 32bit add-in according to outlook bitness. And  also if I'm using different dlls for 64bit and 32bit. Eg: sqllit is that is possible?

    Thursday, September 22, 2016 3:20 PM
  • Bobbin,

    What are you asking has nothing to do with Outlook development and related to Installation of the end product. Not sure that this is appropriate forum to ask, but I'll briefly explain how I see it, in fact this is how it's done for our add-in.

    Of cause you have 2 different dlls for 64 and 32bit version of add-in as the result of your release build. Those dlls are your "source" for the installation project, what ever type you have (Probably MSI based). You would include both of those dlls into "File" table of installation project. Next you would create one feature ("Feature" table); this would be feature of your add-in. Under this feature you would create two components ("Component" table); one component will include 32bit version of file and second 64bit version of file. If you have separate registration for your files (they are not self-registered) you would add registry entries to register your dll under corresponding component. Now if you would start this installation it will drop into user computer both dlls and register them. This is not what you want. To fix that you would create custom action ("CustomAction" table). This CA may be dll or just VBScript included within. This custom action would check Outlook Bitness and return true/false (for example isOutlook32bit). Schedule to run this CA right after "LaunchConditions" to set some property ("Property" table). And finally set installation condition on your components, based on this property, so your feature would install one component or another depend on result from this CA, never both. You done.

    Hope this helps,


    Slava Ivanov

    Thursday, September 22, 2016 4:22 PM
  • Hi Slava

    I need to check two thing in custom action. My Installer Targetplatform is 64bit or 32bit. After that check the outlook bitness. if the tagetplatform and bitness is same, then the installer can install. Otherwise it need to show an error message "You are trying to install wrong installer. Please contact admin" and skip the installer.

    Thank

    Bobbin Paulose

    Saturday, September 24, 2016 7:07 AM
  • Hi Bobbin Paulose,

    According to your description, are you blocked by creating Custom Action? If so you could refer to Walkthrough: Creating a Custom Action


    For more issue about Deployment Projects by using ClickOnce and Windows Installer, you could post them on MSDN forum for ClickOnce and Setup & Deployment Projects 

    https://social.msdn.microsoft.com/Forums/windows/en-US/home?forum=winformssetup

    Thanks for your understanding.

    Monday, September 26, 2016 8:56 AM
  • Hi David Jun Feng

    my question is

    1. How can I get the bitenss of my Add-in installer in my custom action?

    2. How can I get the bitenss of outlook  in my custom action?

    3. How can I skip my installation from my custom action according with a condition?

    Thanks 

    Bobbin Paulose

    Monday, September 26, 2016 11:49 AM
  • Hi Bobbin Paulose,

    According to your description, for your first and third question, you have posted similar thread on MSDN forum for ClickOnce and Setup & Deployment Projects, you could get help from this:

    https://social.msdn.microsoft.com/Forums/windows/en-US/51fdbfec-a274-473c-9ebc-ee400c53edd4/how-can-i-check-the-bitness-of-outlook-while-installing-the-addin-setup?forum=winformssetup

    >>>How can I get the bitenss of outlook  in my custom action?

    Have you followed Eugene's suggestion? You could use Registry class to access key/value pairs.
    using (RegistryKey key = Registry.LocalMachine.OpenSubKey("Software\Microsoft\Office\15.0\Outlook"))
    {
       if (key != null)
       {
          Object o = key.GetValue("Bitness");
       }
    }

    For more information, please refer to Registry Class

    Thanks for your understanding.
    Tuesday, September 27, 2016 7:12 AM
  • Hello Bobbin,

    "1. How can I get the bitenss of my Add-in installer in my custom action?"

    This is your installer, so you know bitness of it, you are actually building it as 32 or 64 bit. Set some property and read it from inside your CA or something else. You fee to do what ever you like in your own project. Include different action in 32 bit vs. 64 bit, etc. The question here would be why do you build 2 versions of installer? 32bt version will be more that enough. It will run on 32 and 64 bit machines and you may do installation of your dll based on bitness of user environment as I mention in previous post.

    "2. How can I get the bitenss of outlook  in my custom action?"

    You probably should use Eugene advise to read registry entry inside your CA. For example if you use VBScript/JS for your CA you would query registry for path to current Outlook installation (ex.:"HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\outlook.exe\"); next you would get the file version number and use it to query another registry entry, which include "bitness" key (ex:"HKLM\SOFTWARE\Microsoft\Office\YOUR_VERSION\Outlook"); and this is it, you know your bitness.

    "3. How can I skip my installation from my custom action according with a condition?"

    You would need to return 3 from your CA and installation will abort. See reference: Return Values of JScript and VBScript Custom Actions

    Hope this helps,


    Slava Ivanov

    Wednesday, September 28, 2016 6:17 PM