]> Creatis software - cpPlugins.git/blobdiff - appli/bash/CreateWin32Installer.cxx
...
[cpPlugins.git] / appli / bash / CreateWin32Installer.cxx
index 57874c9f7e9e2f8d857f116d088c1f23f08bb0a6..4f6ac375cdf3dc57d719a8921aa7028ea1f8869e 100644 (file)
@@ -48,15 +48,11 @@ int main( int argc, char* argv[] )
 {
   if( argc < 3 )
   {
-    std::cerr
-      << "Usage: " << argv[ 0 ]
-      << " entry_point objdump_tool [other_dir(s)]"
-      << std::endl;
+    std::cerr << "Usage: " << argv[ 0 ] << " dump_tool libs" << std::endl;
       return( 1 );
 
   } // fi
-  std::string entry_point, objdump_tool;
-  std::set< std::string > dirs;
+  std::string dump_tool;
 
   if( !Exists( argv[ 1 ] ) )
   {
@@ -66,29 +62,24 @@ int main( int argc, char* argv[] )
     return( 1 );
 
   } // fi
-  if( !Exists( argv[ 2 ] ) )
-  {
-    std::cerr
-      << "Error: file \"" << argv[ 2 ] << "\" does not exist."
-      << std::endl;
-    return( 1 );
-
-  } // fi
+  dump_tool = realpath( argv[ 1 ], NULL );
 
-  entry_point = realpath( argv[ 1 ], NULL );
-  objdump_tool = realpath( argv[ 2 ], NULL );
+  std::set< std::string > files, dirs;
+  std::queue< std::string > q;
+  for( int i = 2; i < argc; ++i )
+  {
+    if( Exists( argv[ i ] ) )
+    {
+      std::string fname = realpath( argv[ i ], NULL );
+      std::string fname_dir, fname_file;
+      Split( fname, fname_dir, fname_file );
+      q.push( fname );
+      dirs.insert( fname_dir );
 
-  std::string entry_point_dir, entry_point_file;
-  Split( entry_point, entry_point_dir, entry_point_file );
+    } // fi
 
-  dirs.insert( entry_point_dir );
-  for( int i = 3; i < argc; ++i )
-    if( Exists( argv[ i ] ) )
-      dirs.insert( std::string( realpath( argv[ i ], NULL ) ) );
+  } // rof
 
-  std::set< std::string > files;
-  std::queue< std::string > q;
-  q.push( entry_point );
   while( !q.empty( ) )
   {
     std::string e = q.front( );
@@ -100,7 +91,7 @@ int main( int argc, char* argv[] )
         if( Exists( e ) )
         {
           std::istringstream ss(
-            Exec( objdump_tool + " -x " + e + " | grep DLL\\ Name" )
+            Exec( dump_tool + " -x " + e + " | grep DLL\\ Name" )
             );
           files.insert( e );
           std::string line;