[REACTOS_SETUP]
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Thu, 29 Jan 2015 00:06:55 +0000 (00:06 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Thu, 29 Jan 2015 00:06:55 +0000 (00:06 +0000)
Show a critical error if txtsetup.sif cannot be found, instead of displaying empty fields in the setup. Patch by Lee Schroeder.
CORE-8971 #resolve #comment Fixed, thanks!

svn path=/trunk/; revision=66107

24 files changed:
reactos/base/setup/reactos/lang/bg-BG.rc
reactos/base/setup/reactos/lang/cs-CZ.rc
reactos/base/setup/reactos/lang/de-DE.rc
reactos/base/setup/reactos/lang/el-GR.rc
reactos/base/setup/reactos/lang/en-US.rc
reactos/base/setup/reactos/lang/es-ES.rc
reactos/base/setup/reactos/lang/et-EE.rc
reactos/base/setup/reactos/lang/fi-FI.rc
reactos/base/setup/reactos/lang/fr-FR.rc
reactos/base/setup/reactos/lang/he-IL.rc
reactos/base/setup/reactos/lang/hu-HU.rc
reactos/base/setup/reactos/lang/it-IT.rc
reactos/base/setup/reactos/lang/no-NO.rc
reactos/base/setup/reactos/lang/pl-PL.rc
reactos/base/setup/reactos/lang/pt-BR.rc
reactos/base/setup/reactos/lang/ro-RO.rc
reactos/base/setup/reactos/lang/ru-RU.rc
reactos/base/setup/reactos/lang/sk-SK.rc
reactos/base/setup/reactos/lang/sq-AL.rc
reactos/base/setup/reactos/lang/tr-TR.rc
reactos/base/setup/reactos/lang/uk-UA.rc
reactos/base/setup/reactos/lang/zh-CN.rc
reactos/base/setup/reactos/reactos.c
reactos/base/setup/reactos/resource.h

index 40c388e..72263b0 100644 (file)
@@ -144,4 +144,6 @@ BEGIN
     IDS_SUMMARYSUBTITLE "Списък на възможностите за слагане за проверка преди прилагане върху устройството за слагане"
     IDS_ABORTSETUP "РеактОС не е напълно сложен на компютъра ви. Ако излезете от настройването сега, ще трябва да пуснете настройването отново, за да сложите Реактос. Наистина ли излизате?"
     IDS_ABORTSETUP2 "Прекъсване на слагането?"
+    IDS_NO_TXTSETUP_SIF "Unable to find 'txtsetup.sif'\nSetup is unable to continue."
+    IDS_CAPTION "Настройка на РеактОС"
 END
index 78e2dd4..5f4f01c 100644 (file)
@@ -150,4 +150,6 @@ BEGIN
     IDS_SUMMARYSUBTITLE "Výpis voleb instalace k ověření před tím, než začne instalace"
     IDS_ABORTSETUP "Systém ReactOS není na tomto počítači kompletně nainstalovaný. Pokud nyní ukončíte instalaci, bude ji pro nainstalování systému ReactOS nutné provést znova. Opravdu ukončit?"
     IDS_ABORTSETUP2 "Přerušit instalaci?"
+    IDS_NO_TXTSETUP_SIF "Unable to find 'txtsetup.sif'\nSetup is unable to continue."
+    IDS_CAPTION "Instalace systému ReactOS"
 END
index 8f17bf9..5dd55d6 100644 (file)
@@ -144,4 +144,6 @@ BEGIN
     IDS_SUMMARYSUBTITLE "Liste alle Installationseinstellungen vor Anwendung auf die Geräte auf"
     IDS_ABORTSETUP "ReactOS ist nicht vollständig auf Ihrem Computer installiert. Wenn Sie das Setup verlassen, dann müssen Sie das Setup nochmals ausführen, um ReactOS zu installieren. Wirklich beenden?"
     IDS_ABORTSETUP2 "Installation abbrechen?"
+    IDS_NO_TXTSETUP_SIF "Unable to find 'txtsetup.sif'\nSetup is unable to continue."
+    IDS_CAPTION "ReactOS Setup"
 END
index 9122958..36b260c 100644 (file)
@@ -144,4 +144,6 @@ BEGIN
     IDS_SUMMARYSUBTITLE "List installation properties to check before apply to the installation device"
     IDS_ABORTSETUP "ReactOS is not completely installed on your computer. If you quit Setup now, you will need to run Setup again to install ReactOS. Really quit?"
     IDS_ABORTSETUP2 "Abort installation?"
+    IDS_NO_TXTSETUP_SIF "Unable to find 'txtsetup.sif'\nSetup is unable to continue."
+    IDS_CAPTION "ReactOS Setup"
 END
index 4674d61..9798cc7 100644 (file)
@@ -144,4 +144,6 @@ BEGIN
     IDS_SUMMARYSUBTITLE "List installation properties to check before apply to the installation device"
     IDS_ABORTSETUP "ReactOS is not completely installed on your computer. If you quit Setup now, you will need to run Setup again to install ReactOS. Really quit?"
     IDS_ABORTSETUP2 "Abort installation?"
+    IDS_NO_TXTSETUP_SIF "Unable to find 'txtsetup.sif'\nSetup is unable to continue"
+    IDS_CAPTION "ReactOS Setup"
 END
index 8729b12..56d6cdb 100644 (file)
@@ -146,4 +146,6 @@ BEGIN
     IDS_SUMMARYSUBTITLE "Lista las propiedades de la instalación para su verificación antes de aplicarlas al dispositivo instalado"
     IDS_ABORTSETUP "ReactOS no está completamente instalado en su equipo. Si sale de la instalación ahora, tendrá que ejecutar el instalador otra vez para instalar ReactOS. ¿Realmente quiere salir?"
     IDS_ABORTSETUP2 "¿Abortar instalación?"
+    IDS_NO_TXTSETUP_SIF "Unable to find 'txtsetup.sif'\nSetup is unable to continue."
+    IDS_CAPTION "Instalación de ReactOS"
 END
index 3d28fd8..df03b2c 100644 (file)
@@ -144,4 +144,6 @@ BEGIN
     IDS_SUMMARYSUBTITLE "Seadete kontrollimine enne paigaldamise alustamist"
     IDS_ABORTSETUP "ReactOS ei ole veel täielikult paigaldatud. Kas tõesti lahkuda?"
     IDS_ABORTSETUP2 "Katkestada paigaldamine?"
+    IDS_NO_TXTSETUP_SIF "Unable to find 'txtsetup.sif'\nSetup is unable to continue."
+    IDS_CAPTION "ReactOSi paigaldamine"
 END
index 7c41135..e49b03c 100644 (file)
@@ -144,4 +144,6 @@ BEGIN
     IDS_SUMMARYSUBTITLE "List installation properties to check before apply to the installation device"
     IDS_ABORTSETUP "ReactOS is not completely installed on your computer. If you quit Setup now, you will need to run Setup again to install ReactOS. Really quit?"
     IDS_ABORTSETUP2 "Abort installation?"
+    IDS_NO_TXTSETUP_SIF "Unable to find 'txtsetup.sif'\nSetup is unable to continue."
+    IDS_CAPTION "ReactOS Setup"
 END
index bf177f5..f3c6cf5 100644 (file)
@@ -144,4 +144,6 @@ BEGIN
     IDS_SUMMARYSUBTITLE "List installation properties to check before apply to the installation device"
     IDS_ABORTSETUP "ReactOS is not completely installed on your computer. If you quit Setup now, you will need to run Setup again to install ReactOS. Really quit?"
     IDS_ABORTSETUP2 "Abort installation?"
+    IDS_NO_TXTSETUP_SIF "Unable to find 'txtsetup.sif'\nSetup is unable to continue."
+    IDS_CAPTION "Installation de ReactOS"
 END
index 4e5334c..de9b543 100644 (file)
@@ -146,4 +146,6 @@ BEGIN
     IDS_SUMMARYSUBTITLE "List installation properties to check before apply to the installation device"
     IDS_ABORTSETUP "ReactOS is not completely installed on your computer. If you quit Setup now, you will need to run Setup again to install ReactOS. Really quit?"
     IDS_ABORTSETUP2 "Abort installation?"
+    IDS_NO_TXTSETUP_SIF "Unable to find 'txtsetup.sif'\nSetup is unable to continue."
+    IDS_CAPTION "התקנת ReactOS"
 END
index 6da6bdf..0abb64c 100644 (file)
@@ -146,4 +146,6 @@ BEGIN
     IDS_SUMMARYSUBTITLE "List installation properties to check before apply to the installation device"
     IDS_ABORTSETUP "ReactOS is not completely installed on your computer. If you quit Setup now, you will need to run Setup again to install ReactOS. Really quit?"
     IDS_ABORTSETUP2 "Abort installation?"
+    IDS_NO_TXTSETUP_SIF "Unable to find 'txtsetup.sif'\nSetup is unable to continue."
+    IDS_CAPTION "ReactOS Setup"
 END
index 3bbb707..4df30fa 100644 (file)
@@ -144,4 +144,6 @@ BEGIN
     IDS_SUMMARYSUBTITLE "Lista delle proprietà della installazione da controllare prima che siano eseguite sul dispositivo di installazione"
     IDS_ABORTSETUP "ReactOS non è installato completamente sul computer. Se interropete l'installazione ora sarà necessario eseguire l'installazione di nuovo. Volete procedere?"
     IDS_ABORTSETUP2 "Volete interrompere l'installazione?"
+    IDS_NO_TXTSETUP_SIF "Unable to find 'txtsetup.sif'\nSetup is unable to continue."
+    IDS_CAPTION "Installazione di ReactOS"
 END
index a80605a..c6884b8 100644 (file)
@@ -144,4 +144,6 @@ BEGIN
     IDS_SUMMARYSUBTITLE "Sjekk listen av installasjon egenskapene før du fortsetter installasjon av enhetene"
     IDS_ABORTSETUP "ReactOS er ikke fullstendig installert på datamaskinen. Hvis du avslutter nå, trenger du å kjøre installeringen på nytt for å installere ReactOS. Vil du virkelig avslutte?"
     IDS_ABORTSETUP2 "Avbryt installasjonen?"
+    IDS_NO_TXTSETUP_SIF "Unable to find 'txtsetup.sif'\nSetup is unable to continue."
+    IDS_CAPTION "ReactOS installering"
 END
index 3696fae..6b06d87 100644 (file)
@@ -154,4 +154,6 @@ BEGIN
     IDS_SUMMARYSUBTITLE "Sprawdź ustawienia instalacji przed dokonaniem zmian na dysku"
     IDS_ABORTSETUP "Instalacja ReactOS nie została ukończona na tym komputerze. Jeśli teraz zakończysz instalację, będziesz musiał uruchomić Instalator ponownie, aby zainstalować ReactOS. Na pewno zakończyć?"
     IDS_ABORTSETUP2 "Przerwać instalację?"
+    IDS_NO_TXTSETUP_SIF "Unable to find 'txtsetup.sif'\nSetup is unable to continue."
+    IDS_CAPTION "Instalator ReactOS"
 END
index 111beb3..98a876f 100644 (file)
@@ -144,4 +144,6 @@ BEGIN
     IDS_SUMMARYSUBTITLE "Listar propriedades da instalação para verificação antes de aplicá-las na instalação dos despositivos"
     IDS_ABORTSETUP "ReactOS não está totalmente instalado em seu computador. Se você sair da Instalação agora, você precisará executar o Instalador novamente para instalar o ReactOS. Tem certeza que deseja sair?"
     IDS_ABORTSETUP2 "Abortar instalação?"
+    IDS_NO_TXTSETUP_SIF "Unable to find 'txtsetup.sif'\nSetup is unable to continue."
+    IDS_CAPTION "Instalação do ReactOS"
 END
index 7e27fcb..6a9bbe8 100644 (file)
@@ -153,4 +153,6 @@ BEGIN
     IDS_SUMMARYSUBTITLE "Lista cu opțiuni de instalare ce necesită verificare înainte de a continua instalarea."
     IDS_ABORTSETUP "ReactOS încă nu este complet instalat în calculator. Daca întrerupeți procesul de instalare, pentru a instala va fi necesară repetarea pașilor parcurși până acum. Sigur doriți asta?"
     IDS_ABORTSETUP2 "Abandonați instalarea?"
+    IDS_NO_TXTSETUP_SIF "Unable to find 'txtsetup.sif'\nSetup is unable to continue."
+    IDS_CAPTION "Asistentul de instalare ReactOS"
 END
index 089163b..46aa46c 100644 (file)
@@ -144,4 +144,6 @@ BEGIN
     IDS_SUMMARYSUBTITLE "Проверьте список параметров перед началом установки"
     IDS_ABORTSETUP "ReactOS установлен на компьютер не полностью. Если вы закроете программу установки сейчас, в дальнейшем вам придется повторить установку ReactOS. Вы уверены, что необходимо прервать установку?"
     IDS_ABORTSETUP2 "Прервать установку?"
+    IDS_NO_TXTSETUP_SIF "Unable to find 'txtsetup.sif'\nSetup is unable to continue."
+    IDS_CAPTION "Установка ReactOS"
 END
index eb1ce9b..13a73a3 100644 (file)
@@ -149,4 +149,6 @@ BEGIN
     IDS_SUMMARYSUBTITLE "List installation properties to check before apply to the installation device"
     IDS_ABORTSETUP "ReactOS is not completely installed on your computer. If you quit Setup now, you will need to run Setup again to install ReactOS. Naozaj skončiť?"
     IDS_ABORTSETUP2 "Prerušiť inštaláciu?"
+    IDS_NO_TXTSETUP_SIF "Unable to find 'txtsetup.sif'\nSetup is unable to continue."
+    IDS_CAPTION "ReactOS Setup"
 END
index 013ddb0..9c4dd3a 100644 (file)
@@ -146,4 +146,6 @@ BEGIN
     IDS_SUMMARYSUBTITLE "Listo të dhënat e instalimit për të kontrolluar para së të aplikohen për pajisjet e instalimit/kompjuterit"
     IDS_ABORTSETUP "ReactOS nuk është instaluar plotësisht në kompjuterin tuaj. Nëse ju dilni nga instalimi tani, do ju duhet të filloni instalimin përsëri për të instalumar ReactOS. Doni ta mbyllni?"
     IDS_ABORTSETUP2 "Ndërpritni Instalimin?"
+    IDS_NO_TXTSETUP_SIF "Unable to find 'txtsetup.sif'\nSetup is unable to continue."
+    IDS_CAPTION "ReactOS Setup"
 END
index 3d26c85..0d4156f 100644 (file)
@@ -146,4 +146,6 @@ BEGIN
     IDS_SUMMARYSUBTITLE "Kurulumdan aygıtına uygulanmadan önce gözden geçirmek için dizelgelenen kurulum seçenekleri."
     IDS_ABORTSETUP "ReactOS bilgisayarınıza tümüyle kurulmadı. Eğer şimdi Kur'dan çıkarsanız, ReactOS'u kurmak için Kur'u yeniden çalıştırmayı isteybilirsiniz. Gerçekten çıkılsın mı?"
     IDS_ABORTSETUP2 "Kurulum iptal edilsin mi?"
+    IDS_NO_TXTSETUP_SIF "Unable to find 'txtsetup.sif'\nSetup is unable to continue."
+    IDS_CAPTION "ReactOS Kur"
 END
index 4254d10..bf93520 100644 (file)
@@ -152,4 +152,6 @@ BEGIN
     IDS_SUMMARYSUBTITLE "Перевірте список властивостей встановлення, перш ніж почати встановлення системи"
     IDS_ABORTSETUP "ReactOS встановлений на комп'ютер не повністю. Якщо ви закриєте програму встановлення зараз, в подальшому вам доведеться повторити встановлення ReactOS. Ви впевнені, що необхідно перервати встановлення?"
     IDS_ABORTSETUP2 "Перервати встановлення?"
+    IDS_NO_TXTSETUP_SIF "Unable to find 'txtsetup.sif'\nSetup is unable to continue."
+    IDS_CAPTION "Встановлення ReactOS"
 END
index c11955e..f2330ec 100644 (file)
@@ -144,4 +144,6 @@ BEGIN
     IDS_SUMMARYSUBTITLE "正是安装前列出安装属性以供检查"
     IDS_ABORTSETUP "ReactOS 未在您的电脑上安装完成。如果您现在退出安装程序,您需要在一次运行安装程序来安装 ReactOS。 确定退出?"
     IDS_ABORTSETUP2 "终止安装?"
+    IDS_NO_TXTSETUP_SIF "Unable to find 'txtsetup.sif'\nSetup is unable to continue."
+    IDS_CAPTION "ReactOS 安装"
 END
index 416c2f3..2f81fc4 100644 (file)
@@ -989,7 +989,7 @@ RestartDlgProc(HWND hwndDlg,
     return FALSE;
 }
 
-void LoadSetupData()
+BOOL LoadSetupData(void)
 {
     WCHAR szPath[MAX_PATH];
     TCHAR tmp[10];
@@ -1007,115 +1007,126 @@ void LoadSetupData()
 
     wcscat(szPath, L"\\txtsetup.sif");
     hTxtsetupSif = SetupOpenInfFileW(szPath, NULL, INF_STYLE_OLDNT, NULL);
-    if (hTxtsetupSif != INVALID_HANDLE_VALUE)
+    if (hTxtsetupSif == INVALID_HANDLE_VALUE)
     {
-        // get language list
-        SetupData.LangCount = SetupGetLineCount(hTxtsetupSif, _T("Language"));
-        if (SetupData.LangCount > 0)
+        TCHAR message[512], caption[64];
+
+        // txtsetup.sif cannot be found
+        LoadString(hInstance, IDS_NO_TXTSETUP_SIF, message, sizeof(message)/sizeof(TCHAR));
+        LoadString(hInstance, IDS_CAPTION, caption, sizeof(caption)/sizeof(TCHAR));
+
+        MessageBox(NULL, message, caption, MB_OK | MB_ICONERROR);
+        return FALSE;
+    }
+
+    // get language list
+    SetupData.LangCount = SetupGetLineCount(hTxtsetupSif, _T("Language"));
+    if (SetupData.LangCount > 0)
+    {
+        SetupData.pLanguages = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LANG) * SetupData.LangCount);
+        if (SetupData.pLanguages != NULL)
         {
-            SetupData.pLanguages = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(LANG) * SetupData.LangCount);
-            if (SetupData.pLanguages != NULL)
+            Count = 0;
+            if (SetupFindFirstLine(hTxtsetupSif, _T("Language"), NULL, &InfContext))
             {
-                Count = 0;
-                if (SetupFindFirstLine(hTxtsetupSif, _T("Language"), NULL, &InfContext))
+                do
                 {
-                    do
-                    {
-                        SetupGetStringField(&InfContext,
-                                            0,
-                                            SetupData.pLanguages[Count].LangId,
-                                            sizeof(SetupData.pLanguages[Count].LangId) / sizeof(TCHAR),
-                                            &LineLength);
-
-                        SetupGetStringField(&InfContext,
-                                            1,
-                                            SetupData.pLanguages[Count].LangName,
-                                            sizeof(SetupData.pLanguages[Count].LangName) / sizeof(TCHAR),
-                                            &LineLength);
-                        ++Count;
-                    }
-                    while (SetupFindNextLine(&InfContext, &InfContext) && Count < SetupData.LangCount);
+                    SetupGetStringField(&InfContext,
+                                        0,
+                                        SetupData.pLanguages[Count].LangId,
+                                        sizeof(SetupData.pLanguages[Count].LangId) / sizeof(TCHAR),
+                                        &LineLength);
+
+                    SetupGetStringField(&InfContext,
+                                        1,
+                                        SetupData.pLanguages[Count].LangName,
+                                        sizeof(SetupData.pLanguages[Count].LangName) / sizeof(TCHAR),
+                                        &LineLength);
+                    ++Count;
                 }
+                while (SetupFindNextLine(&InfContext, &InfContext) && Count < SetupData.LangCount);
             }
         }
