I have a clickonce application. I need to register COM visible dll for that application. I used registration in the code of that application that checks if this was already registered and registers it by RegistrationServices class method RegisterAssembly(). It works fine if it is was launched by administrator. But I can't require administrator rights to deploy clickonce application. The second way I tried to register is prerequisite for my clickonce that will require administrator and will register my dll. I had created product manifest for my prerequisite application, but I got an error during the clickonce deployment
"Setup has detected that the file '...' has either changed since it was initially published or may be corrupt."
I figured out that this is the problem of .NET 4.5 and I should sign my prerequisite. I signed it and generated manifest by Bootstrapper again. After that I got the following error during the deployment:
"File not trusted Error: Setup has detected that the publisher of file cannot be verified"
I had to install the certificate on the target machine first before I could successfully deploy my clickonce. But it won't be possible to install certificate before installing clickonce on all target machines. Does anybody have any ideas how to resolve this issue? Thanks in advance.
I talked to the ClickOnce guy at Microsoft about your question. Are you using VS2010 or VS2012? He says the error you're seeing occurs sometimes when using VS2010.
If you use VS2010 and .NET 4.5 is installed on that machine, VS uses the build tasks from .NET 4.5, and that uses a SHA256 hash on the custom bootstrapper package to create that setup package. But then setup.exe will download the bootstrapper and try to do a SHAH1 comparison, which doesn't match the SHAH2 one.
The workaround is if you build and deploy it with VS2012 update 2, it should work.
It should also work if you sign it with a proper CA cert. In that case, they don't do the hash verification, they just verify it with the certificate.
If you want to continue using VS2010, you can pick up the setup.bin from VS2012 update 2, place it In the vs2010 folder, and then it will work. It's in the windows SDK folder.