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:
- Make sure application is targeting proper platform x86.
- When creating setup wizard project, do not include source and debug files.
- After creating setup wizard project, right click the created project and click properties.
- Click Prerequisites, and choose "Download prerequisites from the same location as my application" in the specify the install location for prerequisites. Click ok.
- In the File System on Target Machine, Add Special Folder and choose "Program Files Folder".
- 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".
- Do #6 but instead drag n drop to User's Desktop.
- Do #6 but instead drag n drop to User's Programs Menu.
- Right Click Application Folder and choose Properties. Choose true for AlwaysCreate.
- Do #8 for Program Files Folder, User's Desktop and User's Programs Menu.
- In the Application Folder right click and choose add file. Choose the interop.NBioBPSCOMlib.dll and set its property register to vsdrfCOM.
- In the application Folder right click and choose add file. Choose the NBioBSPCOMLib and set its property register to vsdrfCOM.
- 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.