+    }
 
-        // get keyboard layout list
-        SetupData.KbLayoutCount = SetupGetLineCount(hTxtsetupSif, _T("KeyboardLayout"));
-        if (SetupData.KbLayoutCount > 0)
+    // get keyboard layout list
+    SetupData.KbLayoutCount = SetupGetLineCount(hTxtsetupSif, _T("KeyboardLayout"));
+    if (SetupData.KbLayoutCount > 0)
+    {
+        SetupData.pKbLayouts = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(KBLAYOUT) * SetupData.KbLayoutCount);
+        if (SetupData.pKbLayouts != NULL)
         {
-            SetupData.pKbLayouts = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(KBLAYOUT) * SetupData.KbLayoutCount);
-            if (SetupData.pKbLayouts != NULL)
+            Count = 0;
+            if (SetupFindFirstLine(hTxtsetupSif, _T("KeyboardLayout"), NULL, &InfContext))
             {
-                Count = 0;
-                if (SetupFindFirstLine(hTxtsetupSif, _T("KeyboardLayout"), NULL, &InfContext))
+                do
                 {
-                    do
-                    {
-                        SetupGetStringField(&InfContext,
-                                            0,
-                                            SetupData.pKbLayouts[Count].LayoutId,
-                                            sizeof(SetupData.pKbLayouts[Count].LayoutId) / sizeof(TCHAR),
-                                            &LineLength);
-
-                        SetupGetStringField(&InfContext,
-                                            1,
-                                            SetupData.pKbLayouts[Count].LayoutName,
-                                            sizeof(SetupData.pKbLayouts[Count].LayoutName) / sizeof(TCHAR),
-                                            &LineLength);
-                        ++Count;
-                    }
-                    while (SetupFindNextLine(&InfContext, &InfContext) && Count < SetupData.KbLayoutCount);
+                    SetupGetStringField(&InfContext,
+                                        0,
+                                        SetupData.pKbLayouts[Count].LayoutId,
+                                        sizeof(SetupData.pKbLayouts[Count].LayoutId) / sizeof(TCHAR),
+                                        &LineLength);
+
+                    SetupGetStringField(&InfContext,
+                                        1,
+                                        SetupData.pKbLayouts[Count].LayoutName,
+                                        sizeof(SetupData.pKbLayouts[Count].LayoutName) / sizeof(TCHAR),
+                                        &LineLength);
+                    ++Count;
                 }
+                while (SetupFindNextLine(&InfContext, &InfContext) && Count < SetupData.KbLayoutCount);
             }
         }
