1

This is a windows form app that connects with NITGEN FINGKEY (finger print scanner) COM NBioBSPCOMLib.dll. I added their dll as a reference which generated \obj\Debug\Interop.NBioBSPCOMLib.dll. The Project->Build->Platform target is in x86. I'm following the steps below when I created the setup wizard:

  1. Make sure application is targeting proper platform x86.
  2. When creating setup wizard project, do not include source and debug files.
  3. After creating setup wizard project, right click the created project and click properties.
  4. Click Prerequisites, and choose "Download prerequisites from the same location as my application" in the specify the install location for prerequisites. Click ok.
  5. In the File System on Target Machine, Add Special Folder and choose "Program Files Folder".
  6. Click the application folder, right click Primary output from (appname) (Active), and choose "Create shortcut from primary output from appname". Rename file. then drag n drop to "Program Files Folder".
  7. Do #6 but instead drag n drop to User's Desktop.
  8. Do #6 but instead drag n drop to User's Programs Menu.
  9. Right Click Application Folder and choose Properties. Choose true for AlwaysCreate.
  10. Do #8 for Program Files Folder, User's Desktop and User's Programs Menu.
  11. In the Application Folder right click and choose add file. Choose the interop.NBioBPSCOMlib.dll and set its property register to vsdrfCOM.
  12. In the application Folder right click and choose add file. Choose the NBioBSPCOMLib and set its property register to vsdrfCOM.
  13. Build Project.

When I install this in windows 7, the application works. But when I install this in XP SP 3, I get a "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." exception.

Is there something wrong with the way I added my COM dll?

UPDATES

I ported the application to .NET Framework 4.0. I added the dll as a reference, set the embedded interop type : true. Created the setup installer without manually adding the dll in the Application folder. Now I'm getting this error: "system-runtime-interopservices-comexception-0x80040154". I found from some other post: link is not in the registry, but shouldn't the driver installer of the finger print be doing this part?

I tried manually doing a regsvr32 on the dll but then it would just say the application has encountered a problem and needs to close. When i ungregister the dll the comexception returns.

Community
  • 1
  • 1
Jemuel Dalino
  • 135
  • 3
  • 12
  • 1
    im not sure what the problem is but you can try to get more details on the error by generating a logfile from the setup. install the generated msi with 'msiexec /i yourMSI.msi /l*v logfile.log'. – weberik Jan 09 '13 at 11:20
  • What do I look for in the logfile? – Jemuel Dalino Jan 09 '13 at 11:29
  • where exactly the error is comming from, im asking because im not sure if its the com registry – weberik Jan 09 '13 at 11:31
  • its around 1,600 lines and I don't know how to read it. I posted the log file here : [link](https://gist.github.com/4492502) – Jemuel Dalino Jan 09 '13 at 11:37
  • 1
    Your setup program destroys the COM registration for the native COM component. Do *not* register the Interop DLL. Use the vendor's installer to get the native COM component installed. – Hans Passant Jan 09 '13 at 13:29
  • so does that mean I skip steps 11 & 12? but when I do that, the application throws an error that it cannot find the interop dll. I forgot to mention that I already installed the vendor's driver installer – Jemuel Dalino Jan 09 '13 at 14:40
  • Hans, is there a way for me to know if the vendor's installer installed the COM? – Jemuel Dalino Jan 09 '13 at 16:15
  • 1
    if even regsvr32 doesnt work that should be fixed first before we start troubleshooting the installer. is it even a selfregister dll? regarding the vendor setup, is it an MSI? if yes, you can install it and read the logfile so see how he registeres it. or you can open it with e.g. orca and read the tables, but thats a bit more complicated – weberik Jan 10 '13 at 10:07
  • Finally figured it out, the installer for the hardware is registering a different .dll, I tried installing the sdk in the client app and my application finally worked. Thanks for all your help guys! – Jemuel Dalino Jan 13 '13 at 08:17

1 Answers1

1

yeah installer logs are pretty verbose :) but you can simply search it for "NBioBSPCOMLib" and you will see what he is doing with it. in your case its a bit weird, the file is put in C:\Program Files\Wikonec\LTODoctorVerify\Interop.NBioBSPCOMLib.dll (see line 1024 and 1025) but later when we wants to register it the path "file:///C:/Users/Jemuel/Documents/Visual Studio 2010/Projects/fingerprint/FingerPrintValidate/bin/Debug/Interop.NBioBSPCOMLib.dll" (line 1124) is used. i am right if i asume that the windows7 is your development pc and the winXP a test machine without visual studio?

weberik
  • 2,636
  • 1
  • 18
  • 11
  • Yes, I'm doing deployment testing. The first path was because I manually added the Interop in the Application Folder in setup installer. It references the latter path you mentioned. Any idea how to fix this? – Jemuel Dalino Jan 09 '13 at 13:06
  • so far i have no idea. could you maybe post the project file of the setup? i should be a text file you can upload to gist – weberik Jan 09 '13 at 14:52
  • thanks, thats the file i meant. the project file looks fine. i think there is something elso going wrong but so far i can only guess. have you tried to completely uninstall the MSI and then reinstall it? – weberik Jan 09 '13 at 15:28
  • I updated my post, I ported it to .net framework 4.0 but the problem is somewhat similar – Jemuel Dalino Jan 10 '13 at 03:39