How to test if FileExists in folder where Inno Setup is running?

Andy Groom

How can I determine whether a certain file exists in the same location where Setup.exe is running from?

i.e. something like this:

if (FileExists(App.Path + '\config_file*.txt') = True) then

Note: I don't want to know the folder into which the application is being installed, I want to know the folder from which Setup.exe is running (eg. "C:\Documents and Settings\Jennifer Cox") - in Visual Basic
For example the equivalent of App.Path.

TLama

To get the path from where the setup was executed you need to extract it from the {srcexe} constant. To extract the path from a file you can use the ExtractFilePath function so putting this together you can get something like this:

var
  S: string;
begin
  S := AddBackslash(ExtractFilePath(ExpandConstant('{srcexe}'))) + 'File.txt');
  if FileExists(S) then
    ...
end;

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Inno Setup FileExists unable to find existing file

From Dev

Inno Setup FileExists unable to find existing file

From Dev

How to delete a nonempty folder in inno setup

From Dev

Inno Setup - How to set permissions of installation folder

From Dev

How to disable OK button in "Browse For Folder" dialog in Inno Setup

From Dev

How to test using wildcards whether a file exists in Inno Setup

From Dev

Where is Inno Setup uninstaller executable?

From Dev

Inno Setup: How to let Folder.CopyHere finish copying before moving to the next folder?

From Dev

Inno Setup: pack folder with all subfolders

From Dev

Inno Setup: Delete folder with Task function

From Dev

Inno Setup - Get a path to parent folder

From Dev

Creating shortcut in startup folder using Inno setup

From Dev

Inno Setup shortcuts for folder are not opening in Windows 10

From Dev

Inno Setup: change the setup language while setup is running

From Dev

Inno Setup: change the setup language while setup is running

From Dev

Inno Setup Pascal Script to search for running process

From Dev

Running netsh from using Inno Setup Exec()

From Dev

How to override functions in Inno Setup?

From Dev

How to split a string in Inno Setup

From Dev

how to refresh a page in inno setup

From Dev

How to extract a Inno Setup Installer

From Dev

Inno setup - how to change version in the setup hover?

From Dev

How to force NOT running the program after silently installing existing Inno Setup package

From Dev

Inno Setup : Detect if the Setup is running when trying to Uninstall

From Dev

How to access the folder where the .exe is running Wix bootstrapper?

From Dev

How to access the folder where the .exe is running Wix bootstrapper?

From Dev

Inno Setup: Get 'Don't create a start menu folder' option

From Dev

Inno Setup CreateInputDirPage but don't check for folder existence

From Dev

Empty game folder stays after uninstallation - Inno Setup

Related Related

  1. 1

    Inno Setup FileExists unable to find existing file

  2. 2

    Inno Setup FileExists unable to find existing file

  3. 3

    How to delete a nonempty folder in inno setup

  4. 4

    Inno Setup - How to set permissions of installation folder

  5. 5

    How to disable OK button in "Browse For Folder" dialog in Inno Setup

  6. 6

    How to test using wildcards whether a file exists in Inno Setup

  7. 7

    Where is Inno Setup uninstaller executable?

  8. 8

    Inno Setup: How to let Folder.CopyHere finish copying before moving to the next folder?

  9. 9

    Inno Setup: pack folder with all subfolders

  10. 10

    Inno Setup: Delete folder with Task function

  11. 11

    Inno Setup - Get a path to parent folder

  12. 12

    Creating shortcut in startup folder using Inno setup

  13. 13

    Inno Setup shortcuts for folder are not opening in Windows 10

  14. 14

    Inno Setup: change the setup language while setup is running

  15. 15

    Inno Setup: change the setup language while setup is running

  16. 16

    Inno Setup Pascal Script to search for running process

  17. 17

    Running netsh from using Inno Setup Exec()

  18. 18

    How to override functions in Inno Setup?

  19. 19

    How to split a string in Inno Setup

  20. 20

    how to refresh a page in inno setup

  21. 21

    How to extract a Inno Setup Installer

  22. 22

    Inno setup - how to change version in the setup hover?

  23. 23

    How to force NOT running the program after silently installing existing Inno Setup package

  24. 24

    Inno Setup : Detect if the Setup is running when trying to Uninstall

  25. 25

    How to access the folder where the .exe is running Wix bootstrapper?

  26. 26

    How to access the folder where the .exe is running Wix bootstrapper?

  27. 27

    Inno Setup: Get 'Don't create a start menu folder' option

  28. 28

    Inno Setup CreateInputDirPage but don't check for folder existence

  29. 29

    Empty game folder stays after uninstallation - Inno Setup

HotTag

Archive