From c63bf341ce5ca657fca86b3037ced0b47921ad30 Mon Sep 17 00:00:00 2001 From: akl Date: Thu, 19 Jun 2008 13:00:27 +0000 Subject: [PATCH] Implementation using of --single-directory(-s) option of runInstall. --- src/SALOME_InstallWizard.cxx | 17 ++++++++--------- src/SALOME_InstallWizard.hxx | 7 ++++--- src/main.cxx | 14 +++++++++----- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/SALOME_InstallWizard.cxx b/src/SALOME_InstallWizard.cxx index 5587245..e610151 100644 --- a/src/SALOME_InstallWizard.cxx +++ b/src/SALOME_InstallWizard.cxx @@ -426,7 +426,7 @@ public: .arg( __IW_VERSION_MINOR__ ) \ .arg( __IW_VERSION_PATCH__ ) ); QLabel* copyright = new QLabel( this, "copyright" ); - copyright->setText( "Copyright © 2004-2008 CEA" ); + copyright->setText( "Copyright © 2002-2008 CEA" ); QFont font = title->font(); font.setPointSize( (int)( font.pointSize() * 1.8 ) ); title->setFont( font ); @@ -470,7 +470,8 @@ public: SALOME_InstallWizard::SALOME_InstallWizard(const QString& aXmlFileName, const QString& aTargetDir, const QString& aTmpDir, - const bool aForceSrc) + const bool aForceSrc, + const bool aSingleDir) : InstallWizard( qApp->desktop(), "SALOME_InstallWizard", false, 0 ), helpWindow( NULL ), moreMode( false ), @@ -484,10 +485,10 @@ SALOME_InstallWizard::SALOME_InstallWizard(const QString& aXmlFileName, myTargetPath = aTargetDir; myTmpPath = aTmpDir; forceSrc = aForceSrc; + singleDir = aSingleDir; stateChanged = true; binPath = QDir::currentDirPath() + "/Products/BINARIES"; srcPath = QDir::currentDirPath() + "/Products/SOURCES"; - oneModDirName = "SALOME"; oneProdDirName = "PRODUCTS"; singleBinPlts << "Debian4.0" @@ -530,7 +531,7 @@ SALOME_InstallWizard::SALOME_InstallWizard(const QString& aXmlFileName, addLogo( pixmap( pxLogo ) ); // set defaults - setVersion( "4.1.1" ); + setVersion( "4.1.3" ); setCaption( tr( "SALOME %1" ).arg( myVersion ) ); setCopyright( tr( "Copyright (C) 2008 CEA" ) ); setLicense( tr( "All rights reserved." ) ); @@ -1758,7 +1759,6 @@ void SALOME_InstallWizard::runModifyLaFiles() modifyLaProc->addArgument( "modifyLaFiles.sh" ); modifyLaProc->addArgument( "modify_la_files" ); modifyLaProc->addArgument( QDir::cleanDirPath( QFileInfo( targetFolder->text().stripWhiteSpace() ).absFilePath() ) ); - modifyLaProc->addArgument( oneModDirName ); // ... run script if ( !modifyLaProc->start() ) ___MESSAGE___( "Error: process could not start!" ); @@ -2119,7 +2119,7 @@ void SALOME_InstallWizard::launchScript() MapProducts::Iterator mapIter; for ( mapIter = productsMap.begin(); mapIter != productsMap.end(); ++mapIter ) if ( mapIter.data().getName() == prodProc && mapIter.data().getType() == "component" ) { - shellProcess->addArgument( oneModDirName ); + shellProcess->addArgument( "TRUE" ); break; } } @@ -2590,8 +2590,8 @@ void SALOME_InstallWizard::onButtonGroup( int rbIndex ) int prevType = installType; QString prevPlat = getPlatform(); QWidget* aPage = InstallWizard::currentPage(); + installType = InstallationType( rbIndex ); if ( aPage == typePage ) { - installType = InstallationType( rbIndex ); // management of the check-box removeSrcBtn->setEnabled( installType == Compile ); oneModDirBtn->setEnabled( installType == Binaries /*|| installType == Compile*/ ); @@ -2600,13 +2600,12 @@ void SALOME_InstallWizard::onButtonGroup( int rbIndex ) else if ( aPage == platformsPage ) { refPlatform = platBtnGrp->find( rbIndex )->name(); xmlFileName = platformsMap[ refPlatform ]; -// cout << xmlFileName << endl; setNextEnabled( platformsPage, true ); } if ( prevType != installType || ( indexOf( platformsPage ) != -1 ? prevPlat != getPlatform() : false ) ) { stateChanged = true; - oneModDirBtn->setChecked( false ); + oneModDirBtn->setChecked( installType == Binaries && singleDir ); oneProdDirBtn->setChecked( false ); } } diff --git a/src/SALOME_InstallWizard.hxx b/src/SALOME_InstallWizard.hxx index 6d12519..763482a 100644 --- a/src/SALOME_InstallWizard.hxx +++ b/src/SALOME_InstallWizard.hxx @@ -3,7 +3,7 @@ // Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com) // Project : SALOME // Module : Installation Wizard -// Copyright : 2002-2007 CEA +// Copyright : 2002-2008 CEA #ifndef __SALOME_InstallWizard #define __SALOME_InstallWizard @@ -163,7 +163,8 @@ class SALOME_InstallWizard: public InstallWizard SALOME_InstallWizard( const QString& aXmlFileName = QString::null, const QString& aTargetDir = QString::null, const QString& aTmpDir = QString::null, - const bool aForceSrc = false ); + const bool aForceSrc = false, + const bool aSingleDir = false ); // destructor virtual ~SALOME_InstallWizard( ); @@ -362,7 +363,6 @@ class SALOME_InstallWizard: public InstallWizard QString xmlFileName; // xml file QString binPath; // binaries path QString srcPath; // sources path - QString oneModDirName; // name of the single directory for binaries of SALOME modules QString oneProdDirName; // name of the single directory for binaries of prerequisites QString commonPlatform; // platform with universal binaries QStringList singleBinPlts; // list of platforms for that the special binary packages are exist @@ -412,6 +412,7 @@ class SALOME_InstallWizard: public InstallWizard QLabel* requiredSize; // label QLabel* requiredTemp; // label QLabel* availableSize; // label + bool singleDir; // Force all SALOME modules to be installed into single directory // --> prestart page QWidget* prestartPage; // page itself QTextEdit* choices; // choice text view diff --git a/src/main.cxx b/src/main.cxx index 80a8ba2..d08987d 100644 --- a/src/main.cxx +++ b/src/main.cxx @@ -3,7 +3,7 @@ // Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com) // Project : SALOME // Module : Installation Wizard -// Copyright : 2002-2007 CEA +// Copyright : 2002-2008 CEA #include "globals.h" @@ -56,17 +56,18 @@ int main( int argc, char **argv ) bool has_target = false; bool has_tmp = false; bool force_src = false; + bool single_dir = false; for( int i = 1; i < argc; i++ ) { QString a = QString( argv[i] ); if ( a == "--version" || a == "-v" ) { - printf("SALOME Installation Wizard version %d.%d.%d ", + printf("SALOME Installation Wizard version %d.%d.%d (Qt version %d.%d.%d)\n", ( __IW_VERSION__ / 10000 ), ( __IW_VERSION__ / 100 % 100 ), - ( __IW_VERSION__ % 100 ) ); - printf("(Qt version %d.%d.%d)\n", + ( __IW_VERSION__ % 100 ) , ( QT_VERSION >> 16 ) & 0xFF, ( QT_VERSION >> 8 ) & 0xFF, ( QT_VERSION ) & 0xFF ); + printf("Copyright (C) 2002-2008 CEA\n"); return 0; } else if ( a == "--target" || a == "-d" ) { @@ -102,6 +103,9 @@ int main( int argc, char **argv ) else if ( a == "--all-from-sources" || a == "-a" ) { force_src = true; } + else if ( a == "--single-directory" || a == "-s" ) { + single_dir = true; + } } if ( has_xml && xmlFileName.isEmpty() ) { printf("Please specify the configuration XML file!\n"); @@ -131,7 +135,7 @@ int main( int argc, char **argv ) return -1; } } - SALOME_InstallWizard wizard(xmlFileName, targetDirPath, tmpDirPath, force_src); + SALOME_InstallWizard wizard(xmlFileName, targetDirPath, tmpDirPath, force_src, single_dir); a.setMainWidget( &wizard ); wizard.show(); return a.exec(); -- 2.39.2