views:

806

answers:

5

After building our VB.NET .exe it is then obfuscated using the 3rd-party .NET Reactor utility before the output of that is included within a VS2005 deployment project. Is there a way of replacing the .exe with the scrambled version prior to then publishing using click-once ?

Has anyone managed to deploy with click once, a net reactor protected application?

+1  A: 

You can but not using the standard ClickOnce deployment scheme. One way is to make a MSBuild task that takes your files and creates the ClickOnce manifest with the obfuscated file. The basic issue is that once you change the file after a manifest has been created it invalidates the file, leading to a non-working ClickOnce deployment.

Pat
What about using post build events? just a though...
Chocol8
Absolutely, the only reason I suggested MSBuild was due to my prior experience automating a ClickOnce strategy similar to this.
Pat
A: 

Sorry if wasting your time but what is wrong with this one?

In the post build events command line i am using the following:

"C:\Program Files\Eziriz.NET Reactor\dotNET_Reactor.exe" -file "D:\Proj0\MyApp\A3\bin\Release\MyApp.exe" -targetfile "D:\Proj0\MyApp\A3\bin\Release\MyApp_secure\MyApp.exe" -protectiontype app -necrobit 1 copy "D:\Proj0\MyApp\A3\bin\Release\MyApp_secure\MyApp.exe" "d:\Proj0\MyApp\A3\bin\Release\MyApp.exe"

and here is the output i get...

Done building project "MyApp.vbproj". Building MyApp... ALINK : error AL1047: Error importing file 'd:\Proj0\MyApp\A3\obj\Debug\MyApp.exe' -- An attempt was made to load a program with an incorrect format.

Chocol8
Did you ever fix this? I think it's more towards the fact it is attempting to read a managed EXE, when in fact it would already be protected by that stage and that's why it can't read it...
GONeale
A: 

When I ran into the error "An attempt was made to load a program with an incorrect format." it indicated that I was trying to load a 32 bit DLL on a 64bit version of Windows (Vista in my case).

Jeroen Huinink
i guess after protection the executable gets destroyed, (still using XP)... but WHY is this happening?
Chocol8
A: 

I have the same issue here. I'm trying to load a protected DLL into an unprotected .EXE. Works perfectly on 32 bit systems but gives me an error on 64 bit systems.

Did you find a solution for this yet?

A: 

You embed the protected files into a click once project that extracts and executes. Then publish that.

steve