Inno Setup文档中有一个代码示例(请参阅"Pascal脚本","支持函数参考","对话框函数" - 您可以从这里开始):
var
FileName: string;
begin
// Set the initial filename
FileName := '';
if GetOpenFileName('', FileName, '',
'Text Documents (*.txt)|*.txt|All Files|*.*', 'txt') then
begin
// Successful; user clicked OK
// Filename contains the selected filename
end;
end;
Run Code Online (Sandbox Code Playgroud)