View Single Post
  #3  
Old 20-05-2022, 00:39
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 1,074
Thanks: 1,814
Thanked 2,304 Times in 787 Posts
Cesar82 is on a distinguished road
Quote:
Originally Posted by L33THAK0R View Post
What'd be the best solution for being able to use a custom directory constant for a component file? I'm interested in looking into using something like the "{sd}" constant for a given component entry.

I know such functionality is supported for specifying the path of an ".ini" file under [INISettings], but I'm not too sure how to implement it.

I believe this is the section of the script I should be looking at, with the highlighted text being the value that I THINK indicates the working directory for where the file should be.

Code:
            ComponentFile := ExpandConstant('{src}\' + GetIniString('ComponentsSettings', 'Component' + IntToStr(CompIndexList[I]) + '.File', '', ExpandConstant('{tmp}\Settings.ini')));
            if (ISDoneError = False) and FileExists(ComponentFile) then
              if not ISArcExtract(0, 0, ComponentFile, ExpandConstant('{app}'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}'), false) then
                ISDoneError := True;
I thought about using "{#.File}" or "{#File}", (as seen when used for "{#INIFile}") but this doesn't seem to be a valid solution, would anyone be able to suggest a method that I can look into?
This is an old version of ASIS and I don't even remember anymore, but I think you can use any constant supported by Inno Setup, but all components will be redirected to new constant.
P.S: The current version you configure directly in the Records.ini file for each component.
Reply With Quote