I want my Inno Setup Script to search for my setup's .TMP file which usually creates in currently logged user's Local Application Data folder and give user a message box saying "Your Setup's Temporary Source seems to be created successfully."
I wrote a code to do so:
if CurPageID = wpLicence then begin
if FileExists((ExpandConstant('{localappdata}\Temp\is-*****.tmp\MySetup.tmp'))) then begin
MsgBox('Your Setup''s Temporary Source seems to be created successfully.', mbInformation, MB_OK);
MsgBox('It is located in: <<I WANT TO GET THE FOUND FILE''S FULL PATH HERE>>', mbWarning, MB_OK);
end;
end;
But, even my setup's temporary file (MySetup.tmp)
exists when the setup starts, I'm not getting those message boxes.
What is the problem in this code?
Is the is-*****
ignored when searching?
UPDATED QUESTION
I mean The Temporary Directory shown in below image. It contains the internal Temporary File of the Setup Wizard. This is usually named like {#SetupName}.tmp
...... Not the other Temporary Directory which Inno Setup extracts Files of the Setup. such as
ISSKin.dll
or any externally used files.
Any help would be greatly appreciated.
The FileExists
function does not support wildcards, not even in a file name, let alone in a name of a parent folder.
See How to test using wildcards whether a file exists in Inno Setup.
Though in your case, just use the ParamStr(0)
.
FileExists(ParamStr(0))