binPath = QDir::currentDirPath() + "/Products/BINARIES";
srcPath = QDir::currentDirPath() + "/Products/SOURCES";
+ singleBinPlts << "Debian3.1" << "Mandriva2006.0_64" << "Debian4.0";
+ commonPlatform = "Debian3.1";
+
//
// get XML filename and current platform
//
addLogo( pixmap( pxLogo ) );
// set defaults
- setVersion( "3.2.7" );
+ setVersion( "4.0.0" );
setCaption( tr( "SALOME %1" ).arg( myVersion ) );
setCopyright( tr( "Copyright (C) 2007 CEA" ) );
setLicense( tr( "All rights reserved." ) );
delete myThread;
}
// ================================================================
+/*!
+ * SALOME_InstallWizard::getBasePlatform
+ * Determine the base platform for binaries installation
+ */
+// ================================================================
+QString SALOME_InstallWizard::getBasePlatform()
+{
+ QString aBasePlt = "";
+ if ( singleBinPlts.contains(curPlatform) )
+ aBasePlt = curPlatform;
+ else
+ aBasePlt = commonPlatform;
+ return aBasePlt;
+}
+// ================================================================
/*!
* SALOME_InstallWizard::currentPlatform
* Tries to determine the current user's operating system
if ( !curPlatform.isEmpty() ) {
// try to get XML file for current platform
if ( xmlMap.find( curPlatform ) != xmlMap.end() ) {
- xmlFileName = xmlMap[ curPlatform ];
- QFileInfo fibp( QDir::cleanDirPath( getBinPath() + "/" + getPlatform() ) );
+ xmlFileName = xmlMap[ getBasePlatform() ];
+ QFileInfo fibp( QDir::cleanDirPath( getBinPath() + "/" + getBasePlatform() ) );
if ( !fibp.isDir() ) {
- platformsMap = xmlMap;
warnMsg = tr( "Binaries are absent for current platform" );
}
+ platformsMap = xmlMap;
}
else {
platformsMap = xmlMap;
// ================================================================
void SALOME_InstallWizard::setupPlatformPage()
{
- // create page or not?
- if ( platformsMap.isEmpty() )
- return;
-
// create page
platformsPage = new QWidget( this, "PlatformsPage" );
QGridLayout* pageLayout = new QGridLayout( platformsPage );
QFont fnt = warnLab2->font();
fnt.setBold( true );
warnLab2->setFont( fnt );
- if ( installType == Compile && platformsMap.find( curPlatform ) == platformsMap.end() )
- warnMsg += tr( " and compilation is not tested on this one." );
- else
- warnMsg += ".";
warnLab = new QLabel( warnMsg, platformsPage );
warnLab->setAlignment( Qt::AlignHCenter | Qt::WordBreak );
- QLabel* warnLab3 = new QLabel( tr( "If you want to proceed anyway, please select platform from the following list:" ),
+ warnLab3 = new QLabel( tr( "If you want to proceed anyway, please select platform from the following list:" ),
platformsPage );
warnLab3->setAlignment( Qt::AlignHCenter | Qt::WordBreak );
// create button group
QWidget* aPage = InstallWizard::page( pageTitle );
if ( aPage == typePage ) {
// installation type page
+ warnLab3->show();
this->setAppropriate( platformsPage, false );
if ( installType == Binaries ) { // 'Binary' installation type
// check binaries directory
QMessageBox::NoButton );
return false;
}
- QFileInfo fibp( QDir::cleanDirPath( getBinPath() + "/" + getPlatform() ) );
- if ( !fibp.isDir() )
+ if ( platformsMap.find( curPlatform ) == platformsMap.end() ) {
+ // Unknown platform case
+ QString aMsg = warnMsg + tr( ".\nBy default the universal binary package will be installed." );
+ aMsg += tr( "\nIf you want to select another one, please use the following list:" );
+ warnLab->setText( aMsg );
+ warnLab3->hide();
this->setAppropriate( platformsPage, true );
+ }
+ else {
+ // Supported platform case
+ QString aPlatform = curPlatform;
+ if ( curPlatform != getBasePlatform() ) {
+ refPlatform = getBasePlatform();
+ xmlFileName = platformsMap[ refPlatform ];
+ aPlatform = getPlatform();
+ }
+ QFileInfo fibp( QDir::cleanDirPath( getBinPath() + "/" + aPlatform ) );
+ if ( !fibp.isDir() ) {
+ warnLab->setText( tr( "Binaries are absent for current platform." ) );
+ this->setAppropriate( platformsPage, true );
+ }
+ }
+
// check sources directory
QFileInfo fis( QDir::cleanDirPath( getSrcPath() ) );
if ( !fis.exists() )
QMessageBox::NoButton );
return false;
}
+ if ( platformsMap.find( curPlatform ) == platformsMap.end() ) {
+ QString aMsg = warnMsg + ".";
+ if ( installType == Compile )
+ aMsg = warnMsg + tr( " and compilation is not tested on this one." );
+ warnLab->setText( aMsg );
+ this->setAppropriate( platformsPage, true );
+ }
}
}
progressView->ensureVisible( prodProc );
QCheckListItem* item;
- if ( prodProc != "gcc" )
- item = findItem( prodProc );
// fill in script parameters
shellProcess->clearArguments();
// ... script name
shellProcess->setWorkingDirectory( QDir::cleanDirPath( QFileInfo( "./config_files/" ).absFilePath() ) );
- if ( prodProc != "gcc" )
+ if ( !extraProducts.contains( prodProc ) ) {
+ item = findItem( prodProc );
shellProcess->addArgument( item->text(2) );
+ }
else
- shellProcess->addArgument( "gcc-common.sh" );
+ shellProcess->addArgument( extraProducts[ prodProc ] );
// ... temp folder
QString tmpFolder = QDir::cleanDirPath( tempFolder->text().stripWhiteSpace() ) + TEMPDIRNAME;
// tmpFolder = "/tmp";
// ... not install : try to find preinstalled
- if ( !progressView->isVisible( prodProc ) ) {
+ if ( notInstall.contains( prodProc ) || prodProc == "gcc" ) {
shellProcess->addArgument( "try_preinstalled" );
shellProcess->addArgument( QFileInfo( tmpFolder ).absFilePath() );
shellProcess->addArgument( QDir::currentDirPath() + "/Products" );
shellProcess->addArgument( QFileInfo( tgtFolder ).absFilePath() );
// ... list of all products
QString depproducts = DefineDependeces(productsMap);
- depproducts.prepend( "gcc " );
+ depproducts.prepend( QStringList( extraProducts.keys() ).join(" ") + " " );
___MESSAGE___( "Dependancies"<< depproducts.latin1() );
shellProcess->addArgument( depproducts );
// ... product name - currently installed product
- if ( prodProc != "gcc" )
+ if ( !extraProducts.contains( prodProc ) )
shellProcess->addArgument( item->text(0) );
else
- shellProcess->addArgument( "gcc" );
+ shellProcess->addArgument( prodProc );
// ... list of products being installed
shellProcess->addArgument( prodSequence.join( " " ) );
// ... sources directory
// all products are installed successfully
MapProducts::Iterator mapIter;
___MESSAGE___( "starting pick-up environment" );
- QString depproducts = QUOTE( DefineDependeces(productsMap).prepend( "gcc " ) );
+ QString depproducts = QUOTE( DefineDependeces(productsMap).prepend( QStringList( extraProducts.keys() ).join(" ") + " " ) );
for ( mapIter = productsMap.begin(); mapIter != productsMap.end(); ++mapIter ) {
QCheckListItem* item = mapIter.key();
Dependancies dep = mapIter.data();
if ( installType == Binaries ) {
QFileInfo fib( QDir::cleanDirPath( getBinPath() + "/" + plat ) );
rb->setEnabled( fib.exists() );
+ if ( platBtnGrp->id( platBtnGrp->selected() ) == -1 && plat == getBasePlatform() )
+ rb->animateClick();
}
else {
QFileInfo fis( QDir::cleanDirPath( getSrcPath() ) );
updateSizeColumn();
rmSrcPrevState = removeSrcBtn->isChecked();
}
+ // add extra products to install list
+ extraProducts.clear();
+ extraProducts.insert( "gcc", "gcc-common.sh" );
+ if ( refPlatform == commonPlatform && installType == Binaries )
+ extraProducts.insert( "DebianLibsForSalome", "DEBIANFORSALOME-3.1.sh" );
}
else if ( aPage == productsPage ) {
// products page
// clear lists of products
toInstall.clear();
notInstall.clear();
+ toInstall += extraProducts.keys();
// ... and fill it for new process
- toInstall.append( "gcc" );
QCheckListItem* item = (QCheckListItem*)( prereqsView->firstChild() );
while( item ) {
if ( productsMap.contains( item ) ) {
ProgressViewItem* progressItem;
// set status for installed products
for ( int i = 0; i < (int)toInstall.count(); i++ ) {
- if ( toInstall[i] != "gcc" ) {
+ if ( !extraProducts.contains( toInstall[i] ) ) {
item = findItem( toInstall[i] );
progressView->addProduct( item->text(0), item->text(2) );
continue;
}
- progressItem = progressView->addProduct( "gcc", "gcc-common.sh" );
+ progressItem = progressView->addProduct( toInstall[i], extraProducts[toInstall[i]] );
progressItem->setVisible( false );
}
// set status for not installed products
// get specified list of products being installed
prodSequence.clear();
for (int i = 0; i<(int)toInstall.count(); i++ ) {
- if ( toInstall[i] == "gcc" ) {
+ if ( extraProducts.contains( toInstall[i] ) ) {
prodSequence.append( toInstall[i] );
continue;
}