【发布时间】:2015-09-29 13:07:00
【问题描述】:
Inno Setup 安装程序正在使用我的初始值 DefaultDirName 创建一个不需要的空文件夹,即使我在 CurStepChanged (curStep = ssInstall) 中设置了 WizardForm.DirEdit.Text = 'c:\preferredinstalldir'。安装程序将文件放在正确的安装文件夹中,但因为我必须为DefaultDirName 分配一个虚拟值,所以它会创建那个虚拟文件夹。我已经尝试对DefaultDirName 使用{code:xx} 函数,但由于在向导运行之前我想要的实际文件夹尚未确定,我似乎需要一个占位符文件夹(但我不想创建它!)
AppId = {code:GetAppId}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppCopyright={#MyAppCopyright}
VersionInfoCopyright={#MyAppCopyright}
AppSupportURL={#MyAppURL} AppUpdatesURL={#MyAppURL}
DefaultDirName={code:GetFilesDestDir} //this says error path not valid, no root/unc etc etc because the function has no path set yet
DefaultDirName=c:\mydummyfolder //this creates a dummy folder even though the files are installed correctly to location i set later in CurStepChanged (I assign WizardForm.DirEdit.Text := InstallPath )
DisableDirPage=yes
DefaultGroupName=SomeName
DisableProgramGroupPage=yes
OutputBaseFilename=mysetup_setup
Compression=lzma
SolidCompression=yes
UsePreviousAppDir=no
UsePreviousLanguage=no
UninstallFilesDir = {code:GetFilesDestDir}\uninst
.............
function GetFilesDestDir(def:string): string;
begin
if InstallPathSet then
begin
Result := InstallPath;
end
end;
我在这里看到了这个问题 Inno Script: Strange Empty Folder 但没有得到答复,我无法发表评论。
【问题讨论】:
标签: installation inno-setup setup-project pascalscript