[英]Inno Setup creating an unwanted empty folder with value in DefaultDirName
即使我在CurStepChanged (curStep = ssInstall)
设置了WizardForm.DirEdit.Text = 'c:\\preferredinstalldir'
,Inno Setup安装程序也会使用DefaultDirName
初始值创建一个不需要的空文件夹。 安装程序会将文件放在正确的安装文件夹中,但是由于我必须将一个虚拟值分配给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,但是没有得到回答,因此我无法发表评论。
我想我已经找到了解决方案,设置CreateAppDir = no似乎可以解决问题,至少它不再在初始的虚拟位置创建空文件夹。
我无法复制您的描述。
在CurStepChanged(ssInstall)
更改WizardForm.DirEdit.Text
完全无效。 太晚了。
无论如何,请尽快更改该值。 例如在InitializeWizard
或CurPageChanged
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.