I have installer made in Inno Setup. It works perfectly fine. But every time it finishes installing my application, I see next entry in event log:
Faulting application name: installer.tmp, version: 51.1052.0.0, time stamp: 0x4d81e0ff
Faulting module name: msxml3.dll, version: 8.110.9600.18046, time stamp: 0x55e72d43
Exception code: 0xc0000005
Fault offset: 0x00099ba1
Faulting process id: 0x4020
Faulting application start time: 0x01d151dd82e2baf9
Faulting application path: C:\Users\VALENT~1\AppData\Local\Temp\is-NDCPA.tmp\installer.tmp
Faulting module path: C:\Windows\System32\msxml3.dll
Report Id: d80ffece-bdd0-11e5-82a0-bc5ff4d35ede
Faulting package full name:
Faulting package-relative application ID:
Exploring this problem in google leads me only to problems ppl have with different applications (mostly Internet Explorer).
Can anybody at least point me in right direction, so i can get a rid of this error in log?
Update After several days of investigation (full script is quite huge), I've came to conclusion, that exception is caused by next code
XMLDoc := CreateOleObject('MSXML2.DOMDocument');
RootNode := XMLDoc.createElement('SQLServerSettings');
RootNode := XMLDoc.appendChild(RootNode);
Node := XMLDoc.createElement('SQLServerLocation');
Node.text := SQLServerLocation;
RootNode.appendChild(Node);
Exception is thrown if last appendChild
method is called. Now at least it makes some sense (since exception is thrown for msxml3.dll).
It does not depend on name of element or its content. If I refactor it as
Node := RootNode.appendChild(XMLDoc.createElement('SQLServerInstanceName'));
it will still throw exception in log.
Any ideas, what could cause that? Or any other way I can try to create XML file inside of Inno Setup script?
I can reproduce your problem.
Though, I do not get the error, if I explicitly ask for version 6.0 of the MSXML2.DOMDocument
:
XMLDoc := CreateOleObject('MSXML2.DOMDocument.6.0');
When you use a version-independent ProgID (MSXML2.DOMDocument
), version 3.0 is allegedly used. The version 3.0 seems to suffer the problem you are facing, and it's probably fixed in the 6.0.
If you need to support Windows XP, you can fallback to the 3.0:
try
XMLDoc := CreateOleObject('MSXML2.DOMDocument.6.0');
except
XMLDoc := CreateOleObject('MSXML2.DOMDocument');
end;
If that does not help, as a poor workaround, you can just write the XML file as a string. It's easy, if you are creating a new XML file (as opposite to editing an existing XML file).
XML :=
'<SQLServerSettings><SQLServerLocation>' +
SQLServerLocation +
'</SQLServerLocation></SQLServerSettings>';
SaveStringToFile(FileName, XML, False);
Note that the SaveStringToFile
does not support Unicode strings.