12

Do you know the right method to get the installer path in Inno Setup?

I want to catch that value inside the [Code] section.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Kawaii-Hachii
  • 1,017
  • 7
  • 22
  • 36

2 Answers2

25

{srcexe} will give you the path and filename of the setup.
{src} will give you just the installer path.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
mirtheil
  • 8,952
  • 1
  • 30
  • 29
19

You should use the {srcexe} constant. In Pascal scripting, you can obtain the values of constants using the ExpandConstant function, as in

path := ExpandConstant('{srcexe}');
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Andreas Rejbrand
  • 105,602
  • 8
  • 282
  • 384