面向 Windows 的设置以部署一个文件

发布于 2024-10-28 01:08:57 字数 492 浏览 2 评论 0原文

我想构建一个设置或类似的东西(1 个文件),以将单个文件传递到目标系统。应用程序的插件,可安装到用户的 AppData 文件夹中。

经过一番研究后,我仍然不确定该往哪个方向看。我可以使用 Visual Studio 2010 创建安装项目,但到目前为止所有选项似乎都太繁重或存在一些缺陷。

SetupProject 顽固地想要创建一个我不需要的应用程序文件夹,并抱怨安装到用户文件夹。 Cab 似乎不提供自动安装,oneclick 不适用于该项目,等等。

我可以使用更简单的设置技术吗?

要求:

  • 安装->将 1 个文件复制到文件夹 在 %userprofile%\3rdpartyapp\ 下,如果 它存在(xcopy)。
  • 卸载->删除该文件并同时删除 具有自定义设置的一个文件夹 (rmdir \s)。
  • 分布->免费用于商业用途 使用。

也许我应该将文件打包在自解压的 c++ exe 中?

I would like to build a setup, or something like that (1 file), to deliver a single file to a target system. Plugin for an application, installable to users AppData folder.

After some research I'm still not sure in which direction to look. I can create the setup project with Visual Studio 2010, but all of the options so far seem to be way too heavy or have some flaws.

SetupProject stubbornly wants to create an application folder which I don't need, and complains about installation to user folder. Cab doesn't seem to offer automatic install, oneclick is not available for the project, etc.

Is there an easier setup technology I could use?

Requirements:

  • Install -> Copy 1 file to a folder
    under %userprofile%\3rdpartyapp\ if
    it exists (xcopy).
  • Uninstall -> Delete the file and also
    one folder with custom settings
    (rmdir \s).
  • Distribution -> Free for commercial
    use.

Maybe I should just pack the file in self extracting c++ exe?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

二货你真萌 2024-11-04 01:08:57

对于一个文件来说可能有点大材小用,但我喜欢 InnoSetup 来创建安装包。检查一下,看看它是否适合您。它非常易于使用和部署。

It may be overkill for one file, but I like InnoSetup for creating setup packages. Check it out, and see if it suits you. It is very easy to use and deploy.

懵少女 2024-11-04 01:08:57

看看WiX 工具集。它允许创建基于 MSI 的安装程序,并且安装程序可能非常简单:

  1. 搜索 %userprofile%\3rdpartyapp;
  2. 将文件复制到其中(如果存在);
  3. 如果不存在,则安装失败或可能创建它。

卸载非常简单:需要删除已安装的文件。要删除 3rdpartyapp 的子文件夹,您可以使用 RemoveFolderEx 元素。

MSI 使用“添加/删除程序”控制面板注册已安装的应用程序。卸载由 Windows Installer 服务处理,因此您无需复制任何其他文件或程序来支持卸载。

Take a look at WiX toolset. It allows creating MSI-based installers, and the installer could be quite simple:

  1. Search for %userprofile%\3rdpartyapp;
  2. Copy the file into it, if it exists;
  3. Fail install or maybe create it, if it does not exist.

Uninstall would be very simple: it would need to remove the installed file. To remove a subfolder of 3rdpartyapp, you can use RemoveFolderEx element.

MSI registers the installed app with Add/Remove Programs Control panel. Uninstall is handled by Windows Installer service, therefore you don't need to copy any additional files or programs to support uninstall.

北城挽邺 2024-11-04 01:08:57

我认为任何设置技术对于一个文件来说都太重了。我将创建一个简单的应用程序,从其资源流中提取文件并将其复制到 %userprofile%\3rdpartyapp 中。

卸载比较棘手:应该有一些东西可以处理卸载过程。它可以是存储在用户配置文件中某处的批处理或脚本(js、vbs)文件、另一个简单应用程序或同一个应用程序。 (安装过程也可以通过脚本来处理。)

I think any setup technology is too heavy for one file. I'd go with creating a simple application that would extract the file from its resources stream and copy it into %userprofile%\3rdpartyapp.

Uninstall is trickier: there should be something that can handle the uninstall process. It could be a batch or script (js, vbs) file stored somewhere in user's profile, another simple application or the same one. (Installation process can also be handled with a script.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文