+    }
 
-        // get default for keyboard and language
-        SetupData.DefaultKBLayout = -1;
-        SetupData.DefaultLang = -1;
+    // get default for keyboard and language
+    SetupData.DefaultKBLayout = -1;
+    SetupData.DefaultLang = -1;
 
-        // TODO: get defaults from underlaying running system
-        if (SetupFindFirstLine(hTxtsetupSif, _T("NLS"), _T("DefaultLayout"), &InfContext))
-        {
-            SetupGetStringField(&InfContext, 1, tmp, sizeof(tmp) / sizeof(TCHAR), &LineLength);
-            for (Count = 0; Count < SetupData.KbLayoutCount; Count++)
-                if (_tcscmp(tmp, SetupData.pKbLayouts[Count].LayoutId) == 0)
-                {
-                    SetupData.DefaultKBLayout = Count;
-                    break;
-                }
-        }
+    // TODO: get defaults from underlaying running system
+    if (SetupFindFirstLine(hTxtsetupSif, _T("NLS"), _T("DefaultLayout"), &InfContext))
+    {
+        SetupGetStringField(&InfContext, 1, tmp, sizeof(tmp) / sizeof(TCHAR), &LineLength);
+        for (Count = 0; Count < SetupData.KbLayoutCount; Count++)
+            if (_tcscmp(tmp, SetupData.pKbLayouts[Count].LayoutId) == 0)
+            {
+                SetupData.DefaultKBLayout = Count;
+                break;
+            }
+    }
 
