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
- :
- Re: Is it possible to list oracle users in the Installshield window?
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
‎Apr 22, 2010
02:27 AM
Is it possible to list oracle users in the Installshield window?
Hi all,
We are using MSI project to execute SQL Scripts in the Oracle DB.
We would like to list the active users in the Installshield window itself before initiating the actual installation.
I guess that we need to use a custom action similar to the SQL server display list of databases. But would it work for the list of users?
Any pointer or help is highly appreciated.
Best Regards
Singaravelan
We are using MSI project to execute SQL Scripts in the Oracle DB.
We would like to list the active users in the Installshield window itself before initiating the actual installation.
I guess that we need to use a custom action similar to the SQL server display list of databases. But would it work for the list of users?
Any pointer or help is highly appreciated.
Best Regards
Singaravelan
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 22, 2010
05:36 AM
You can use the below query for getting list of database from a particular user this is what I done for my requirement.
select count(*) from pg_database where datdba in(select usesysid from pg_user where usename='astuser') and lower(datname) like '%_backup';
select replace(replace(replace(datname,'_Backup',''), 'CONFY_V_','ConFY V ') ,'_','.')as datname from pg_database where datdba in(select usesysid from pg_user where usename='astuser') and lower(datname) like '%_backup';
You need to run this with LaunchAppndwait command from installshield
before that create a batch file to run this query.
You can display the list in combo box in installshield window.
Hope this may help you.
select count(*) from pg_database where datdba in(select usesysid from pg_user where usename='astuser') and lower(datname) like '%_backup';
select replace(replace(replace(datname,'_Backup',''), 'CONFY_V_','ConFY V ') ,'_','.')as datname from pg_database where datdba in(select usesysid from pg_user where usename='astuser') and lower(datname) like '%_backup';
You need to run this with LaunchAppndwait command from installshield
before that create a batch file to run this query.
You can display the list in combo box in installshield window.
Hope this may help you.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 22, 2010
07:09 AM
Thanks very much Azad for your reply and the query.
However I have the following problems.
I need to show the list of users during the Installshield User Interface stage itself and not during the execution.
Moreover I need to pass the SQL DB and Parameters, which we capture in the installshield interface to the Launchappandwait program.
Assuming this is fine (am starting to work on your suggestion), how do we map it to the Installshield interface to show the list of users as you mentioned in the combo?
Best Regards,
Velan
However I have the following problems.
I need to show the list of users during the Installshield User Interface stage itself and not during the execution.
Moreover I need to pass the SQL DB and Parameters, which we capture in the installshield interface to the Launchappandwait program.
Assuming this is fine (am starting to work on your suggestion), how do we map it to the Installshield interface to show the list of users as you mentioned in the combo?
Best Regards,
Velan
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 22, 2010
07:30 AM
For displaying list in Combo Box u need to add a diaogue, Add u need to add the property of that Combo Box in property manager.
Below is the code which I did for my project.
function ListDataBase(hMSI)
string Sample ,svLine,DatabaseFolder, svline, svString,Parameter ;
string folder,copydbfile, migdbsqlfile,migdbbatfile,dbtextfilepath,TempDelete, copydbtextfile, copydbfilepath, svValue,Visible ;//dbbatfilepath
NUMBER nvfileHandle, ListID, ComboBox;
NUMBER nvFileHandle, Count , order , hDatabase, hView, Count_DataBase, dCount;
LIST listID; HWND hRec;
begin
Count =1 ;
//nCount = 1;
order = 1;
dCount = 1 ;
listID = ListCreate (STRINGLIST);
Parameter=Arguments;
LaunchAppAndWait(ChangeUser,Parameter,WAIT|LAAW_OPTION_HIDDEN);
LaunchAppAndWait (BatchFilePath_0, Parameter,WAIT|LAAW_OPTION_HIDDEN);
DatabaseFolder= TempFolder^PRODUCT_GUID;//+"\\PostgresScripts_1.cmd"
OpenFileMode (FILE_MODE_APPEND);
OpenFile(nvFileHandle,DatabaseFolder,"ListDataBase.txt") ;
while (Count <= 3)
GetLine (nvFileHandle,svline);
Count = Count + 1;
endwhile;
StrToNum ( Count_DataBase, svline );
if(Count_DataBase=0)then
MsiSetProperty(hMSI,"BackupAvailable","False");
MsiSetProperty(hMSI,"IS_SQL_DATABASE","Install New Database");
else
Count_DataBase = Count_DataBase+3 ;
Count =1;
while (Count<=Count_DataBase)
GetLine (nvFileHandle, svLine);
ListAddString (listID, svLine, AFTER);
hRec = MsiCreateRecord(4);
MsiRecordSetString(hRec, 1, "IS_SQL_DATABASE"); // Column1: Property tied to the entry
MsiRecordSetInteger(hRec, 2, order); // Column2: Display order of the item
MsiRecordSetString(hRec, 3, "Install New Database");//.Name); //Column3: Value to set property to
MsiRecordSetString(hRec, 4,"Install New Database");//.Name);
listID = MsiViewModify(hView, MSIMODIFY_INSERT_TEMPORARY, hRec);
listID = MsiCloseHandle(hRec);
MsiSetProperty(0,"IS_SQL_DATABASE","Install New Database");
if (Count >= 4 ) then
order = order + 1;
hRec = MsiCreateRecord(4);
MsiRecordSetString(hRec, 1, "IS_SQL_DATABASE"); // Column1: Property tied to the entry
MsiRecordSetInteger(hRec, 2, order); // Column2: Display order of the item
MsiRecordSetString(hRec, 3, svLine);//.Name); //Column3: Value to set property to
MsiRecordSetString(hRec, 4, svLine);//.Name); //Column4: Display text for item
listID = MsiViewModify(hView, MSIMODIFY_INSERT_TEMPORARY, hRec);
listID = MsiCloseHandle(hRec);
endif ;
listID = MsiDatabaseOpenView(hDatabase, "SELECT * FROM ComboBox WHERE Property='IS_SQL_DATABASE'", hView);
listID = MsiViewExecute(hView,NULL);
Count = Count+1;
endwhile;
CloseFile (nvFileHandle);
ListDestroy (listID);
MsiSetProperty(hMSI,"BackupAvailable","True");
endif;
end ;
Hope this may give to some help...
Below is the code which I did for my project.
function ListDataBase(hMSI)
string Sample ,svLine,DatabaseFolder, svline, svString,Parameter ;
string folder,copydbfile, migdbsqlfile,migdbbatfile,dbtextfilepath,TempDelete, copydbtextfile, copydbfilepath, svValue,Visible ;//dbbatfilepath
NUMBER nvfileHandle, ListID, ComboBox;
NUMBER nvFileHandle, Count , order , hDatabase, hView, Count_DataBase, dCount;
LIST listID; HWND hRec;
begin
Count =1 ;
//nCount = 1;
order = 1;
dCount = 1 ;
listID = ListCreate (STRINGLIST);
Parameter=Arguments;
LaunchAppAndWait(ChangeUser,Parameter,WAIT|LAAW_OPTION_HIDDEN);
LaunchAppAndWait (BatchFilePath_0, Parameter,WAIT|LAAW_OPTION_HIDDEN);
DatabaseFolder= TempFolder^PRODUCT_GUID;//+"\\PostgresScripts_1.cmd"
OpenFileMode (FILE_MODE_APPEND);
OpenFile(nvFileHandle,DatabaseFolder,"ListDataBase.txt") ;
while (Count <= 3)
GetLine (nvFileHandle,svline);
Count = Count + 1;
endwhile;
StrToNum ( Count_DataBase, svline );
if(Count_DataBase=0)then
MsiSetProperty(hMSI,"BackupAvailable","False");
MsiSetProperty(hMSI,"IS_SQL_DATABASE","Install New Database");
else
Count_DataBase = Count_DataBase+3 ;
Count =1;
while (Count<=Count_DataBase)
GetLine (nvFileHandle, svLine);
ListAddString (listID, svLine, AFTER);
hRec = MsiCreateRecord(4);
MsiRecordSetString(hRec, 1, "IS_SQL_DATABASE"); // Column1: Property tied to the entry
MsiRecordSetInteger(hRec, 2, order); // Column2: Display order of the item
MsiRecordSetString(hRec, 3, "Install New Database");//.Name); //Column3: Value to set property to
MsiRecordSetString(hRec, 4,"Install New Database");//.Name);
listID = MsiViewModify(hView, MSIMODIFY_INSERT_TEMPORARY, hRec);
listID = MsiCloseHandle(hRec);
MsiSetProperty(0,"IS_SQL_DATABASE","Install New Database");
if (Count >= 4 ) then
order = order + 1;
hRec = MsiCreateRecord(4);
MsiRecordSetString(hRec, 1, "IS_SQL_DATABASE"); // Column1: Property tied to the entry
MsiRecordSetInteger(hRec, 2, order); // Column2: Display order of the item
MsiRecordSetString(hRec, 3, svLine);//.Name); //Column3: Value to set property to
MsiRecordSetString(hRec, 4, svLine);//.Name); //Column4: Display text for item
listID = MsiViewModify(hView, MSIMODIFY_INSERT_TEMPORARY, hRec);
listID = MsiCloseHandle(hRec);
endif ;
listID = MsiDatabaseOpenView(hDatabase, "SELECT * FROM ComboBox WHERE Property='IS_SQL_DATABASE'", hView);
listID = MsiViewExecute(hView,NULL);
Count = Count+1;
endwhile;
CloseFile (nvFileHandle);
ListDestroy (listID);
MsiSetProperty(hMSI,"BackupAvailable","True");
endif;
end ;
Hope this may give to some help...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 22, 2010
08:26 AM
Thanks once again Azad. A short q - Where do I need to add this Function?
Best Regards,
Velan
Best Regards,
Velan
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 26, 2010
01:43 AM
You need to add this function in Installscript and include it in Custom Action and Sequences.