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

查看:35
本文介绍了安装程序应该打包哪些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/?

推荐答案

总体:我喜欢 Tom Blodget 在这里的建议查找依赖项和运行时.下面是一些详细的技术选项,用于确定问题应用程序的情况.匆忙组装.

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:显然采用 Lex Li 的建议(以上对您的问题的评论)在一个干净的虚拟机上手动设置您的应用程序 <强>质量保证和测试,并以迭代方式"确定部署要求.

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 完全启动.

  • 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 =>开始调试,然后去:Debug =>窗户 =>模块 以获得已加载的应用程序运行列表.坦率地说,我不确定这是否会为您提供所有类型的依赖项.如Dependency Walker 帮助文件中所述,可以有许多不同的类型.我试图在这个问题上选择我们 Hans Passant 的大脑:-),但可能太详细了.


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 =>配置模块搜索顺序....Windows 以这样的搜索顺序定位文件/模块 - 并且不同操作系统版本之间存在差异.
  • 它当然已经过时了,但它至少提醒人们如何在 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 告诉你什么?(.NET 程序集绑定失败).

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 文件的任何分析功能),但它支持 API-setsWinSxS 依赖项 - 或并排 Win32 程序集(Dependency Walker 中没有).我还没有对它进行足够的测试来真正推荐它——但它是开源的,因此是可以检查的.我已就捆绑的 peview.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(wikipedia):我不使用的工具,但是请检查这个答案(做检查).

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

部署工具:除 Inno setup 之外的各种部署工具(列表视图,核心工具只有).

一些链接:

.NET

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

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