Inno Setup (How to get dynamically path to file)?

Janck7

I'm making a setup script in Inno and I was wondering, how can I get non "hardcoded" path. Here is example:

Image, which contains patch source

Thanks in advance!

SOLUTION:

You can get .iss folder by using predefined variable

SourcePath

Usage would be like: {#SourcePath}\???\bin\x86\Release\???.exe

Thanks all who contributed!

TLama

The reference about the source directory says (emphasized by me):

By default, the Setup Compiler expects to find files referenced in the script's [Files] section Source parameters, and files referenced in the [Setup] section, under the same directory the script file is located if they do not contain fully qualified pathnames. To specify a different source directory, create a SourceDir directive in the script's [Setup] section.

This includes also option to specify relative path to the files. So let's assume that you have the following file structure and you didn't specify a different path in the SourceDir directive:

C:\Deploy\Script.iss
C:\Deploy\MyProg.exe
C:\Deploy\SubFolder\MyOtherProg.exe
C:\Folder\SomeFile.txt

Now if you'd like to include the MyProg.exe into the setup compiled from the Script.iss script, you could specify just the file name without the path, since the MyProg.exe file is stored in the same folder as the script, so you could write just:

[Files]
Source: "MyProg.exe"; DestDir: "{app}"

And you can use a relative path to the MyOtherProg.exe which is stored in the subfolder of the folder where the Script.iss script is stored this way:

[Files]
Source: "SubFolder\MyOtherProg.exe"; DestDir: "{app}"

As well as you can use a relative path to include the SomeFile.txt stored in a subfolder of the parent folder where the script is stored:

[Files]
Source: "..\Folder\SomeFile.txt"; DestDir: "{app}"

More about relative path conventions you can read in this chapter.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to get file path dynamically?

From Dev

Inno Setup - Get a path to parent folder

From Dev

Inno setup: how to replace a string in XML file?

From Dev

Inno Setup Compiler: How to modify file content

From Dev

How to call the GetNativeSystemInfo at Inno Setup iss file?

From Dev

How to get the full computer name in Inno Setup

From Dev

Install external file from subdirectory (relative path) using Inno Setup

From Dev

Install external file from subdirectory (relative path) using Inno Setup

From Dev

How to get versions of files (exe's and dll's) which are included to inno setup installer exe file?

From Dev

Inno Setup User Home Path

From Dev

Inno Setup : How to change language file depending on code

From Java

How to catch the error message of bat file for deleting files in Inno Setup?

From Dev

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

From Dev

How can I reference a custom icon for a file association in Inno Setup?

From Dev

How can I reference a custom icon for a file association in Inno Setup?

From Dev

How to provide an input to a batch file ran using Inno Setup installer?

From Dev

How to load an RTF file content into Inno Setup TNewMemo?

From Dev

Inno Setup: How can I get the Exception Code of a raised Exception?

From Dev

How can i get Inno setup uninstaller script to remove a service

From Dev

How can i get Inno setup uninstaller script to remove a service

From Dev

Replace a text in a file with Inno Setup

From Dev

Writing binary file in Inno Setup

From Dev

Writing binary file in Inno Setup

From Dev

How to get file path?

From Dev

Inno Setup: Verify that {app} path contains no spaces

From Dev

Inno Setup - How to edit a specific line from a text file during setup?

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

Related Related

  1. 1

    How to get file path dynamically?

  2. 2

    Inno Setup - Get a path to parent folder

  3. 3

    Inno setup: how to replace a string in XML file?

  4. 4

    Inno Setup Compiler: How to modify file content

  5. 5

    How to call the GetNativeSystemInfo at Inno Setup iss file?

  6. 6

    How to get the full computer name in Inno Setup

  7. 7

    Install external file from subdirectory (relative path) using Inno Setup

  8. 8

    Install external file from subdirectory (relative path) using Inno Setup

  9. 9

    How to get versions of files (exe's and dll's) which are included to inno setup installer exe file?

  10. 10

    Inno Setup User Home Path

  11. 11

    Inno Setup : How to change language file depending on code

  12. 12

    How to catch the error message of bat file for deleting files in Inno Setup?

  13. 13

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

  14. 14

    How can I reference a custom icon for a file association in Inno Setup?

  15. 15

    How can I reference a custom icon for a file association in Inno Setup?

  16. 16

    How to provide an input to a batch file ran using Inno Setup installer?

  17. 17

    How to load an RTF file content into Inno Setup TNewMemo?

  18. 18

    Inno Setup: How can I get the Exception Code of a raised Exception?

  19. 19

    How can i get Inno setup uninstaller script to remove a service

  20. 20

    How can i get Inno setup uninstaller script to remove a service

  21. 21

    Replace a text in a file with Inno Setup

  22. 22

    Writing binary file in Inno Setup

  23. 23

    Writing binary file in Inno Setup

  24. 24

    How to get file path?

  25. 25

    Inno Setup: Verify that {app} path contains no spaces

  26. 26

    Inno Setup - How to edit a specific line from a text file during setup?

  27. 27

    How to override functions in Inno Setup?

  28. 28

    How to split a string in Inno Setup

  29. 29

    how to refresh a page in inno setup

HotTag

Archive