https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f7b9db0f66ae3b4e51c27…
commit f7b9db0f66ae3b4e51c273ac66ae953afb036d23
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Sep 23 00:12:24 2018 +0200
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Sun Sep 23 00:38:12 2018 +0200
[BOOTDATA] Factorize the creation of user profile directories inside a helper function
that can be called with different parameters.
---
boot/CMakeLists.txt | 99 +++++++++++++++++++++++------------------------------
1 file changed, 42 insertions(+), 57 deletions(-)
diff --git a/boot/CMakeLists.txt b/boot/CMakeLists.txt
index 0bff234030..727f75a7ff 100644
--- a/boot/CMakeLists.txt
+++ b/boot/CMakeLists.txt
@@ -53,10 +53,45 @@ ${_isobtrt_file} 2
${_efisys_file} 1
")
-# ISO image identificator names
+# ISO image identifier names
set(ISO_MANUFACTURER "ReactOS Foundation") # For both the publisher and the
preparer
set(ISO_VOLNAME "ReactOS") # For both the Volume ID and the
Volume set ID
+
+# Create user profile directories in the LiveImage
+function(add_allusers_profile_dirs _image_filelist _rootdir)
+ file(APPEND ${_image_filelist} "${_rootdir}/All Users/Application
Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist} "${_rootdir}/All Users/Documents/My
Music=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist} "${_rootdir}/All Users/Documents/My
Pictures=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist} "${_rootdir}/All Users/Documents/My
Videos=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist} "${_rootdir}/All
Users/Favorites=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist} "${_rootdir}/All Users/My
Documents=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist} "${_rootdir}/All Users/Start
Menu/Programs/StartUp=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist} "${_rootdir}/All
Users/Templates=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+endfunction()
+function(add_user_profile_dirs _image_filelist _rootdir _username)
+ file(APPEND ${_image_filelist} "${_rootdir}/${_username}/Application
Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist} "${_rootdir}/${_username}/Application
Data/Microsoft/Internet Explorer/Quick Launch=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist}
"${_rootdir}/${_username}/Cookies=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist}
"${_rootdir}/${_username}/Desktop=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist}
"${_rootdir}/${_username}/Favorites=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist} "${_rootdir}/${_username}/Local
Settings/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist} "${_rootdir}/${_username}/Local
Settings/History=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist} "${_rootdir}/${_username}/Local
Settings/Temporary Internet Files=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist} "${_rootdir}/${_username}/My
Music=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist} "${_rootdir}/${_username}/My
Pictures=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist} "${_rootdir}/${_username}/My
Videos=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist}
"${_rootdir}/${_username}/NetHood=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist}
"${_rootdir}/${_username}/PrintHood=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist}
"${_rootdir}/${_username}/Recent=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist}
"${_rootdir}/${_username}/SendTo=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist} "${_rootdir}/${_username}/Start
Menu/Programs=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist} "${_rootdir}/${_username}/Start
Menu/Programs/Administrative Tools=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist} "${_rootdir}/${_username}/Start
Menu/Programs/StartUp=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+ file(APPEND ${_image_filelist}
"${_rootdir}/${_username}/Templates=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+endfunction()
+
+
## BootCD
# Create the file list
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bootcd.cmake.lst "")
@@ -92,34 +127,9 @@ add_custom_target(bootcdregtest
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst
"${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-# Create the empty Desktop, Favorites, and Start Menu folders. And many more.
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/All
Users/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/All
Users/Documents/My Music=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/All
Users/Documents/My Pictures=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/All
Users/Documents/My Videos=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/All
Users/Favorites=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/All Users/My
Documents=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/All Users/Start
Menu/Programs/StartUp=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/All
Users/Templates=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/Default
User/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/Default
User/Application Data/Microsoft/Internet Explorer/Quick
Launch=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/Default
User/Cookies=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/Default
User/Desktop=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/Default
User/Favorites=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/Default
User/Local Settings/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/Default
User/Local Settings/History=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/Default
User/Local Settings/Temporary Internet Files=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/Default User/My
Music=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/Default User/My
Pictures=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/Default User/My
Videos=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/Default
User/NetHood=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/Default
User/PrintHood=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/Default
User/Recent=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/Default
User/SendTo=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/Default
User/Start Menu/Programs=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/Default
User/Start Menu/Programs/Administrative Tools=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/Default
User/Start Menu/Programs/StartUp=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles/Default
User/Templates=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+# Create user profile directories
+add_allusers_profile_dirs(${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst
"Profiles")
+add_user_profile_dirs(${CMAKE_CURRENT_BINARY_DIR}/livecd.cmake.lst "Profiles"
"Default User")
add_custom_target(livecd
COMMAND native-mkisofs -quiet -o ${REACTOS_BINARY_DIR}/livecd.iso -iso-level 4
@@ -136,34 +146,9 @@ add_custom_target(livecd
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "")
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst
"${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-# Create the empty Desktop, Favorites, and Start Menu folders. And many more.
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/All
Users/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/All
Users/Documents/My Music=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/All
Users/Documents/My Pictures=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/All
Users/Documents/My Videos=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/All
Users/Favorites=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/All
Users/My Documents=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/All
Users/Start Menu/Programs/StartUp=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/All
Users/Templates=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/Default
User/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/Default
User/Application Data/Microsoft/Internet Explorer/Quick
Launch=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/Default
User/Cookies=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/Default
User/Desktop=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/Default
User/Favorites=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/Default
User/Local Settings/Application Data=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/Default
User/Local Settings/History=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/Default
User/Local Settings/Temporary Internet Files=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/Default
User/My Music=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/Default
User/My Pictures=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/Default
User/My Videos=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/Default
User/NetHood=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/Default
User/PrintHood=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/Default
User/Recent=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/Default
User/SendTo=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/Default
User/Start Menu/Programs=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/Default
User/Start Menu/Programs/Administrative Tools=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/Default
User/Start Menu/Programs/StartUp=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
-file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst "livecd/Profiles/Default
User/Templates=${CMAKE_CURRENT_BINARY_DIR}/empty\n")
+# Create user profile directories
+add_allusers_profile_dirs(${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst
"livecd/Profiles")
+add_user_profile_dirs(${CMAKE_CURRENT_BINARY_DIR}/hybridcd.cmake.lst
"livecd/Profiles" "Default User")
add_custom_target(hybridcd
COMMAND native-mkisofs -quiet -o ${REACTOS_BINARY_DIR}/hybridcd.iso -iso-level 4