问题描述
我正在使用Inno设置程序为游戏创建和安装程序,我想提示用户并询问他们是否要安装DirectX9(我已经在子文件夹中拥有完整的安装DirectX文件),然后为他们安装它如果他们说是或否...我不确定该怎么做,并且编程知识有限.请帮忙!
I am creating and installer for a game using Inno setup and I want to prompt the user and ask them if they want to install DirectX9 (I already have the full installation directx files in a subfolder) and then to install it for them if they say yes or no... I am not sure how to do this and have limited programming knowledge. Please help!
推荐答案
使用此代码显示带有问题和是/否"按钮的消息框:
Use this code to show message box with question and Yes/No buttons:
// Ask the user a Yes/No question
if MsgBox('Are you sure?', mbConfirmation, MB_YESNO) = IDYES then
begin
// User clicked Yes
// Install the DirectX now... (see below)
end;
然后执行(启动)DXSETUP.exe的这段代码
And this code to execute (launch) DXSETUP.exe
var
ResultCode: Integer;
// Launch DXSETUP and wait for it to terminate
Exec('DXSETUP.exe', '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
我认为您需要将DirectX文件打包到安装程序中,并将其解压缩到{tmp}目录-否则您可以从CD/DVD中运行它(例如).
I think you need to pack your DirectX files into your installer and extract it to {tmp} directory - or you may run it from CD/DVD (as in example).
有关高级DXSETUP的信息,请参见以下问题:如何安装可从以下位置重新分发的DirectX创新设置?
See this question for advanced DXSETUP: How to install DirectX redistributable from Inno-setup?
如果您需要检测DX版本,请检查以下内容: http://www.vincenzo.net/isxkb/index.php?title=DirectX_-__How_to_detect_DirectX_version
If you need to detect DX version check this: http://www.vincenzo.net/isxkb/index.php?title=DirectX_-_How_to_detect_DirectX_version
这篇关于提示在Inno安装程序中安装DirectX的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!