This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- AddProfString() not working correctly
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Nov 17, 2010
11:19 AM
AddProfString() not working correctly
I’m in the process of updating an installer that was authored with InstallShield 2009 to InstallShield 2011. It’s a Basic MSI project, and it uses InstallScript custom actions.
One of those actions manipulates a .INI file (sql.ini in this case). I am using WriteProfString() to create the initial entries, then using AddProfString() to add in duplicate keys.
The WriteProfString works fine, but AddProfString deletes any other key/value pairs for the section.
Is this a known bug? Is there a workaround?
Here is a code excerpt showing what I am doing:
-----------------------------------------------
svSvrName=”MYSERVER”;
DestFileName = svDir ^ "Sybase\\ini\\sql.ini";
svRgatesIPA=”10.1.1.1”;
svInistr = "TCP," + svRgatesIPA + ",4350";
WriteProfString (DestFileName, svSvrName, "query", svInistr);
WriteProfString (DestFileName, svSvrName, "master", svInistr);
svInistr1 = "TCP,127.0.0.1,4350";
AddProfString (DestFileName, svSvrName, "query", svInistr1) ;
AddProfString (DestFileName, svSvrName, "master", svInistr1);
-------------------------------------------------
When this runs, I should have a section with four entries:
[MYSERVER]
query=TCP,10.1.1.1,4350
master=TCP,10.1.11,4350
query=TCP,127.0.0.1,4350
master=TCP,127.0.0.1,4350
What I actually get is:
[MYSERVER]
query=TCP,10.1.1.1,4350
I’m doing my development on a Vista machine, and the installation is being done on a Server 2003 box.
Jon Spelbring
CSC Corp.
618-632-9252 x450
j.spelbring@tricorind.com
jspelbring@csc.com
One of those actions manipulates a .INI file (sql.ini in this case). I am using WriteProfString() to create the initial entries, then using AddProfString() to add in duplicate keys.
The WriteProfString works fine, but AddProfString deletes any other key/value pairs for the section.
Is this a known bug? Is there a workaround?
Here is a code excerpt showing what I am doing:
-----------------------------------------------
svSvrName=”MYSERVER”;
DestFileName = svDir ^ "Sybase\\ini\\sql.ini";
svRgatesIPA=”10.1.1.1”;
svInistr = "TCP," + svRgatesIPA + ",4350";
WriteProfString (DestFileName, svSvrName, "query", svInistr);
WriteProfString (DestFileName, svSvrName, "master", svInistr);
svInistr1 = "TCP,127.0.0.1,4350";
AddProfString (DestFileName, svSvrName, "query", svInistr1) ;
AddProfString (DestFileName, svSvrName, "master", svInistr1);
-------------------------------------------------
When this runs, I should have a section with four entries:
[MYSERVER]
query=TCP,10.1.1.1,4350
master=TCP,10.1.11,4350
query=TCP,127.0.0.1,4350
master=TCP,127.0.0.1,4350
What I actually get is:
[MYSERVER]
query=TCP,10.1.1.1,4350
I’m doing my development on a Vista machine, and the installation is being done on a Server 2003 box.
Jon Spelbring
CSC Corp.
618-632-9252 x450
j.spelbring@tricorind.com
jspelbring@csc.com
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Nov 18, 2010
08:15 AM
The solution was to apply Hotfix A to InstallShield 2011. The AddProfString now works correctly.