简体   繁体   English

如何为游戏等制作自定义安装程序?

[英]How to make a custom installer for games, etc?

Can anyone tell me how to create a custom installer to 'install' games. 谁能告诉我如何创建自定义安装程序来“安装”游戏。 I say custom meaning I don't want the user to have the option where the game is installed. 我说的是自定义含义,我不希望用户选择安装游戏的位置。 I want it to be a straight forward process, maybe with just one loading bar. 我希望它是一个简单的过程,也许只有一个加载栏。

The program I'm developing is a 'center' for game playing, which includes a community and other features, such as a timer that records how long a game is played for. 我正在开发的程序是玩游戏的“中心”,其中包括社区和其他功能,例如记录游戏玩了多长时间的计时器。 I just thought that installing each game in one place, with a simple installer would make the program easier to use. 我只是认为,使用一个简单的安装程序将一个游戏安装在一个地方将使该程序更易于使用。 It also will allow me to do other features as the games will all be installed in one place. 它还将允许我执行其他功能,因为所有游戏都将安装在一个地方。 No need for the user to specify where the game is installed. 用户无需指定游戏的安装位置。
Would this be possible? 这可能吗?

I'm presuming your game is developed in C#, rather than requiring the installer be written in C#? 我假设您的游戏是用C#开发的,而不是要求安装程序是用C#编写的?

If that's the case, there are plenty of options available to you for installer packages. 在这种情况下,安装程序包可以使用很多选项。 Probably the most customisable option, whilst still being free, is Nullsoft Install System . Nullsoft Install System可能是最可定制的选项,尽管它仍然是免费的。 The installers are built around some basic scripting activities, and can be as simple or complex as you desire - the installation, and the wiki have plenty of example scripts that you can explore and experiment with. 安装程序是围绕一些基本的脚本编写活动构建的,并且可以根据您的需要进行简单或复杂的安装-安装,并且Wiki包含大量示例脚本,您可以进行探索和试验。


OT: Install Location OT:安装位置
Personally, I'd consider it bad practice to disallow the user from selecting their own install location and, in fact, it gets me pretty frustrated when anything but system-file installations (eg drivers) stop me from choosing a directory. 就个人而言,我认为禁止用户选择自己的安装位置是一种不道德的做法,实际上,当除系统文件安装(例如驱动程序)之外的任何其他操作都阻止我选择目录时,这让我非常沮丧。 Many users will choose to locate certain types of installation and data on a non-default device (eg virtually all of my games are housed on a separate drive to my main Windows installation). 许多用户会选择在非默认设备上定位某些类型的安装和数据(例如,实际上,我的所有游戏都安装在与我的主要Windows安装不同的驱动器上)。 If you need to remember the installation location so badly, create a registry key for it. 如果您非常需要记住安装位置,请为其创建一个注册表项。

您可以使用的另一个系统称为Inno Setup- http: //www.jrsoftware.org/isinfo.php

If the games already exist your best option would be to call the MSI installers in administrative mode (see documentation for MSIExec). 如果游戏已经存在,最好的选择是在管理模式下调用MSI安装程序(请参阅MSIExec文档)。 Then you could actually 那你就可以

  • Set a predetermined location for the games 设置游戏的预定位置
  • Remove any UI and replace that with your custom installer UI 删除任何用户界面,并用您的自定义安装程序用户界面替换

Obviously that would only work if the installs are really MSI modules (with some more work also for installers that have MSIs packed into EXE setups). 显然,这仅在安装真正是MSI模块的情况下才有效(对于将MSI打包到EXE安装程序中的安装程序,还有更多工作要做)。 That is true for most, but likely not all games. 对于大多数游戏(但并非所有游戏)都是如此。

Please note that this would be a sizable task and to be honest I cannot see any value in doing what you are planning. 请注意,这将是一项艰巨的任务,老实说,在执行您的计划时,我看不到任何价值。 But thats up to you. 但这取决于您。

As start you would have to read into the MSI documentation. 首先,您必须阅读MSI文档。 I'd recommend WIX (Windows Installer XML) for the beginning. 我一开始建议使用WIX(Windows Installer XML)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM