哪些winform项目文件应打包到安装程序中 [英] Which winform project files should be packed up into the installer

查看:83
本文介绍了哪些winform项目文件应打包到安装程序中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过 Inno Setup 打包Winform项目. .但是除了主要的可执行文件,它还必须指定其他必需的文件,并且项目文件夹中有很多文件.

I want to packed up my winform project by Inno Setup. But in addition to the main executable, it must specify the other required files and there are many files in the project folder.

那么需要哪些文件? .cs脚本重要吗?还是只是/bin/release/中的文件?

So which files is required? Does .cs scripts important? Or just the files in /bin/release/?

推荐答案

总体 :我喜欢

Overall: I like Tom Blodget's advice here to find dependencies and runtimes. Below are some detailed, technical options to determine what is going on with problem applications. Assembled in a hurry.

清洁虚拟 :显然采用 部署要求.

Clean Virtual: And obviously take Lex Li's advice (above comment to your question) to set up your application manually on a clean virtual for QA and testing and to determine deployment requirements in an "iterative fashion".

检查列表 :仅作记录:

Check-List: And just for the record: a general-purpose check-list for application launch problems (that somebody downvoted for some reason, let me know what errors you find in there maybe? I am a deployment specialist not a coder - it is more of an "ideas" list than a true checklist).

更新- 2018年9月:

调试二进制文件-启动序列调试 :您可以在应用程序启动序列和整合中尽早插入一个消息框 将调试二进制文件放入您的设置中,进行安装,然后附加 在启动时调试到应用程序消息框的调试器 通过启动代码? (设置断点). 现在,只要您的EXE完全脱离地面,您就可以调试.

Debug Binaries - Launch Sequence Debugging: You could insert a message box early in your application launch sequence and slipstream the debug binaries into your setup, install it, and then attach the debugger to the application's message box on launch in order to step through the launch code? (set a breakpoint). Now you can debug, provided your EXE gets off the ground at all.

  • Maybe check this nice Advanced Installer Video Tutorial for this "attach debugger approach". It shows the same approach for custom action code. The procedure is the same for launching applications. Just attach to message box and set breakpoints.

注意:很明显,请记住在知道问题所在后重新编译发行版二进制文件,然后重新测试启动.除错 二进制文件不可重新分发-它们仅绑定到调试dll 由MS SDK安装.普通PC将不会(通常)具有这些 调试dll.

Note: Obviously remember to recompile with the release binaries once you know what the problem is - and retest launching. Debug binaries are not redistributable - they bind to debug dlls only installed by the MS SDK. Normal PCs will not (normally) have these debug dlls.


Visual Studio模块视图 :我看到它建议在 Visual Studio 中以调试模式运行.交互式运行项目: Debug => Start Debugging ,然后转到: Debug => Windows => Modules ,以获取已加载的内容列表以供应用程序运行.坦率地说,我不确定这是否为您提供所有类型的依赖项.如 Dependency Walker帮助文件中所述,可以有很多不同的类型.我试图在此问题上挑动汉斯·帕桑特的大脑:-) ,但可能太详细了.


Visual Studio Modules View: I have seen it recommended to run in debug mode in Visual Studio. Run project interactively: Debug => Start Debugging, and then go: Debug => Windows => Modules in order to get a list of what has been loaded for the application to run. I am not sure, frankly, if this gives you all types of dependencies. There can be many different types as explained here in the Dependency Walker help file. I tried to pick the brain of our Hans Passant on the issue :-), but it is probably too detailed to go into.

Dependency Walker :这是旧的Windows SDK工具.到目前为止,它已经过时了-我认为自上次更新以来已有10多年的历史了.它是依靠的旧战马,但是对于较新的二进制文件却效果不佳.它确实支持 WinSxS依赖项(并排win32程序集) API集.

