Author: rharabien Date: Mon Nov 28 09:46:59 2011 New Revision: 54521
URL: http://svn.reactos.org/svn/reactos?rev=54521&view=rev Log: [RBUILD] - Create livecd shortcuts on rbuild too
Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp trunk/reactos/tools/rbuild/backend/mingw/mingw.h trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h
Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw/... ============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp [iso-8859-1] Mon Nov 28 09:46:59 2011 @@ -152,7 +152,25 @@ }
string -v2s ( const Backend* backend, const vector<FileLocation>& files, int wrap_at ) +MingwBackend::GetFullNamePrefixSpaces ( const FileLocation& file ) const +{ + string fullname = GetFullName ( file ); + + size_t pos = 0; + while ( true ) + { + pos = fullname.find ( ' ', pos ); + if ( pos == fullname.npos ) + break; + fullname.replace ( pos, 1, "\ " ); + pos += 2; + } + + return fullname; +} + +string +MingwBackend::v2s ( const vector<FileLocation>& files, int wrap_at, bool prefixSpaces ) const { if ( !files.size() ) return ""; @@ -168,14 +186,16 @@ } else if ( s.size() ) s += " "; - s += backend->GetFullName ( file ); + if (prefixSpaces) + s += GetFullNamePrefixSpaces ( file ); + else + s += GetFullName ( file ); } return s; }
- -string -v2s ( const string_list& v, int wrap_at ) +string +MingwBackend::v2s ( const string_list& v, int wrap_at ) const { if ( !v.size() ) return ""; @@ -196,7 +216,6 @@ } return s; } -
static class MingwFactory : public Backend::Factory { @@ -1274,7 +1293,7 @@ registry_files.push_back ( FileLocation ( InstallDirectory, system32ConfigDirectory, "software" ) ); registry_files.push_back ( FileLocation ( InstallDirectory, system32ConfigDirectory, "system" ) );
- return v2s( this, registry_files, 6 ); + return v2s( registry_files, 6, true ); }
void @@ -1307,7 +1326,7 @@ { vector<FileLocation> vInstallTargetFiles; GetInstallTargetFiles ( vInstallTargetFiles ); - string installTargetFiles = v2s ( this, vInstallTargetFiles, 5 ); + string installTargetFiles = v2s ( vInstallTargetFiles, 5, true ); string registryTargetFiles = GetRegistryTargetFiles ();
fprintf ( fMakefile,
Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw/... ============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/mingw.h [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/mingw/mingw.h [iso-8859-1] Mon Nov 28 09:46:59 2011 @@ -29,11 +29,6 @@ class Directory; class MingwModuleHandler;
-extern std::string -v2s ( const Backend* backend, const std::vector<FileLocation>& files, int wrap_at ); -extern std::string -v2s ( const string_list& v, int wrap_at ); -
class MingwBackend : public Backend { @@ -59,8 +54,11 @@
std::string GetFullName ( const FileLocation& file ) const; std::string GetFullPath ( const FileLocation& file ) const; + std::string GetFullNamePrefixSpaces ( const FileLocation& file ) const; std::string GetRegistrySourceFiles () const; std::string GetRegistryTargetFiles () const; + std::string v2s ( const std::vector<FileLocation>& files, int wrap_at, bool prefixSpaces = false ) const; + std::string v2s ( const string_list& v, int wrap_at ) const;
private: void CreateMakefile ();
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw/... ============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp [iso-8859-1] Mon Nov 28 09:46:59 2011 @@ -281,7 +281,7 @@ const File& file = *compilationUnit.GetFiles ()[i]; sourceFiles.push_back ( backend->GetFullName ( file.file ) ); } - return string ( " " ) + v2s ( sourceFiles, 10 ); + return string ( " " ) + backend->v2s ( sourceFiles, 10 ); }
/* caller needs to delete the returned object */ @@ -322,7 +322,7 @@ fprintf ( fMakefile, "\t$(ECHO_CP)\n" ); fprintf ( fMakefile, - "\t${cp} %s %s 1>$(NUL)\n", + "\t${cp} "%s" "%s" 1>$(NUL)\n", backend->GetFullName ( source ).c_str (), backend->GetFullName ( *PassThruCacheDirectory ( &destination ) ).c_str () ); } @@ -333,12 +333,12 @@ { fprintf ( fMakefile, "%s : %s\n", - backend->GetFullName ( *PassThruCacheDirectory ( &destination ) ).c_str (), - backend->GetFullName ( source ).c_str () ); + backend->GetFullNamePrefixSpaces ( *PassThruCacheDirectory ( &destination ) ).c_str (), + backend->GetFullNamePrefixSpaces ( source ).c_str () ); fprintf ( fMakefile, "\t$(ECHO_CP)\n" ); fprintf ( fMakefile, - "\t${cp} %s %s 1>$(NUL)\n", + "\t${cp} "%s" "%s" 1>$(NUL)\n", backend->GetFullName ( source ).c_str (), backend->GetFullName ( *PassThruCacheDirectory ( &destination ) ).c_str () ); } @@ -508,7 +508,7 @@ fprintf ( fMakefile, "%s: %s\n\t-@${rm}", GetModuleCleanTarget ( module ).c_str(), - v2s ( referencedModuleNames, 10 ).c_str () ); + backend->v2s ( referencedModuleNames, 10 ).c_str () ); for ( size_t i = 0; i < clean_files.size(); i++ ) { if ( ( i + 1 ) % 10 == 9 ) @@ -1196,7 +1196,7 @@ vector<FileLocation> rpcDependencies; GetRpcHeaderDependencies ( rpcDependencies ); if ( rpcDependencies.size () > 0 ) - dependencies += " " + v2s ( backend, rpcDependencies, 5 ); + dependencies += " " + backend->v2s ( rpcDependencies, 5 );
rule->Execute ( fMakefile, backend, module, sourceFile, clean_files, dependencies ); } @@ -1536,7 +1536,7 @@ vector<FileLocation> rpcDependencies; GetRpcHeaderDependencies ( rpcDependencies ); if ( rpcDependencies.size () > 0 ) - dependencies = " " + v2s ( backend, rpcDependencies, 5 ); + dependencies = " " + backend->v2s ( rpcDependencies, 5 );
if ( module.cplusplus ) pchCxxRule.Execute ( fMakefile, backend, module, module.pch->file, clean_files, dependencies ); @@ -2788,7 +2788,7 @@ fprintf( fMakefile, "\n%s_OBJS := %s\n\n", module.name.c_str (), - v2s ( backend, sourceFiles, 5 ).c_str () ); + backend->v2s ( sourceFiles, 5, true ).c_str () );
fprintf ( fMakefile, ".PHONY: %s\n\n", module.name.c_str ()); @@ -2916,6 +2916,75 @@ }
void +MingwLiveIsoModuleHandler::OutputMakeLinkCommand ( const string name, + const string application, + const string &path, + vector<FileLocation>& destinations ) +{ + FileLocation location ( OutputDirectory, path, name + ".lnk" ); + fprintf ( fMakefile, + "%s : $(mkshelllink_TARGET)\n", + backend->GetFullNamePrefixSpaces ( *PassThruCacheDirectory ( &location ) ).c_str () ); + fprintf ( fMakefile, + "\t$(Q)$(mkshelllink_TARGET) -o "%s" -g {450D8FBA-AD25-11D0-98A8-0800361B1103} -c %s -i %s -m livecd_start.cmd\n", + backend->GetFullName ( location ).c_str (), + application.c_str (), + application.c_str () ); + destinations.push_back ( location ); +} + +void +MingwLiveIsoModuleHandler::OutputShortcutCommands ( string& livecdDirectory, + vector<FileLocation>& destinations ) +{ + string allUsersDir = livecdDirectory + sSep + "Profiles" + sSep + "All Users"; + string defaultUserDir = livecdDirectory + sSep + "Profiles" + sSep + "Default User"; + FileLocation helperSource ( SourceDirectory, "boot" + sSep + "bootdata", "livecd_start.cmd" ); + FileLocation helperDest ( OutputDirectory, defaultUserDir + sSep + "My Documents", "livecd_start.cmd" ); + OutputCopyCommandSingle ( helperSource, helperDest ); + destinations.push_back ( helperDest ); + + string desktopDir = allUsersDir + sSep + "Desktop"; + OutputMakeLinkCommand ( "Command Prompt", "cmd.exe", desktopDir, destinations ); + + string startMenuDir = allUsersDir + sSep + "Start Menu"; + OutputMakeLinkCommand ( "ReactOS Explorer", "explorer.exe", startMenuDir + sSep + "Programs", destinations ); + + string adminToolsDir = startMenuDir + sSep + "Programs" + sSep + "Administrative Tools"; + OutputMakeLinkCommand ( "Device Manager", "devmgmt.exe", adminToolsDir, destinations ); + OutputMakeLinkCommand ( "Event Viewer", "eventvwr.exe", adminToolsDir, destinations ); + OutputMakeLinkCommand ( "Service Manager", "servman.exe", adminToolsDir, destinations ); + OutputMakeLinkCommand ( "System Configuration", "msconfig.exe", adminToolsDir, destinations ); + + string accessibilityDir = startMenuDir + sSep + "Programs" + sSep + "Accessibility"; + OutputMakeLinkCommand ( "Magnify", "magnify.exe", accessibilityDir, destinations ); + + string accessoriesDir = startMenuDir + sSep + "Programs" + sSep + "Accessories"; + OutputMakeLinkCommand ( "Calculator", "calc.exe", accessoriesDir, destinations ); + OutputMakeLinkCommand ( "Command Prompt", "cmd.exe", accessoriesDir, destinations ); + OutputMakeLinkCommand ( "Paint", "mspaint.exe", accessoriesDir, destinations ); + OutputMakeLinkCommand ( "Notepad", "notepad.exe", accessoriesDir, destinations ); + OutputMakeLinkCommand ( "Remote desktop", "mstsc.exe", accessoriesDir, destinations ); + OutputMakeLinkCommand ( "WordPad", "wordpad.exe", accessoriesDir, destinations ); + + string entertainmentDir = startMenuDir + sSep + "Programs" + sSep + "Entertainment"; + OutputMakeLinkCommand ( "Audiorecorder", "sndrec32.exe", entertainmentDir, destinations ); + OutputMakeLinkCommand ( "Multimedia Player", "mplay32.exe", entertainmentDir, destinations ); + OutputMakeLinkCommand ( "Volume Control", "sndvol32.exe", entertainmentDir, destinations ); + + string gamesDir = startMenuDir + sSep + "Programs" + sSep + "Games"; + OutputMakeLinkCommand ( "Solitaire", "sol.exe", gamesDir, destinations ); + OutputMakeLinkCommand ( "Spider Solitaire", "spider.exe", gamesDir, destinations ); + OutputMakeLinkCommand ( "WineMine", "winmine.exe", gamesDir, destinations ); + + string sysToolsDir = startMenuDir + sSep + "Programs" + sSep + "System Tools"; + OutputMakeLinkCommand ( "Character Map", "charmap.exe", sysToolsDir, destinations ); + OutputMakeLinkCommand ( "Keyboard Layout Switcher", "kbswitch.exe", sysToolsDir, destinations ); + OutputMakeLinkCommand ( "ReactX Diagnostic", "dxdiag.exe", sysToolsDir, destinations ); + OutputMakeLinkCommand ( "Regedit", "regedit.exe", sysToolsDir, destinations ); +} + +void MingwLiveIsoModuleHandler::OutputRegistryCommands ( string& livecdDirectory ) { string registrySourceFiles = backend->GetRegistrySourceFiles (); @@ -2926,7 +2995,7 @@ fprintf ( fMakefile, "\t$(ECHO_MKHIVE)\n" ); fprintf ( fMakefile, - "\t$(mkhive_TARGET) %s %s boot%cbootdata%clivecd.inf\n", + "\t$(Q)$(mkhive_TARGET) %s %s boot%cbootdata%clivecd.inf\n", backend->GetFullPath ( reactosSystem32ConfigDirectory ).c_str (), registrySourceFiles.c_str(), cSep, cSep ); @@ -2976,11 +3045,12 @@ sourceFiles ); OutputProfilesDirectoryCommands ( livecdDirectory, sourceFiles ); OutputLoaderCommands ( livecdDirectory, sourceFiles ); + OutputShortcutCommands ( livecdDirectory, sourceFiles );
fprintf( fMakefile, "\n%s_OBJS := %s\n\n", module.name.c_str (), - v2s ( backend, sourceFiles, 5 ).c_str () ); + backend->v2s ( sourceFiles, 5, true ).c_str () );
fprintf ( fMakefile, ".PHONY: %s\n\n", module.name.c_str ());
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw/... ============================================================================== --- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h [iso-8859-1] (original) +++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h [iso-8859-1] Mon Nov 28 09:46:59 2011 @@ -335,6 +335,12 @@ std::vector<FileLocation>& destinations ); void OutputLoaderCommands ( std::string& livecdDirectory, std::vector<FileLocation>& destinations ); + void OutputMakeLinkCommand ( const std::string name, + const std::string application, + const std::string &path, + std::vector<FileLocation>& destinations ); + void OutputShortcutCommands ( std::string& livecdDirectory, + std::vector<FileLocation>& destinations ); void OutputRegistryCommands ( std::string& livecdDirectory ); };