Inno安装程序安装程序正在使用我的初始值DefaultDirName
创建一个不需要的空文件夹,即使我在WizardForm.DirEdit.Text = 'c:\preferredinstalldir'
中设置了CurStepChanged (curStep = ssInstall)
。安装程序将文件放在正确的安装文件夹中,但由于我必须为DefaultDirName
分配一个虚拟值,因此它会创建该虚拟文件夹。我已经尝试为{code:xx}
使用DefaultDirName
函数,但由于我想要的实际文件夹在向导运行之前尚未确定,我似乎需要一个占位符文件夹(但我不想要它)创建!)
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 但没有回答,我无法发表评论。
答案 0 :(得分:1)
我想我已经找到了解决方案,设置CreateAppDir = no似乎没有做到这一点。至少它不再在初始虚拟位置创建一个空文件夹。
答案 1 :(得分:-1)
我无法重现你所描述的内容。
更改WizardForm.DirEdit.Text
中的CurStepChanged(ssInstall)
完全没有效果。已经太晚了。
无论如何,只需更快地更改价值。例如,在InitializeWizard
或CurPageChanged
。