Menu

#11 Add support for InnoSetup 'Constants'

IS/ISX_Integration
open
None
5
2015-01-08
2013-06-12
No

It should be great to add support in InnoSetup Preprocessor for the same InnoSetup Constants:
. Directory Constants ({sys}, {syswow64}, {pf32}, {pf64}, {cf32}, {cf64}, {fonts}, {dao}, ...)
. Shell Folder Constants ({group}, {localappdata}, ...)
. the 'Other Constants' ({computername}, {param:ParamName|DefaultValue}, {sysuserinfoname}, {sysuserinfoorg}, {username}, ...)

Using the same Prototype as InnoSetup:
str ExpandConstant(str)

So, it will be easier and cleaner to do such things (ugly atm):

#define SystemPaths 6
#dim SystemPathConstants[SystemPaths]
#dim SystemPathValues[SystemPaths]
#define SystemPathConstants[0] "{win}"
#define SystemPathValues[0]    GetEnv("windir")
#define SystemPathConstants[1] "{sys}"
#define SystemPathValues[1]    GetEnv("windir") + "\system32"
#define SystemPathConstants[2] "{syswow64}"
#define SystemPathConstants[3] "{pf}"
#define SystemPathConstants[4] "{cf}"
#define SystemPathConstants[5] "{commonappdata}"
#ifdef WinXP
  #define SystemPathValues[2]  SystemPathValues[1]
  #define SystemPathValues[3]  GetEnv("ProgramFiles")
  #define SystemPathValues[4]  GetEnv("CommonProgramFiles")
  #define SystemPathValues[5]  ""
#endif
#ifdef Win7
  #define SystemPathValues[2]  GetEnv("windir") + "\SysWOW64"
  #define SystemPathValues[3]  GetEnv("ProgramFiles(x86)")
  #define SystemPathValues[4]  GetEnv("CommonProgramFiles(x86)")
  #define SystemPathValues[5]  GetEnv("ProgramData")
#endif

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.