-        if (SetupFindFirstLine(hTxtsetupSif, _T("NLS"), _T("DefaultLanguage"), &InfContext))
-        {
-            SetupGetStringField(&InfContext, 1, tmp, sizeof(tmp) / sizeof(TCHAR), &LineLength);
-            for (Count = 0; Count < SetupData.LangCount; Count++)
-                if (_tcscmp(tmp, SetupData.pLanguages[Count].LangId) == 0)
-                {
-                    SetupData.DefaultLang = Count;
-                    break;
-                }
-        }
+    if (SetupFindFirstLine(hTxtsetupSif, _T("NLS"), _T("DefaultLanguage"), &InfContext))
+    {
+        SetupGetStringField(&InfContext, 1, tmp, sizeof(tmp) / sizeof(TCHAR), &LineLength);
+        for (Count = 0; Count < SetupData.LangCount; Count++)
+            if (_tcscmp(tmp, SetupData.pLanguages[Count].LangId) == 0)
+            {
+                SetupData.DefaultLang = Count;
+                break;
+            }
+    }
 
-        // get computers list
-        SetupData.CompCount = LoadGenentry(hTxtsetupSif,_T("Computer"),&SetupData.pComputers,&InfContext);
+    // get computers list
+    SetupData.CompCount = LoadGenentry(hTxtsetupSif,_T("Computer"),&SetupData.pComputers,&InfContext);
 
