diff --git a/reactos/boot/freeldr/freeldr/bootmgr.c b/reactos/boot/freeldr/freeldr/bootmgr.c
index 1762c33731c..0d74206e874 100644
--- a/reactos/boot/freeldr/freeldr/bootmgr.c
+++ b/reactos/boot/freeldr/freeldr/bootmgr.c
@@ -115,6 +115,14 @@ VOID RunLoader(VOID)
{
LoadAndBootReactOS(OperatingSystemSectionNames[SelectedOperatingSystem]);
}
+#ifdef FREELDR_ROS_SETUP
+ else if (_stricmp(SettingValue, "ReactOSSetup") == 0)
+ {
+ // Could probably pass the selection across at a later date
+ // which might be useful for different install methods?
+ RunReactOSSetup();
+ }
+#endif
#ifdef __i386__
else if (_stricmp(SettingValue, "WindowsNT40") == 0)
{
diff --git a/reactos/boot/freeldr/freeldr/freeldr_base.rbuild b/reactos/boot/freeldr/freeldr/freeldr_base.rbuild
index c5d39db316e..a0d008f4612 100644
--- a/reactos/boot/freeldr/freeldr/freeldr_base.rbuild
+++ b/reactos/boot/freeldr/freeldr/freeldr_base.rbuild
@@ -77,6 +77,12 @@
version.c
cmdline.c
machine.c
+ drivemap.c
+ miscboot.c
+ options.c
+ linuxboot.c
+ oslist.c
+ custom.c
freeldr.h
diff --git a/reactos/boot/freeldr/freeldr/freeldr_main.rbuild b/reactos/boot/freeldr/freeldr/freeldr_main.rbuild
index 57178db0e82..7ad1d850700 100644
--- a/reactos/boot/freeldr/freeldr/freeldr_main.rbuild
+++ b/reactos/boot/freeldr/freeldr/freeldr_main.rbuild
@@ -7,10 +7,4 @@
-fno-inline
-fno-zero-initialized-in-bss
bootmgr.c
- drivemap.c
- miscboot.c
- options.c
- linuxboot.c
- oslist.c
- custom.c
diff --git a/reactos/boot/freeldr/freeldr/include/freeldr.h b/reactos/boot/freeldr/freeldr/include/freeldr.h
index b1a63a1535f..5f00f9bcc68 100644
--- a/reactos/boot/freeldr/freeldr/include/freeldr.h
+++ b/reactos/boot/freeldr/freeldr/include/freeldr.h
@@ -107,5 +107,6 @@
VOID BootMain(LPSTR CmdLine);
VOID RunLoader(VOID);
+VOID RunReactOSSetup(VOID);
#endif // defined __FREELDR_H
diff --git a/reactos/boot/freeldr/freeldr/reactos/setupldr.c b/reactos/boot/freeldr/freeldr/reactos/setupldr.c
index 3b371639e71..b9f036c3aeb 100644
--- a/reactos/boot/freeldr/freeldr/reactos/setupldr.c
+++ b/reactos/boot/freeldr/freeldr/reactos/setupldr.c
@@ -42,7 +42,7 @@ extern BOOLEAN FrLdrLoadNlsFile(PCSTR szFileName, PCSTR szModuleName);
#define USE_UI
-VOID RunLoader(VOID)
+VOID RunReactOSSetup(VOID)
{
ULONG i;
LPCSTR SourcePath;
diff --git a/reactos/boot/freeldr/freeldr/setupldr_main.rbuild b/reactos/boot/freeldr/freeldr/setupldr_main.rbuild
index d0151e397c5..8341ae67b01 100644
--- a/reactos/boot/freeldr/freeldr/setupldr_main.rbuild
+++ b/reactos/boot/freeldr/freeldr/setupldr_main.rbuild
@@ -4,11 +4,15 @@
include
include
+
-ffreestanding
-fno-builtin
-fno-inline
-fno-zero-initialized-in-bss
-Os
+
+ bootmgr.c
+
inffile.c