我想使用 ConfuserEx 混淆我的源代码,所以我创建了一个如下所示的 ConfuserEx 项目文件:
<project baseDir="." outputDir="." xmlns="http://confuser.codeplex.com">
<rule pattern="true" inherit="false">
<protection id="rename" />
<protection id="ctrl flow" />
<protection id="ref proxy" />
<protection id="anti debug" />
<protection id="anti dump" />
<protection id="constants" />
<protection id="resources" />
<protection id="anti tamper" />
</rule>
<module path="MainApplication\bin\Release\MainApplication.exe" />
<module path="MainApplication\bin\Release\Component.Hardware.dll" />
<module path="MainApplication\bin\Release\Component.Log.dll" />
<module path="MainApplication\bin\Release\Component.Service.dll" />
<module path="MainApplication\bin\Release\Component.Software.dll" />
<module path="MainApplication\bin\Release\AsynchronousSocket.dll" />
<module path="MainApplication\bin\Release\Instrumentation.dll" />
</project>
因为我想通过设置部署我的应用程序,所以我为我的 MainApplication-Project 创建了一个 InstallShield 安装程序。我选择初级输出。
在 Visual Studio 的 Postbuild-Event 中,我使用 crproj 文件作为参数调用 Confuser.CLI.exe。然而,只有 MainApplication.exe
和 AsynchronousSocket.dll + Instrumentation.dll
被修改为 ConfuserEx。 4 个 Component.*.dll 文件不是。
我不得不说所有的程序集都是不同的项目。所以我的项目解决方案结构如下所示:
MyProject
MyProject.MainApplication
MyProject.Component.Hardware
MyProject.Component.Software
MyProject.Component.Log
MyProject.Component.Service
MyProject.AsynchronousSocket
MyProject.Instrumentation
MyProject.Setup
MyProject.sln
MyProject.crpoj
我的猜测是我使用了 InstallShield 使用的错误程序集。我还尝试使用 MyProject.Component.Service\bin\Release
和 MyProject.Component.Service\obj\Release
中的程序集,但这些选项均无效。
我不认为使用 MainApplication\obj\Release
有效,因为只有 MainApplication.exe
位于。
谁能告诉我 InstallShield 从哪里获取主要输出,或者我是否遗漏了其他内容?
最佳答案
一种可能的解决方案是多个 crproj 文件,每个二进制文件一个,并在每个项目的后期构建步骤中指定项目特定的 crproj 文件。 主应用程序.crproj
<project baseDir="." outputDir="." xmlns="http://confuser.codeplex.com">
<rule pattern="true" inherit="false">
<protection id="rename" />
<protection id="ctrl flow" />
<protection id="ref proxy" />
<protection id="anti debug" />
<protection id="anti dump" />
<protection id="constants" />
<protection id="resources" />
<protection id="anti tamper" />
</rule>
<module path="MainApplication\bin\Release\MainApplication.exe" />
</project>
Component.Hardware.dll.crproj
<project baseDir="." outputDir="." xmlns="http://confuser.codeplex.com">
<rule pattern="true" inherit="false">
<protection id="rename" />
<protection id="ctrl flow" />
<protection id="ref proxy" />
<protection id="anti debug" />
<protection id="anti dump" />
<protection id="constants" />
<protection id="resources" />
<protection id="anti tamper" />
</rule>
<module path="MainApplication\bin\Release\Component.Hardware.dll" />
</project>
关于c# - InstallShield 和 ConfuserEx,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30094596/