views:

303

answers:

3

I have written a .net dll that I can successfully call from vb6. Deployment to xp, vista 32, and vista 64 boxes have been working. It is not working on windows 7 64 bit. I cannot run regasm.exe /codebase name.dll on the end users machine because they are not admins. Any ideas on helping me with deployment would be greatly appreciated.

Currently my app is deployed in the "c:\Program Files (x86)\application name" directory.

A: 

Deployment requires admin rights. It's supposed to fail in this case.

Steven Sudit
Wrong. This _is_ possible.
SLaks
It is working on Vista and XP without admin rights. I want to update an existing dll ...
sparkkkey
+1  A: 

I solved this by running regasm with the /regfile option, and replacing HKLM with HKCU in the resulting .reg file.

If you need more precise instructions, let me know.

SLaks
Thanks for the response. Is it working on Windows 7 64 bit? I replaced HKLM with HKCU\Software\Classes\Wow6432Node. This works on vista 64 but not windows 7 .... I suspect Wow6432Node issues.
sparkkkey
Try removing `Wow6432Node`
SLaks
Thanks for the help SLaks. I read that Wow6432Node was necessary to run since the vb6 app is 32 bit. I will remove it and give it a try.
sparkkkey
I took an axe to Wow6432Node and it started working on win7 64 bit. Thanks for the help!
sparkkkey
Just in case anyone is interested I have built a small powershell script that is run automatically in the build.VMIS is the name of the program.VMISLIB.dll is the name of the .net dll.
sparkkkey
sparkkkey
#take out the x86 stuff for a 32 bit box$match = " \(x86\)"$replacement = ""$content = Get-Content $file2$content = $content -creplace $match,$replacement$content | Set-Content $file2
sparkkkey
+1  A: 

I'm using registration free COM to access the .NET interop assemblies.

Basicly first you have to create assembly manifest with mt.exe and optionally re-sign strong names with sn.exe like this

mt.exe -managedassemblyname:{Your_DLL} -nodependency -out:{Your_DLL}.manifest
mt.exe -manifest {Your_DLL}.manifest -outputresource:%{Your_DLL};1
sn -Ra {Your_DLL} {Your_PFX}

Then reference this assembly manifest in your application manifest like this

<dependency>
    <dependentAssembly>
        <assemblyIdentity name="{Your_DLL}" version="1.0.0.0" publicKeyToken="hash_here" processorArchitecture="x86" />
    </dependentAssembly>
</dependency>

where assemblyIdentity matches assemblyIdentity in assembly manifest of {Your_DLL}.

On client machines both the VB6 executable and .NET dll must be in the same folder. No regasm and no GAC registration needed.

I'm using UMMM tool to automate the manifest creation process but you can do it manually if it's a one time setup.

wqw
I agree that Reg free comm is the best way to handle this. We have been having a few issues. It is still my long term goal. I will try out the UMMM tool.
sparkkkey
I was able to use the mt and sn commands listed above to get reg free comm to work. Thanks for the help!
sparkkkey