Is it possible to automate creation of keyfile, csc and regasm on client PC?

131 Views Asked by At

we have created an assembly dll that can be called via javascript and this opens up an exe applicaiton. Inorder for it to run, we have to:-

  • Ship the .cs file to customer
  • Provide batch file containing:-
  • Create the DLL from CS ---> Run C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /t:library myclass.cs
  • Create a new key file ---> Go to C:\program files x86\micorsoft SDKs\windows\v8.0\bin\NETFX 4.0 Tools\sn -k mynewkey.snk
  • Sign the DLL using the key file ---> C:\program files x86\micorsoft SDKs\windows\v8.0\bin\NETFX 4.0 Tools\sn -R AClass.dll myneykey.snk
  • Register the signed DLL ---> regasm AClass.dll/tlb /codebase.

This has to be executed by each customer. Is there any way to automate this, via javascript on the browser itself.. It is OK if the signing part is skipped..

1

There are 1 best solutions below

2
PMF On

Well, the most obvious solution that comes into my mind is to provide an installer that automatically does all of the above. That still needs the user to click something, but its just a single click. I don't think you can automate this, because that would be a major security hole in the browser if it allowed such an installation without user interaction. You can of course configure a browser plugin or an activeX control, which directly installs from the browser. But even that usually requires manual confirmation by the user for security reasons.