Have not tested yet, but this should work?
Code:
#define AC3Registry
...
#ifdef AC3Registry
function GetAppName(Param: string): string;
begin
Result:=FmtMessage(ExpandConstant('{cm:AppName}'),[chr(39)]) ;
end;
#else
function GetAppName(Default:String):String;
begin
if not (GetIniString('Messages', 'ApplicationName', '', ExpandConstant('{tmp}\' + ActLang + '.txt')) = '') and (GetValStr('InstallOptions', 'ApplicationName' + ActLangShort, '') = '') then
Result := GetIniString('Messages', 'ApplicationName', '', ExpandConstant('{tmp}\' + ActLang + '.txt'))
else
Result:=GetValStr('InstallOptions', 'ApplicationName' + ActLangShort, GetOrigAppName(''))
end;
#endif
Will test it further on weekend. But i am sure i have forgot something important.
And a question: Can i use #ifdef for this on [CustomMessages] too? If yes, it is neccessary at all?
Edit: Ok, it seems to work. I have just switched #define to ON. But as i said, will test it with registry.iss on weekend.
Edit 2: Here is the full code i am using for the fast test
Code:
#define AC3Registry
Code:
[CustomMessages]
#ifdef AC3Registry
eng.AppName=Assassin%1s Creed(R) III
#endif
Code:
#ifdef AC3Registry
function GetAppName(Param: string): string;
begin
Result:=FmtMessage(ExpandConstant('{cm:AppName}'),[chr(39)]) ;
end;
#else
function GetAppName(Default:String):String;
begin
if not (GetIniString('Messages', 'ApplicationName', '', ExpandConstant('{tmp}\' + ActLang + '.txt')) = '') and (GetValStr('InstallOptions', 'ApplicationName' + ActLangShort, '') = '') then
Result := GetIniString('Messages', 'ApplicationName', '', ExpandConstant('{tmp}\' + ActLang + '.txt'))
else
Result:=GetValStr('InstallOptions', 'ApplicationName' + ActLangShort, GetOrigAppName(''))
end;
#endif