Inno Setup installer is creating an unwanted empty folder using my initial value of DefaultDirName
, even though I have set WizardForm.DirEdit.Text = 'c:\preferredinstalldir'
in CurStepChanged (curStep = ssInstall)
. The installer puts the files in the right installation folder, but because I have to assign a dummy value to DefaultDirName
, it creates that dummy folder. I have tried using a {code:xx}
function for the DefaultDirName
but since the actually folder I want hasn't been determined until the wizard runs, I seem to need a placeholder folder (but I don't want it created!)
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;
I've seen this question here Inno Script: Strange Empty Folder but it wasn't answered and I couldn't post a comment.