In some tests, we can write de ini files, but the other sections disappears or the ini files is copied but the setup can't write the changes in the opportune sections.
Any suggestion?
Thank in Advance.
Posted 27 February 2001 - 09:38
In some tests, we can write de ini files, but the other sections disappears or the ini files is copied but the setup can't write the changes in the opportune sections.
Any suggestion?
Thank in Advance.
Posted 28 February 2001 - 18:52
///////////////////////////////////////////////////////////////////////////////
//
// Function: _SetXXXiniTarget
//
// Purpose: Replace xxx.ini <YOUR_MACRO_NAME> macro
// with real targetdir if xxxxxxxxxxxxxx.
//
///////////////////////////////////////////////////////////////////////////////
function _SetXXXiniTarget(hInstall)
SHORT shResult;
LONG lvSize;
STRING szReferenceFile;
STRING szFileName;
STRING szSectionName;
STRING szKeyName;
STRING szOrigValue;
STRING szReplaceValue;
STRING svValue;
STRING svInstalledFilePath;
begin
// We're in the Execute sequence, and globals don't carry over
// from the User Interface sequence.
lvSize = MAX_STRING_SIZE;
MsiGetProperty(hInstall, "_MY_PRODUCT_INFO", svValue, lvSize);
if (lvSize > 0) then
gbIsSomeInfo = TRUE;
endif;
lvSize = MAX_STRING_SIZE;
MsiGetProperty(hInstall, "_MORE_PRODUCT_INFO", svValue, lvSize);
if (lvSize > 0) then
gbIsSomeMoreInfo = TRUE;
endif;
// Replace macro with real targetdir in xxx.ini if gbIsSomeInfo is true.
if ( gbIsSomeInfo = TRUE) then
if (FindFile( WINDIR, @_YOUR_INI_FILE, szFileName) = 0) then
szSectionName = @_YOUR_SECTION_NAME;
szKeyName = @_YOUR_KEY_NAME;
szOrigValue = @_TARGETDIR_MACRO + "\\\\" + @_YOUR_KEY_VALUE;
szReplaceValue = TARGETDIR ^ @_SUBFOLDER_NAME ^ @_YOUR_KEY_VALUE;
ReplaceProfString (szFileName, szSectionName, szKeyName, szOrigValue, szReplaceValue);
endif;
endif;
end;
Posted 06 March 2001 - 11:00
I have tried using the MsiGetProperty functions, but my function doesn't work:
If i put the function before Execute Action , as you suggested, i got a 2762 error, if i put before WriteIniValues, it seem my function never called.
The condictions are: NOT Installed AND NOT PATCH
The function is following:
///////////////////////////////////////////////////////////////////////////////
function SetupINIfile(hInstall)
STRING svIpAddress;
STRING svIpPort;
STRING szMsg;
STRING szTitle;
STRING svClientName;
STRING svOldIpAddress;
STRING svOldClientName;
string svBuf;
NUMBER nvType;
NUMBER nvByte;
NUMBER nResult;
LONG lSize;
begin
lSize = 2048;
MsiGetProperty(hInstall, "InstallPath", svBuf, lSize);
TARGETDIR = svBuf;
nResult = RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
// ask host
nResult = GetProfString(TARGETDIR ^ "invision.ini" ,
"InVision" ,
"Servers" ,
svOldIpAddress);
nResult = GetProfString (TARGETDIR ^ "invision.ini" ,
"REQUESTER" ,
"MACHINE_NAME" ,
svOldClientName );
svIpAddress = "127.0.0.1";
svIpPort = "6717";
szTitle = "RapiAgent Service Setup";
szMsg = "RapiAgent Service Configuration
";
szMsg = szMsg + "Insert the IP address of RBS8 Server to listen";
nResult = SdShowDlgEdit2 ( szTitle,
szMsg ,
"RBS8 Server IP Address" ,
"Port",
svIpAddress,
svIpPort );
nResult = ReplaceProfString ( TARGETDIR ^ "invision.ini" ,
"InVision" ,
"Servers" ,
svOldIpAddress,
"T:" + svIpAddress + ":"+ svIpPort );
svClientName = svOldClientName;
szMsg = "Please insert a unique name for this RapiAgent client.
";
szMsg = szMsg + "This name must be unique for the server RBS8.
We use as default the Computer Name";
nResult = SdShowDlgEdit1 ( szTitle,
szMsg,
"RapiAgent Client Name",
svClientName );
nResult = ReplaceProfString ( TARGETDIR ^ "invision.ini",
"REQUESTER",
"MACHINE_NAME",
svOldClientName,
svClientName );
nResult = ReplaceProfString ( TARGETDIR ^ "invision.ini",
"CP_NETBIOS",
"NODENAME",
svOldClientName,
svClientName );
return 0;
end;
Where is wrong?
TIA
Posted 08 March 2001 - 21:31
Posted 03 April 2001 - 15:28
Thanks you for yoyr suggestion.
Sorry for delay, but I 'm very busy.