-        // get display list
-        SetupData.DispCount = LoadGenentry(hTxtsetupSif,_T("Display"),&SetupData.pDisplays,&InfContext);
+    // get display list
+    SetupData.DispCount = LoadGenentry(hTxtsetupSif,_T("Display"),&SetupData.pDisplays,&InfContext);
 
-        // get keyboard list
-        SetupData.KeybCount = LoadGenentry(hTxtsetupSif, _T("Keyboard"),&SetupData.pKeyboards,&InfContext);
+    // get keyboard list
+    SetupData.KeybCount = LoadGenentry(hTxtsetupSif, _T("Keyboard"),&SetupData.pKeyboards,&InfContext);
 
-        // get install directory
-        if (SetupFindFirstLine(hTxtsetupSif, _T("SetupData"), _T("DefaultPath"), &InfContext))
-        {
-            SetupGetStringField(&InfContext,
-                                1,
-                                SetupData.InstallDir,
-                                sizeof(SetupData.InstallDir) / sizeof(TCHAR),
-                                &LineLength);
-        }
-        SetupCloseInfFile(hTxtsetupSif);
+    // get install directory
+    if (SetupFindFirstLine(hTxtsetupSif, _T("SetupData"), _T("DefaultPath"), &InfContext))
+    {
+        SetupGetStringField(&InfContext,
+                            1,
+                            SetupData.InstallDir,
+                            sizeof(SetupData.InstallDir) / sizeof(TCHAR),
+                            &LineLength);
     }
+    SetupCloseInfFile(hTxtsetupSif);
+
+    return TRUE;
 }
 
 LONG LoadGenentry(HINF hinf,PCTSTR name,PGENENTRY *gen,PINFCONTEXT context)
@@ -1211,8 +1222,8 @@ _tWinMain(HINSTANCE hInst,
     LoadString(hInst,IDS_ABORTSETUP2, abort_title,sizeof(abort_title)/sizeof(TCHAR));
     if (!isUnattend)
     {
-
-        LoadSetupData();
+        if (!LoadSetupData())
+            return 0;
 
         /* Create the Start page, until setup is working */
         psp.dwSize = sizeof(PROPSHEETPAGE);
index 00cc9c8..3d3114e 100644 (file)
@@ -59,5 +59,7 @@
 #define IDS_SUMMARYTITLE     2050
 #define IDS_SUMMARYSUBTITLE  2051
 #define IDC_DEVICEDRIVER     2052
+#define IDS_NO_TXTSETUP_SIF  2053
+#define IDS_CAPTION          2054
 
 #define IDI_MAIN 3000