簡體   English   中英

Inno Setup使用DefaultDirName中的值創建一個不需要的空文件夾

[英]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完全無效。 太晚了。


無論如何,請盡快更改該值。 例如在InitializeWizardCurPageChanged

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM