Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Install script issue :For windows server installs, dboption checkboxes


1 reply to this topic

Pooja Hegde

Pooja Hegde
  • Full Members
  • 7 posts

Posted 13 December 2014 - 11:17

 

This is the Function Which does the action 

//  Function: DialogDBOptions
//
//  Purpose: This function will ask user for database options
 
function DialogDBOptions(nDirection)
BOOL bOptCreateDB;  
NUMBER nAskResult, nResult, i, j;     
STRING szRulesFile, szDBOpts, szLoadType;                                          
STRING szTmp;
STRING szSaveMEDIAValue, szDbLoadCfg, szDescription, szCompName, svNum;
NUMBER nIndex, nResult2, nListDBLoadTypes; 
LIST listDBLoadTypes, listDataSets, listDataNames;
BOOL bSelected;
BOOL bConflict;
STRING szResult;
begin      
 
nAskResult = nDirection;
 
if(isAutoInstall()) then
m_strCreateSchema = getAutoInstallString(AUTOINSTALL_DB, CREATE_SCHEMA);
m_strLoadBaseData = getAutoInstallString(AUTOINSTALL_DB, LOAD_BASE);
m_strLoad3PLData = getAutoInstallString(AUTOINSTALL_DB, LOAD_3PL);
m_strSelectedDatasets = getAutoInstallString(AUTOINSTALL_DB, LOAD_DATASETS);
return NEXT;
endif;
 
    //Get shared data
 
Dlg_DB_Options:  
    
    //szSaveMEDIAValue = MEDIA;
    //MEDIA = "custom2";
    szDbLoadCfg = SRCDIR ^ "..\\database\\dbload.cfg";
    nIndex = 0;
    //set the prompt variables based on the property values
    if (m_strCreateSchema = LESENV_TRUE)
    then
    bOptCreateDB = TRUE;
    else
    bOptCreateDB = FALSE;
    endif;
 
//Need to determine what data load options to provide
//then need to enforce rules if any
//Currently check for seamles, wmd, lm, lens, dsup & cdmrqa  
listDBLoadTypes = ListCreate(STRINGLIST);
listDataSets = ListCreate(STRINGLIST); 
listDataNames = ListCreate(STRINGLIST); 
 
szRulesFile = RetrieveSharedProperty(m_arraySharedProperties, "RULESFILE");
 
// Get database options for all products and selected objects
GetDBLoadTypes(m_strSelectedObjects, szRulesFile, listDBLoadTypes);
GetDBLoadTypes(m_strProductsInstalled, szRulesFile, listDBLoadTypes);
 
if(m_bUpgrade && (ListCount(listDBLoadTypes) == 0)) then
// No datasets found to prompt during upgrade:
m_strSelectedDatasets = "";
goto ExitDialogDBOptions;
endif;
 
//Loop thru list to set the prompts 
 
    // Resize the arrays                   
    // The first position is for create schema prompt
    if(ListCount(listDBLoadTypes) > 0) then
   Resize(m_szLoadTypes, ListCount(listDBLoadTypes)+1);
   Resize(m_bLoadTypeSelected, ListCount(listDBLoadTypes)+1);
   Resize(m_szLoadTypePrompts, ListCount(listDBLoadTypes)+1);
    else
   Resize(m_szLoadTypes, 30);
   Resize(m_bLoadTypeSelected, 30);
   Resize(m_szLoadTypePrompts, 30);
endif;             
 
for i = 0 to SizeOf(m_szLoadTypes)-1 
m_szLoadTypes(i) = "";  
m_bLoadTypeSelected(i) = FALSE;
m_szLoadTypePrompts(i) = "";
endfor;
 
     
    // 0
    m_szLoadTypePrompts(0) = @PROMPT_CREATE_SCHEMA; 
    m_szLoadTypes(0) = "";
    
    if(m_bUpgrade) then
    // During upgrade list datasets only
    i = 0;
    else
    // During fresh install start with "create database" checkbox
i = 1; 
endif;
nResult = ListGetFirstString(listDBLoadTypes, szLoadType);
while (nResult != END_OF_LIST)
NumToStr(svNum, i);
 
if (szLoadType = "WM") then
// PR 51301: Never prompt for WM data
// If DCS is installed then automatically load it
else
m_szLoadTypes(i) = szLoadType;
GetProfString(szDbLoadCfg, szLoadType, "desc", szTmp);
m_szLoadTypePrompts(i) = "Load " + szTmp;
 
// Now set the initial value from the defaults
for j = 0 to SizeOf(m_szInitLoadTypes)-1
if(m_szInitLoadTypes(j) = m_szLoadTypes(i)) then
m_bLoadTypeSelected(i) = m_bInitLoadTypeSelected(j);
endif;
endfor;
 
i = i + 1;
endif;
 
nResult = ListGetNextString(listDBLoadTypes, szLoadType);
endwhile;
 
if (i = 0)
goto ExitDialogDBOptions;
 
