Open giangkieuduc opened 9 years ago
Hey, I'm following this instructions to publish manually: https://confuser.codeplex.com/discussions/428378 If i dont create koi file Setup will raise error "Not found" when download application files I've tried other way: I've created a empty koi file by command: CALL REM #143 TYPE NUL>"c:\koi" and add to manifest by MageUI.exe and re-sign. I've received error "Koi file already exist" when download application files to install.
Hi, For the moment, you could disable packer to workaround this issue. I'll add an alternate implementation of packer later to fix it.
Disable the packer is for me not a solution. I need a solution. When is a solution available?
Hi,
You can enable the alternate implementation using the compat
parameter of compressor packer. You can read the wiki for more details.
Hi, i activate the compatibility mode:
But after protecting this application, the application don't start anymore. I have created an example application. It is a WPF application with a Splashscreen. If i set "compat" mode, the application crashes on start: System.Resources.MissingManifestResourceException System.Resources.ManifestBasedResourceGroveler.HandleResourceStreamMissing(System.String) bei System.Resources.ManifestBasedResourceGroveler.GrovelForResourceSet(System.Globalization.CultureInfo, System.Collections.Generic.Dictionary`2<System.String,System.Resources.ResourceSet>, Boolean, Boolean, System.Threading.StackCrawlMark ByRef) bei System.Resources.ResourceManager.InternalGetResourceSet(System.Globalization.CultureInfo, Boolean, Boolean, System.Threading.StackCrawlMark ByRef) System.Resources.ResourceManager.InternalGetResourceSet(System.Globalization.CultureInfo, Boolean, Boolean) System.Resources.ResourceManager.GetObject(System.String, System.Globalization.CultureInfo, Boolean) System.Resources.ResourceManager.GetStream(System.String, System.Globalization.CultureInfo) System.Windows.SplashScreen.GetResourceStream() System.Windows.SplashScreen.Show(Boolean, Boolean) System.Windows.SplashScreen.Show(Boolean) SplashscreenTestApplication.App.Main()
Ausnahmeinformationen: System.Reflection.TargetInvocationException System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Object[], System.Signature, Boolean) System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object, System.Object[], System.Object[]) System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
The problem is caused by that the unpacking stub would be the entry assembly, causing WPF to search resources in it, rather than the correct unpacked assembly. You can fix it by changing the resource URI referenced to absolute form. For example, change the StartupUri
in App.xaml
from MainWindow.xaml
to /Test;component/mainwindow.xaml
.
This helps, but not for the WPF Splashscreen.
Something like this does not work:
Which way are you using to show the splash screen?
Hi, I'm using ClickOnce to Publish my WPF App and BeforeBuild event I Create Property named Obfuscate and You can see detail in Sample Project here: http://1drv.ms/1ONBe0T
When i click to Publish... in VS it worked (Publish success) But when I install my App by click into Setup.exe. I've recived an Error ' Downloading file:///C:/WpfApplication1/WpfApplication1/publish/Application Files/WpfApplication1_1_0_0_46/koi.deploy did not succeed'
I've tried to add empty koi file to publish directory but recived another error (koi.publish hash not valid)
I don't know how to fix this error or How to add koi file automatically to the deploy manifest? Thank you!
Here is log: Publish - Build logs details:
1>------ Build started: Project: WpfApplication1, Configuration: Release Any CPU ------ 1>Build started 03/10/2015 10:58:21 AM. 1>PreBuildEvent: 1> CALL REM #143 TYPE NUL>"C:\WpfApplication1\WpfApplication1\bin\Release\koi" 1> CALL REM #143 TYPE NUL>"C:\WpfApplication1\WpfApplication1\obj\Release\koi" 1> CALL REM #143 TYPE NUL>"C:\WpfApplication1\WpfApplication1\bin\Debug\koi" 1> CALL REM #143 TYPE NUL>"C:\WpfApplication1\WpfApplication1\obj\Debug\koi" 1>MainResourcesGeneration: 1>Skipping target "MainResourcesGeneration" because all output files are up-to-date with respect to the input files. 1>CoreResGen: 1> "C:\Program Files\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\resgen.exe" /useSourcePath /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\Microsoft.CSharp.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\mscorlib.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\PresentationCore.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\PresentationFramework.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Core.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Data.DataSetExtensions.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Data.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Xaml.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Xml.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Xml.Linq.dll" /r:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\WindowsBase.dll" /compile Properties\Resources.resx,obj\Release\WpfApplication1.Properties.Resources.resources 1> Processing resource file "Properties\Resources.resx" into "obj\Release\WpfApplication1.Properties.Resources.resources". 1>GenerateTargetFrameworkMonikerAttribute: 1>Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files. 1>CoreCompile: 1> C:\Program Files\MSBuild\12.0\bin\Csc.exe /noconfig /nowarn:1701,1702,2008 /nostdlib+ /platform:anycpu32bitpreferred /errorreport:prompt /warn:4 /define:TRACE;WPF /errorendlocation /preferreduilang:en-US /highentropyva+ /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\Microsoft.CSharp.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\mscorlib.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\PresentationCore.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\PresentationFramework.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Core.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Data.DataSetExtensions.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Data.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Xaml.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Xml.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Xml.Linq.dll" /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\WindowsBase.dll" /debug:pdbonly /filealign:512 /nowin32manifest /optimize+ /out:obj\Release\WpfApplication1.exe /subsystemversion:6.00 /resource:obj\Release\WpfApplication1.g.resources /resource:obj\Release\WpfApplication1.Properties.Resources.resources /target:winexe /utf8output App.xaml.cs MainWindow.xaml.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs C:\WpfApplication1\WpfApplication1\obj\Release\MainWindow.g.cs C:\WpfApplication1\WpfApplication1\obj\Release\App.g.cs "C:\Users\kieuducgiang\AppData\Local\Temp.NETFramework,Version=v4.5.AssemblyAttributes.cs" obj\Release\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs obj\Release\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs obj\Release\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs 1>AfterCompile: 1> Create empty koi file 1> CALL REM #143 TYPE NUL>C:\WpfApplication1\WpfApplication1\bin\Release\koi 1> CALL REM #143 TYPE NUL>C:\WpfApplication1\WpfApplication1\obj\Release\koi 1> CALL REM #143 TYPE NUL>C:\WpfApplication1\WpfApplication1\bin\Debug\koi 1> CALL REM #143 TYPE NUL>C:\WpfApplication1\WpfApplication1\obj\Debug\koi 1> Running obfuscator... 1> C:\WpfApplication1\ConfuserEx_bin\Confuser.CLI.exe C:\WpfApplication1\Confuser.crproj 1> [INFO] ConfuserEx v0.5.0 Copyright (C) Ki 2014 1> [INFO] Running on Microsoft Windows NT 6.1.7601 Service Pack 1, .NET Framework v4.0.30319.34209, 32 bits 1> [DEBUG] Discovering plugins... 1> [INFO] Discovered 10 protections, 1 packers. 1> [DEBUG] Resolving component dependency... 1> [INFO] Loading input modules... 1> [INFO] Loading 'WpfApplication1.exe'... 1> [INFO] Initializing... 1> [DEBUG] Building pipeline... 1> [INFO] Resolving dependencies... 1> [DEBUG] Checking Strong Name... 1> [DEBUG] Creating global .cctors... 1> [DEBUG] Watermarking... 1> [DEBUG] Executing 'Name analysis' phase... 1> [DEBUG] Building VTables & identifier list... 1> [DEBUG] Analyzing... 1> [DEBUG] WPF found, enabling compatibility. 1> [WARN] Could not find resource type '????????????????????????????????????????'. 1> [INFO] Processing module 'WpfApplication1.exe'... 1> [DEBUG] Executing 'Invalid metadata addition' phase... 1> [DEBUG] Executing 'Renaming' phase... 1> [DEBUG] Renaming... 1> [DEBUG] Executing 'Anti-debug injection' phase... 1> [DEBUG] Executing 'Anti-dump injection' phase... 1> [DEBUG] Executing 'Anti-ILDasm marking' phase... 1> [DEBUG] Executing 'Encoding reference proxies' phase... 1> [DEBUG] Executing 'Constant encryption helpers injection' phase... 1> [DEBUG] Executing 'Resource encryption helpers injection' phase... 1> [DEBUG] Executing 'Constants encoding' phase... 1> [DEBUG] Executing 'Anti-tamper helpers injection' phase... 1> [DEBUG] Executing 'Control flow mangling' phase... 1> [DEBUG] Executing 'Post-renaming' phase... 1> [DEBUG] Executing 'Anti-tamper metadata preparation' phase... 1> [DEBUG] Executing 'Packer info extraction' phase... 1> [INFO] Writing module 'koi'... 1> [DEBUG] Encrypting resources... 1> [INFO] Finalizing... 1> [INFO] Packing... 1> [DEBUG] Encrypting modules... 1> [INFO] Protecting packer stub... 1> [DEBUG] Discovering plugins... 1> [INFO] Discovered 11 protections, 1 packers. 1> [DEBUG] Resolving component dependency... 1> [INFO] Loading input modules... 1> [INFO] Loading 'WpfApplication1.exe'... 1> [INFO] Initializing... 1> [DEBUG] Building pipeline... 1> [DEBUG] Executing 'Module injection' phase... 1> [INFO] Resolving dependencies... 1> [DEBUG] Checking Strong Name... 1> [DEBUG] Creating global .cctors... 1> [DEBUG] Watermarking... 1> [DEBUG] Executing 'Name analysis' phase... 1> [DEBUG] Building VTables & identifier list... 1> [DEBUG] Analyzing... 1> [DEBUG] WPF found, enabling compatibility. 1> [WARN] Could not find resource type '????????????????????????????????????????'. 1> [INFO] Processing module 'WpfApplication1.exe'... 1> [DEBUG] Executing 'Packer info encoding' phase... 1> [DEBUG] Executing 'Invalid metadata addition' phase... 1> [DEBUG] Executing 'Renaming' phase... 1> [DEBUG] Renaming... 1> [DEBUG] Executing 'Anti-debug injection' phase... 1> [DEBUG] Executing 'Anti-dump injection' phase... 1> [DEBUG] Executing 'Anti-ILDasm marking' phase... 1> [DEBUG] Executing 'Encoding reference proxies' phase... 1> [DEBUG] Executing 'Constant encryption helpers injection' phase... 1> [DEBUG] Executing 'Resource encryption helpers injection' phase... 1> [DEBUG] Executing 'Constants encoding' phase... 1> [DEBUG] Executing 'Anti-tamper helpers injection' phase... 1> [DEBUG] Executing 'Control flow mangling' phase... 1> [DEBUG] Executing 'Post-renaming' phase... 1> [DEBUG] Executing 'Anti-tamper metadata preparation' phase... 1> [DEBUG] Executing 'Packer info extraction' phase... 1> [INFO] Writing module 'WpfApplication1.exe'... 1> [INFO] Finalizing... 1> [DEBUG] Saving to 'C:\Users\kieuducgiang\AppData\Local\Temp\yya0qmq5.2go\ejp42a4t.xrm\WpfApplication1.exe'... 1> [DEBUG] Executing 'Export symbol map' phase... 1> [INFO] Finish protecting packer stub. 1> [DEBUG] Saving to 'C:\WpfApplication1\WpfApplication1\obj\Release\WpfApplication1.exe'... 1> [DEBUG] Executing 'Export symbol map' phase... 1> [INFO] Done. 1> Finished at 10:58 AM, 0:01 elapsed. 1> Obfuscator ok xxx 1>CleanPublishFolder: 1> Removing directory "bin\Release\app.publish\". 1>_DeploymentComputeClickOnceManifestInfo: 1> Creating directory "bin\Release\app.publish". 1> Copying file from "obj\Release\WpfApplication1.exe" to "bin\Release\app.publish\WpfApplication1.exe". 1>_CopyAppConfigFile: 1>Skipping target "_CopyAppConfigFile" because all output files are up-to-date with respect to the input files. 1>_CopyManifestFiles: 1> Copying file from "obj\Release\WpfApplication1.exe.manifest" to "bin\Release\WpfApplication1.exe.manifest". 1> WpfApplication1 -> C:\WpfApplication1\WpfApplication1\bin\Release\WpfApplication1.exe.manifest 1> Copying file from "obj\Release\WpfApplication1.application" to "bin\Release\WpfApplication1.application". 1> WpfApplication1 -> C:\WpfApplication1\WpfApplication1\bin\Release\WpfApplication1.application 1>CopyFilesToOutputDirectory: 1> Copying file from "obj\Release\WpfApplication1.exe" to "bin\Release\WpfApplication1.exe". 1> WpfApplication1 -> C:\WpfApplication1\WpfApplication1\bin\Release\WpfApplication1.exe 1> Copying file from "obj\Release\WpfApplication1.pdb" to "bin\Release\WpfApplication1.pdb". 1> 1>Build succeeded. 1> 1>Time Elapsed 00:00:01.69 Building WpfApplication1... 2>------ Publish started: Project: WpfApplication1, Configuration: Release Any CPU ------ 2>Build started 03/10/2015 10:58:23 AM. 2>_CopyFilesToPublishFolder: 2> Creating directory "bin\Release\app.publish\Application Files\WpfApplication1_1_0_0_46". 2> Copying file from "bin\Release\WpfApplication1.exe.manifest" to "bin\Release\app.publish\Application Files\WpfApplication1_1_0_0_46\WpfApplication1.exe.manifest". 2> Copying file from "bin\Release\app.publish\WpfApplication1.exe" to "bin\Release\app.publish\Application Files\WpfApplication1_1_0_0_46\WpfApplication1.exe.deploy". 2> Copying file from "App.config" to "bin\Release\app.publish\Application Files\WpfApplication1_1_0_0_46\WpfApplication1.exe.config.deploy". 2> 2>Build succeeded. 2> 2>Time Elapsed 00:00:00.40 Connecting to 'C:\WpfApplication1\WpfApplication1\publish\'... Publishing files... Publish success. C:\WpfApplication1\WpfApplication1\publish\ ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== ========== Publish: 1 succeeded, 0 failed, 0 skipped ==========
Error Details when click to Setup.exe:
PLATFORM VERSION INFO Windows : 6.1.7601.65536 (Win32NT) Common Language Runtime : 4.0.30319.34209 System.Deployment.dll : 4.0.30319.34244 built by: FX452RTMGDR clr.dll : 4.0.30319.34209 built by: FX452RTMGDR dfdll.dll : 4.0.30319.34244 built by: FX452RTMGDR dfshim.dll : 4.0.41209.0 (Main.041209-0000)
SOURCES Deployment url : file:///C:/WpfApplication1/WpfApplication1/publish/WpfApplication1.application Application url : file:///C:/WpfApplication1/WpfApplication1/publish/Application%20Files/WpfApplication1_1_0_0_46/WpfApplication1.exe.manifest
IDENTITIES Deployment Identity : WpfApplication1.application, Version=1.0.0.46, Culture=neutral, PublicKeyToken=3d1ba243a16857eb, processorArchitecture=msil Application Identity : WpfApplication1.exe, Version=1.0.0.46, Culture=neutral, PublicKeyToken=3d1ba243a16857eb, processorArchitecture=msil, type=win32
APPLICATION SUMMARY * Installable application. * Trust url parameter is set. ERROR SUMMARY Below is a summary of the errors, details of these errors are listed later in the log. * Activation of C:\WpfApplication1\WpfApplication1\publish\WpfApplication1.application resulted in exception. Following failure messages were detected:
COMPONENT STORE TRANSACTION FAILURE SUMMARY No transaction error was detected.
WARNINGS There were no warnings during this operation.
OPERATION PROGRESS STATUS * [03/10/2015 10:58:53 AM] : Activation of C:\WpfApplication1\WpfApplication1\publish\WpfApplication1.application has started. * [03/10/2015 10:58:53 AM] : Processing of deployment manifest has successfully completed. * [03/10/2015 10:58:53 AM] : Installation of the application has started. * [03/10/2015 10:58:53 AM] : Processing of application manifest has successfully completed. * [03/10/2015 10:59:44 AM] : Found compatible runtime version 4.0.30319. * [03/10/2015 10:59:44 AM] : Request of trust and detection of platform is complete.
ERROR DETAILS Following errors were detected during this operation. * [03/10/2015 10:59:44 AM] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
COMPONENT STORE TRANSACTION DETAILS No transaction information is available.