My question is the the continuation of Inno Setup - "Variant is null, cannot invoke" error while reading node value in XML file. In this post, I am reading an XML file node and successfully able to take the value using the procedure ProcGetWebAppNameFromXML
and I am trying to pass the value to the [Icons]
section, but I am getting empty.
The code snippet is mentioned below.
[Run]
Filename: "{app}\test1.bat"; StatusMsg: "Running Services..."; \
BeforeInstall: ProcGetWebAppNameFromXML;
[Icons]
Name: "{commondesktop}\App"; Filename: "{pf}\Internet Explorer\iexplore.exe"; \
Parameters: """http://{code:GetWebAppNameFromXML|}/"""
The procedure ProcGetWebAppNameFromXML
gets the webapp name (works completely fine) and I am assigning it to a global variable.
[Code]
var
WebAppNameFromXML: String;
procedure ProcGetWebAppNameFromXML();
var
...
...
WebAppNameFromXML := LoadValueFromXML(applicationxmlFile, '//ns:application-name', 'application-name');
Log('WebApp name is logged correctly here..' + WebAppNameFromXML);
end;
I am using the below mentioned function to assign the value.
function GetWebAppNameFromXML(Default: String): String;
begin
Result := WebAppNameFromXML;
end;
When I pass the function GetWebAppNameFromXML
to the Icons
section I am getting empty. Please note that I have [Icons]
below the [Run]
section and I have used ChangesAssociations=yes
too.
Thanks in advance.