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

Why can we not write InProcServer32 values to registry

We have an MSI install for a 32 bit program that requires 2 small COM arx(dll) files to be 64 bit on 64 bit machines to interface with AutoCAD 64 bit programs.

I've tried both using the COM Registration as well as directly editing the Registry values for the component but it will not write the InProServer32 value in the 64 bit portion of the registry under our CLSID.

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{4FBCDC18-44CD-4471-9F43-2652E42318A5}\InProcServer32

It will write every other value. The ProgID, Programmable, TypeLib, VersionIndependentProgID you name it. I can even change the name to InProcServer321 and it works to that key but it's like Installshield itself ignores the InProcServer32 key even when I'm not using the COM Registration.
Labels (1)
0 Kudos
(2) Replies
RodneyM
Level 4

Also it will write it to the

With the Registry Reflection enabled you end up with:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{4FBCDC18-44CD-4471-9F43-2652E42318A5}
ProgID
Programmable
TypeLib
VersionIndependentProgID

And

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node\CLSID\{4FBCDC18-44CD-4471-9F43-2652E42318A5}
InProcServer32
ProgID
Programmable
TypeLib
VersionIndependentProgID

Everything else like the Class Names, TypeLib, Interfaces all write correctly and are Reflected properly in the Normal and Wow6432Nodes
0 Kudos
RodneyM
Level 4

WARNING I AM A NOVICE AT INSTALLSHIELD AT THE BEST. I HAVE NO IDEA IF THIS MESSES UP THE REPAIR FUNCTIONS BUT FOR US IT IS NOT A SHARED FILE AND APPEARS TO WORK IN OUR CASE.

First I honestly don't know why Installshield doesn't automatically handle this or give one an option. It does seam like Windows does not user Registry Reflection for the InProcServer32 key so maybe that is why.

I also don't know how Microsoft and Installshield could not have planned for hybrid apps that would be 32 bit with some 64 bit components.

From some other posts I found that one needs to use the REGDB_OPTION_WOW64_64KEY to write specifically to the 64bit portion. So I modified their sample Installscript to write our values and included it below.

It appears to work for our situation


////////////////////////////////////////////////////////////////////////////////
//
// IIIIIII SSSSSS
// II SS InstallShield (R)
// II SSSSSS (c) 1996-2002, InstallShield Software Corporation
// II SS All rights reserved.
// IIIIIII SSSSSS
//
//
// This template script provides the code necessary to build an entry-point
// function to be called in an InstallScript custom action.
//
//
// File Name: Setup.rul
//
// Description: InstallShield script
//
////////////////////////////////////////////////////////////////////////////////

// Include Ifx.h for built-in InstallScript function prototypes, for Windows
// Installer API function prototypes and constants, and to declare code for
// the OnBegin and OnEnd events.
#include "ifx.h"

// The keyword export identifies MyFunction() as an entry-point function.
// The argument it accepts must be a handle to the Installer database.
export prototype Write_To_64bit_Registry(HWND);
prototype WriteStringKey(STRING, STRING, STRING, STRING);

// To Do: Declare global variables, define constants, and prototype user-
// defined and DLL functions here.


// To Do: Create a custom action for this entry-point function:
// 1. Right-click on "Custom Actions" in the Sequences/Actions view.
// 2. Select "Custom Action Wizard" from the context menu.
// 3. Proceed through the wizard and give the custom action a unique name.
// 4. Select "Run InstallScript code" for the custom action type, and in
// the next panel select "MyFunction" (or the new name of the entry-
// point function) for the source.
// 5. Click Next, accepting the default selections until the wizard
// creates the custom action.
//
// Once you have made a custom action, you must execute it in your setup by
// inserting it into a sequence or making it the result of a dialog's
// control event.

///////////////////////////////////////////////////////////////////////////////
//
// Function: MyFunction
//
// Purpose: This function will be called by the script engine when
// Windows(TM) Installer executes your custom action (see the "To
// Do," above).
//
///////////////////////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////////////////////////////
//
// Function: Write_To_64bit_Registry
//
// Purpose: This function will be called by the script engine when
// Windows(TM) Installer executes your custom action (see the "To
// Do," above). It will register my 64 bit arx files so we do not
// need to have both a 64bit and 32 bit install
//
///////////////////////////////////////////////////////////////////////////////

function Write_To_64bit_Registry(hMSI)
STRING szKey, szClass;
STRING szAppPath;
NUMBER nSize;
begin
szClass = "";
szAppPath = "";

// Enable Write to the 64bit registry...
REGDB_OPTIONS = REGDB_OPTIONS | REGDB_OPTION_WOW64_64KEY;

// Set the root key to HKEY_LOCAL_MACHINE, HKEY_CLASSES_ROOT is default...
if(RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE) >= 0) then


szKey = "SOFTWARE\\WOW6432Node";
//Do only if this is a 64bit machine
if(RegDBKeyExist (szKey) >=1) then
// Create registry keys...
szKey = "SOFTWARE\\Classes\\CLSID\\{4FBCDC13-44CD-4471-9F43-2652E42318A5}";

WriteStringKey(szKey, "", "", "Application Class");
WriteStringKey(szKey, "", "AppID", "{????????-????-????-????-????????????}");
WriteStringKey(szKey + "\\InProcServer32", "", "", INSTALLDIR + "YourApp.dll");
WriteStringKey(szKey + "\\InProcServer32", "", "ThreadingModel", "Apartment");

WriteStringKey(szKey + "\\ProgID", "", "", "YourApp.Application.1");
WriteStringKey(szKey + "\\Programmable", "", "", "");
WriteStringKey(szKey + "\\TypeLib", "", "", "{????????-????-????-????-????????????}");
WriteStringKey(szKey + "\\VersionIndependentProgID", "", "", "YourApp.Application");

endif;
endif;
// Disable Write to the 64bit registry
REGDB_OPTIONS = REGDB_OPTIONS & ~REGDB_OPTION_WOW64_64KEY;
end;



function WriteStringKey(szKey, szClass, szName, szValue)
begin
if(RegDBKeyExist (szKey) <0) then
RegDBCreateKeyEx (szKey, szClass);
endif;
if(RegDBKeyExist (szKey) >=1) then
RegDBSetKeyValueEx (szKey, szName, REGDB_STRING, szValue, -1);
endif;

end;
0 Kudos