0

Simple question I hope,

I would like to install my app, into "C:\program files\MyApp v1.0.0.1"

The name is always the same but the last part "v1.0.0.1" will change each release.

I can just hard code the whole folder name, it works, but for sure I will for get to update this line one day.

Can I not "&" the "AppVersion" to the string for "DefaultDirName"

I found this: [Inno Setup setup file name append AppVersion

and tried:

AppVersion=1.4.0.0
AppPublisher=ABC
AppPublisherURL=""
DefaultDirName={pf}MyApp + ("AppVersion")

It comppiles, but when I run it, it gives an error message somthing like ...?!/. etc can not be in the file name...

Any ideas, seems simple, I just don't know how to do it :-( Thanks Ross

Ross
  • 300
  • 1
  • 8

1 Answers1

1

Try this

#define MyAppVersion "1.0.0.1"

[setup]
AppVersion={#MyAppVersion}
DefaultDirName={pf}\{#MyAppName} v{#MyAppVersion}
CAD Developer
  • 1,532
  • 2
  • 21
  • 27
  • Nailed it! Thanks Ross – Ross Apr 24 '20 at 11:05
  • But if you do not change `AppId` as well, when upgrading, the new version will go to the same folder as the old version. – Martin Prikryl Apr 24 '20 at 12:32
  • thanks for this comment. My AppId is a GUID, it seems to be ok in creating the next folder (pf/MyApp 1.1, pf/MyApp 1.2) etc, but uninstalling it via Add/Removes programs seems to only have one entry, is there a methods to auto gen a fresh GUID? . – Ross Apr 27 '20 at 16:43