Dependency Walker: This is an old Windows SDK tool. It is very outdated by now - over 10 years since the last update I think. It was the old warhorse to rely upon, but does not work great for newer binaries. It does not support WinSxS dependencies (side-by-side win32 assemblies) or API-Sets.

  • 我仍然使用它来提醒自己"模块搜索顺序 ".打开工具后:Options => Configure Module Search Order.... Windows会按照这样的搜索顺序查找文件/模块-并且在不同的OS版本之间存在差异.
  • 它当然已经过时了,但这至少提醒我们如何在Windows中扫描文件夹-每个Windows版本都不相同-尤其是清单文件.
  • I still use it to remind myself of the "module search order". With the tool open: Options => Configure Module Search Order.... Windows locates files / modules in a search order like that - and with differences between different OS versions.
  • It is certainly outdated, but it is at least a reminder of how folders are scanned in Windows - and every Windows version is different - especially with manifests.

dumpbin : Windows SDK(在安装了Visual Studio的系统上的 %ProgramFiles(x86)% 下搜索).这是一个命令行工具.对于受虐狂:-).老实说,我不知道它是否对最新的二进制文件提供适当的支持,但它似乎得到了维护(与Dependency Walker不同).

dumpbin: Another old work-horse from the Windows SDK (search under %ProgramFiles(x86)% on a system with Visual Studio installed). This is a command line tool. For masochists :-). I honestly do not know if it features proper support for the newest binaries, but it appears maintained (unlike Dependency Walker).

ProcMon (Sysinternals):这是人们解决硬依赖性问题时所使用的工具. 快速建模样本.真正的交易-无论幕后实际发生什么,都可以使用望远镜.我对它的使用不是专家,但是查看想法的输出总是很有启发性的.缺少COM服务器注册等...

ProcMon (Sysinternals): This is the tool that people swear by when it comes to solving the hard dependency issues. Quick mock-up sample. The real deal - a spyglass for whatever is really happening under the hood. I am not expert at its use, but it is always enlightening to look at the output for ideas. Missing COM server registration etc...

ProcessExplorer (Sysinternals):请检查该答案.

ProcessExplorer (Sysinternals): Please check this answer.

Fuslogvw.exe :是否

Fuslogvw.exe: Does Fuslogvw.exe tell you anything? (.NET assembly binding failures).

.NET .NET程序集的探测(CLR如何定位程序集).

.NET Probing (How the CLR Locates Assemblies) for .NET assemblies.

Dependencies.exe :也许您也可以尝试 Dependency Walker (上面提到的那个旧SDK工具)的新的开源重写部分在C#中完成:" Dependencies.exe ".该工具尚未完成,并且没有Dependency Walker的所有功能(我看不到exe文件的任何性能分析功能),但是它支持作者迅速回来解释.建议您在开始使用该应用程序之前先删除peview.exe.

Dependencies.exe: Maybe you can also try this new, open source rewrite of Dependency Walker (that old SDK tool mentioned above) partially done in C#: "Dependencies.exe". This tool is quite unfinished and doesn't feature all functionality from Dependency Walker (I can't see any profiling features for exe files), but it has support for API-sets and WinSxS dependencies - or side-by-side Win32 assemblies (which is missing from Dependency Walker). I haven't tested it enough to really recommend it - but it is open source and hence inspectable. I have contacted the author about an issue where the bundled peview.exe is identified as malware. The author quickly came back to explain. Recommend you just delete peview.exe before starting to use the application.

NDepend (维基百科):恐怕我不会使用该工具,但是

NDepend (wikipedia): A tool I am afraid I don't use, but please check this answer (do check).

部署工具 :除了Inno设置外,各种部署工具 (列表视图,核心工具).

某些链接 :

Some Links:

  • MSVCR100D.DLL and dependency walker
  • EXE file is not working
  • After creating MSI Installer for WPF app in Visual Studio 2017, EXE does nothing
  • Registering a CPP dll into COM after installation using Wix Msi installer
  • C# Debug folder when copied to another location does not run the exe
  • How exactly does the WiX 'Service Install' work internally?
  • wix service install not enough permission
  • How to check for DLL dependency?

.NET

  • How the Runtime Locates Assemblies
  • .Net Assembly Probing : Simple Assembly
  • Redirecting Assembly Versions
  • Assembly Searching Sequence

这篇关于哪些winform项目文件应打包到安装程序中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