if(i > 0) then
   Resize(m_szLoadTypes, i);
   Resize(m_bLoadTypeSelected, i);
   Resize(m_szLoadTypePrompts, i);
    endif;
 
//Check to see if the user has been here already
if(!m_bUpgrade) then
m_bLoadTypeSelected(0) =  bOptCreateDB;
endif;
 
SetDialogTitle(DLG_ASK_OPTIONS, @TITLE_DATABASE_OPTION);
 
DialogScreen:
 
if (RetrieveSharedProperty(m_arraySharedProperties, "SimpleInstall") = "TRUE") then 
nAskResult = NEXT;   
elseif(!m_bUpgrade) then
// Fresh install
nAskResult = AskOptionsArray(NONEXCLUSIVE,
      @MSG_SELECT_DB_OPTIONS, m_szLoadTypePrompts, m_bLoadTypeSelected);
   bOptCreateDB = m_bLoadTypeSelected(0);
else
// Upgrade/Hotfix
nAskResult = AskOptionsArray(NONEXCLUSIVE,
      @MSG_SELECT_UPGRADE_DB_OPTIONS, m_szLoadTypePrompts, m_bLoadTypeSelected);
endif;
 
 
if (nAskResult != BACK) then
m_strSelectedDatasets = "";
 
if (bOptCreateDB)
then
m_strCreateSchema = LESENV_TRUE;
else
m_strCreateSchema = LESENV_FALSE;
endif;
   
  //Check for some user values
for i = 0 to SizeOf(m_szLoadTypes)-1
 
if(m_bLoadTypeSelected(i) = TRUE) then 
szResult =  LESENV_TRUE; 
 
if(m_bUpgrade || i > 0) then
if(m_strSelectedDatasets = "") then
m_strSelectedDatasets = m_szLoadTypes(i);
else
m_strSelectedDatasets = m_strSelectedDatasets 
+ "," + m_szLoadTypes(i);
endif;
endif;
 
else
szResult =  LESENV_FALSE;
endif;
 
if(m_szLoadTypes(i) = "3PL") then
            m_strLoad3PLData = szResult;   
            elseif(m_szLoadTypes(i) = "BASE") then
            m_strLoadBaseData = szResult;   
endif;
   endfor;
 
endif;
 
//Check for conflicting datasets. 
//If there is a conflict return to the DialogScreen 
bConflict=CheckDatasetConflict(); 
if (bConflict) then 
goto DialogScreen; 
endif; 
 
ExitDialogDBOptions:
 
ListDestroy(listDBLoadTypes);
 
recordAutoInstallString(AUTOINSTALL_DB, CREATE_SCHEMA, m_strCreateSchema);
recordAutoInstallString(AUTOINSTALL_DB, LOAD_BASE, m_strLoadBaseData);
recordAutoInstallString(AUTOINSTALL_DB, LOAD_3PL, m_strLoad3PLData);
recordAutoInstallString(AUTOINSTALL_DB, LOAD_DATASETS, m_strSelectedDatasets);
 
return nAskResult;
end; 
 
 
Issue :For windows server installs, dboption checkboxes are not getting remembered when revisting the dialog. (Currently only "Create Schema" is getting preselected)
Also attached the checkboxes image of the windows dboption checkboxes.
 
CReate-Schema code goes like belo
 
m_strCreateSchema = getAutoInstallString(AUTOINSTALL_DB, CREATE_SCHEMA);
 
 
then…
 
    //set the prompt variables based on the property values
    if (m_strCreateSchema = LESENV_TRUE)
    then
            bOptCreateDB = TRUE;
    else
            bOptCreateDB = FALSE;
    endif;
 
 
Then this sets the checkbox in UI. Note m_bLoadTypeSelected is holding all the default values for all checkboxes
 
//Check to see if the user has been here already
            if(!m_bUpgrade) then
                        m_bLoadTypeSelected(0) =  bOptCreateDB;
            endif;
 
 
So now we have to utilize LOAD-BASE, LOAD-3PL etc. to do the same.
Can some one help.
 
 
 
 


Pooja Hegde

Pooja Hegde
  • Full Members
  • 7 posts

Posted 15 December 2014 - 07:14

Looks Like the code is coming from the below loop 

 

This is where all the magic happens

 

                                    m_szLoadTypes(i) = szLoadType;

                                    GetProfString(szDbLoadCfg, szLoadType, "desc", szTmp);

                                    m_szLoadTypePrompts(i) = "Load " + szTmp;

                                   

                                    // Now set the initial value from the defaults

                                    for j = 0 to SizeOf(m_szInitLoadTypes)-1

                                                if(m_szInitLoadTypes(j) = m_szLoadTypes(i)) then

                                                            m_bLoadTypeSelected(i) = m_bInitLoadTypeSelected(j);

                                                endif;

                                    endfor;

 

Need to exactly change here for other options to be stored.  Please any one help.