How do i get VS2010 to install a .dll to system32 on install of a published solution?

EccentricDyslex

Newcomer
Joined
Jul 26, 2010
Messages
11
I have a program written in vb on vs2010 which i have published to a NAS. The program requires "dgb.dll" (a custom dll) to be in the local PC's windows/system32 folder. How do i get vs2010 to get the published clickonce file to install this automatically and in the correct place? (also needs to be installed in wow64 for 64bit systems)

I have been through much online info about prerequisites, bootstraps and references but am struggling to make much sense of it all...can someone point me towards a walk through or maybe walk me through it here?

Many thanks!

Steve
 
Clickonce applications are designed to be a "low impact" deployment and as such are installed per-user rather than per-machine as this doesn't require any administrative permissions. Modifying the System32 folder however requires administrator permissions and is a per-machine wide change.

If you need to deploy things to a central location clickonce is probably not the technology to use, can you not just deploy this dll alongside the application itself?
 
Have you tried putting the dll in the same folder as the application and listing it as a required file under the clickonce property page?

Good place to check - before you do that, if this isn't a DLL you have built yourself, but rather an assembly you are simply references, make sure that your reference properties have been set to 'copy local' = 'true' for this reference.
 
Thanks for the advice chaps.

PD, can i ask, if i put the dll in the same application folder, will VS publish it along with the app via click once? or does this have to be manualy copied over to the new machine?

dT, the dll is supplied by the vendor of the device i am instructing in the vb program. The vendor states this must be copied into the system32 folder for the device to work. I am not sure if the dll controls the device or not...im not that knowledgable just yet lol.

Can you explain what setting reference properties to local copy does?

It would be ideal if i didnt have to install the dll to system32 and just distribute it with the app in the apps own folder if possible.

Cheers!

Steve
 
If you set a reference to "copy local" it simply means a copy the the dll will be included in the folder containing the executable.

You should be able to add the dll to the clickonce package, if you bring up the properties for the project in visual studio and go to the publish tab you should be able to add the .dll in as a required file - this means it will be deployed by click once automatically.

Sometimes files were dumped into system32 as a way of making them available to the entire system, if it is only needed by one app then it might work if it is contained in the same folder as the .exe itself.
 
Thanks PD.

I have tried to add it as a reference via "project", "add reference", "browse" but am getting an error- dgb.dll could not be added, check its a valid assemebly or COM componant...

Any ideas?

Steve
 
If it isn't a .net or a com dll then you don't need to add it as a reference to the project, you would just need to include it in the project properties -> publish tab.
 
Back
Top