Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 2

XML File Change & Error -2004

Hello everyone,

First of all, I should say that I'm new with Installshield (using 2010 Pro Edition) and if this question has been already answer, please indicate me were I can find the solution. Thanks 🙂

I've a lot of trouble to use the XML File change feature with my package.

The idea is to request 2 values (hostname & port number) to the user during the setup (using SdShowDlgEdit2). Then when copying the files installshield should modify the xml file included into the package with the values entered by the user.

In the script I've the following code in the function OnFirstUIBefore(), between Dlg_ObjDialogs & Dlg_SdStartCopy2 where I've added my own label with the following code:

szTitle = Client Configuration";
szMsg = "The following parameters will be used to configure the connection details of the client on this computer.";
szField1 = "Server:";
szField2 = "Port:";
svServerAddress = "localhost";
svPortNumber = "8086";

nResult = SdShowDlgEdit2 (szTitle, szMsg , szField1 , szField2 ,svServerAddress, svPortNumber);
if (nResult = BACK) goto Dlg_ObjDialogs;
TextSubSetValue("",svServerAddress , TRUE);
TextSubSetValue("",svPortNumber , TRUE);

My XML file that I'm trying to change is a .net config file (MyApplication.exe.config).

The thing is that I've been able to make this package working on my computer but every now and then the following error message appears:

"Unexpected error updating XML files. Error: -2004"

Furthermore, I've the same issue on other computer.... and I do not find why and more important how to correct this.

The most weird thing is that I've been able to make it worked once without any problem. And believe me when I said that I've not changed anything (I know all users said that :rolleyes:)

I've no anti-virus, I've the latest .Net framework.... I even install MSXML 6.0 Sp1 as a prerequisite but no luck!

Any suggestions or idea, because right now I'm having a sort supply of imagination...

Thanks in advance
Labels (1)
0 Kudos
3 Replies
Level 2

Sorry guys, but am I the only one getting this issue ? :confused:
0 Kudos
Level 2

Please check the path of XML file change.
This error happened in 64 bit environment when working with 32 bit install script.
0 Kudos
Level 2

Hi querton,
This bug occurs when I install program and click on "Cancel" button (The installation was not completed).
Some .xml files which you attached into your project was created when you installed. When you install again -> error -2004
Solution: Go to your setup location and delete your set up file, reinstall.
0 Kudos