Hi All,
Please use the reference from the below custom action I have created for checking the PostgreSQL version on your machine.
function CheckPostgresSQLVersion(hMSI)
STRING ProcessName, szLine, Text,svReturnLine;
NUMBER nvFileHandle, ExitCode,nvResult,nvLineNumber,nLoc;
begin
ProcessName = "CheckPostgresSQLVersion";
OpenFileMode (FILE_MODE_APPEND);
if (CreateFile (nvFileHandle, SUPPORTDIR, "PostgresSQLVersion.bat") = 0) then
szLine = "psql --version";
WriteLine(nvFileHandle, szLine);
endif;
// Close the file.
CloseFile (nvFileHandle);
ExitCode = RunApplication(hMSI, SUPPORTDIR^"PostgresSQLVersion.bat", " >PostgresSQLVersion.txt", "");
if (ExitCode = 0) then
GetFullErrorText(hMSI, 60, SUPPORTDIR, "PostgresSQLVersion.txt", Text);
nvResult = FileGrep (SUPPORTDIR ^ "PostgresSQLVersion.txt", "psql (PostgreSQL)", svReturnLine,nvLineNumber, RESTART);
if(nvResult = 0) then
nLoc = StrFind(svReturnLine,"9.1");
if(nLoc<0 p="" then=""> MsiSetProperty(hMSI, "INVALID_POSTGRESQL_VERSION", "1");
MessageBox("Invalid version of PostgreSQL",SEVERE);
else
MsiSetProperty(hMSI, "INVALID_POSTGRESQL_VERSION", "0");
endif;
endif;
endif;
DeleteFile(SUPPORTDIR^"PostgresSQLVersion.bat");
end;0>
Please use the reference from the below custom action I have created for checking the PostgreSQL version on your machine.
function CheckPostgresSQLVersion(hMSI)
STRING ProcessName, szLine, Text,svReturnLine;
NUMBER nvFileHandle, ExitCode,nvResult,nvLineNumber,nLoc;
begin
ProcessName = "CheckPostgresSQLVersion";
OpenFileMode (FILE_MODE_APPEND);
if (CreateFile (nvFileHandle, SUPPORTDIR, "PostgresSQLVersion.bat") = 0) then
szLine = "psql --version";
WriteLine(nvFileHandle, szLine);
endif;
// Close the file.
CloseFile (nvFileHandle);
ExitCode = RunApplication(hMSI, SUPPORTDIR^"PostgresSQLVersion.bat", " >PostgresSQLVersion.txt", "");
if (ExitCode = 0) then
GetFullErrorText(hMSI, 60, SUPPORTDIR, "PostgresSQLVersion.txt", Text);
nvResult = FileGrep (SUPPORTDIR ^ "PostgresSQLVersion.txt", "psql (PostgreSQL)", svReturnLine,nvLineNumber, RESTART);
if(nvResult = 0) then
nLoc = StrFind(svReturnLine,"9.1");
if(nLoc<0 p="" then=""> MsiSetProperty(hMSI, "INVALID_POSTGRESQL_VERSION", "1");
MessageBox("Invalid version of PostgreSQL",SEVERE);
else
MsiSetProperty(hMSI, "INVALID_POSTGRESQL_VERSION", "0");
endif;
endif;
endif;
DeleteFile(SUPPORTDIR^"PostgresSQLVersion.bat");
end;0>
How do we estimate the time while executing the Postgres Map script during installation? the Map script dump file contains around 4.25 GB size. Can we show any progress bar?
ReplyDeleteI am using Installscript project version 2014. Quick answer is really helpful.