Skip to content

Commit e974498

Browse files
committed
[Enhance] Prevent tool from running in safe mode
1 parent 016a31c commit e974498

6 files changed

Lines changed: 14 additions & 3 deletions

File tree

Languages/lang_en.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ ErrorPanel_Description = "An internal error occurred:{crlf;}{crlf;}{0}{crlf;}{cr
9090
IncompatibleCCPMessage = "Please resolve checks that failed and try again."
9191
Win7Message = "This program is incompatible with Windows 7 and Server 2008 R2.{crlf;}This program uses the DISM API, which requires files from the Assessment and Deployment Kit (ADK). However, support for Windows 7 is not included.{crlf;}{crlf;}The program will be closed."
9292
RunAsAdminMessage = "This program must be run as an administrator.{crlf;}There are certain software configurations in which Windows will run this program without admin privileges, so you must ask for them manually.{crlf;}{crlf;}Right-click the executable, and select {quot;}Run as administrator{quot;}"
93+
SafeModeNotSupported = "You cannot run Sysprep on a computer in Safe Mode."
9394
AboutMessage = "Sysprep Preparation Tool, version {0}_{1}{crlf;}- Program: {2}. Further expansion and testing made by Real-MullaC{crlf;}- DISM API: (c) {3}{crlf;}- INI File Parser: (c) {4}"
9495
AutoMode_WarningsDetected = "The following checks returned warnings:{crlf;}{crlf;}{0}{crlf;}It is recommended that you read what these returned. You can continue, but Sysprep may fail to run.{crlf;}{crlf;}Do you want to continue?"
9596

Languages/lang_es.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ ErrorPanel_Description = "Se produjo un error interno:{crlf;}{crlf;}{0}{crlf;}{c
9090
IncompatibleCCPMessage = "Resuelva las comprobaciones que hayan fallado e inténtelo de nuevo."
9191
Win7Message = "Este programa es incompatible con Windows 7 y Server 2008 R2.{crlf;}Este programa utiliza la API de DISM, que requiere archivos del Kit de Implementación y Evaluación (ADK). Sin embargo, este kit no soporta Windows 7.{crlf;}{crlf;}El programa se cerrará."
9292
RunAsAdminMessage = "Este programa debe ejecutarse como administrador.{crlf;}Hay ciertas configuraciones de software en las que Windows ejecutará este programa sin permisos de administrador, por lo que debe solicitarlos manualmente.{crlf;}{crlf;}Haga clic derecho en este programa y haga clic en {quot;}Ejecutar como administrador{quot;}"
93+
SafeModeNotSupported = "No puede ejecutar Sysprep en un equipo en Modo Seguro."
9394
AboutMessage = "Herramienta de preparación de Sysprep, versión {0}_{1}{crlf;}- Programa: {2}. Expansión y pruebas realizadas por Real-MullaC{crlf;}- DISM API: (c) {3}- INI File Parser: (c) {4}"
9495
AutoMode_WarningsDetected = "Las siguientes comprobaciones completaron con advertencias:{crlf;}{crlf;}{0}{crlf;}Le recomendamos que lea lo que estas comprobaciones devolvieron. Puede continuar, pero Sysprep podría fallar.{crlf;}{crlf;}¿Desea continuar?"
9596

Languages/lang_fr.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
; language file if you contributed to improve it.
2828
[LanguageFileInformation]
2929
LanguageName = "French Language Pack"
30-
LanguageAuthor = "CodingWonders"
30+
LanguageAuthor = "CodingWonders/DeepL"
3131

3232
; Everything after this comment is specific to the language translation. It's
3333
; recommended to go from top to bottom of the window.
@@ -90,6 +90,7 @@ ErrorPanel_Description = "Une erreur interne est survenue :{crlf;}{crlf;}{0}{crl
9090
IncompatibleCCPMessage = "Veuillez résoudre les vérifications échouées et réessayer."
9191
Win7Message = "Ce programme est incompatible avec Windows 7 et Server 2008 R2.{crlf;}Ce programme utilise l’API DISM, qui nécessite des fichiers provenant du Kit d’évaluation et de déploiement (ADK). Cependant, la prise en charge de Windows 7 n’est pas incluse.{crlf;}{crlf;}Le programme va être fermé."
9292
RunAsAdminMessage = "Ce programme doit être exécuté en tant qu’administrateur.{crlf;}Dans certaines configurations logicielles, Windows peut exécuter ce programme sans privilèges administratifs, vous devez donc les demander manuellement.{crlf;}{crlf;}Faites un clic droit sur l’exécutable et sélectionnez {quot;}Exécuter en tant qu’administrateur{quot;}"
93+
SafeModeNotSupported = "Vous ne pouvez pas exécuter Sysprep sur un ordinateur en mode sans échec."
9394
AboutMessage = "Outil de préparation Sysprep, version {0}_{1}{crlf;}- Programme : {2}. Développements et tests supplémentaires par Real-MullaC{crlf;}- API DISM : (c) {3}- INI File Parser: (c) {4}"
9495
AutoMode_WarningsDetected = "Les vérifications suivantes ont renvoyé des avertissements:{crlf;}{crlf;}{0}{crlf;}Il est recommandé de lire ces résultats. Vous pouvez continuer, mais Sysprep pourrait ne pas s’exécuter.{crlf;}{crlf;}Voulez-vous continuer ?"
9596

Languages/lang_it.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
; language file if you contributed to improve it.
2828
[LanguageFileInformation]
2929
LanguageName = "Italian Language Pack"
30-
LanguageAuthor = "CodingWonders"
30+
LanguageAuthor = "CodingWonders/DeepL"
3131

3232
; Everything after this comment is specific to the language translation. It's
3333
; recommended to go from top to bottom of the window.
@@ -90,6 +90,7 @@ ErrorPanel_Description = "Si è verificato un errore interno:{crlf;}{crlf;}{0}{c
9090
IncompatibleCCPMessage = "Risolvi i controlli non superati e riprova."
9191
Win7Message = "Questo programma non è compatibile con Windows 7 e Server 2008 R2.{crlf;}Questo programma utilizza l’API DISM, che richiede file dal Kit di valutazione e distribuzione (ADK). Tuttavia, il supporto per Windows 7 non è incluso.{crlf;}{crlf;}Il programma verrà chiuso."
9292
RunAsAdminMessage = "Questo programma deve essere eseguito come amministratore.{crlf;}In alcune configurazioni, Windows potrebbe eseguirlo senza privilegi di amministratore, quindi devi richiederli manualmente.{crlf;}{crlf;}Fai clic destro sull’eseguibile e seleziona {quot;}Esegui come amministratore{quot;}"
93+
SafeModeNotSupported = "Non è possibile eseguire Sysprep su un computer in modalità provvisoria."
9394
AboutMessage = "Strumento di preparazione Sysprep, versione {0}_{1}{crlf;}- Programma: {2}. Ulteriori sviluppi e test di Real-MullaC{crlf;}- API DISM: (c) {3}- INI File Parser: (c) {4}"
9495
AutoMode_WarningsDetected = "I seguenti controlli hanno restituito degli avvisi:{crlf;}{crlf;}{0}{crlf;}Si consiglia di leggere quanto riportato. È possibile continuare, ma Sysprep potrebbe non avviarsi.{crlf;}{crlf;}Vuoi continuare?"
9596

Languages/lang_pt.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
; language file if you contributed to improve it.
2828
[LanguageFileInformation]
2929
LanguageName = "Portuguese Language Pack"
30-
LanguageAuthor = "CodingWonders"
30+
LanguageAuthor = "CodingWonders/DeepL"
3131

3232
; Everything after this comment is specific to the language translation. It's
3333
; recommended to go from top to bottom of the window.
@@ -90,6 +90,7 @@ ErrorPanel_Description = "Ocorreu um erro interno:{crlf;}{crlf;}{0}{crlf;}{crlf;
9090
IncompatibleCCPMessage = "Resolva as verificações que falharam e tente novamente."
9191
Win7Message = "Este programa é incompatível com Windows 7 e Server 2008 R2.{crlf;}Este programa utiliza a API DISM, que requer ficheiros do Kit de Avaliação e Implementação (ADK). No entanto, o suporte para Windows 7 não está incluído.{crlf;}{crlf;}O programa será encerrado."
9292
RunAsAdminMessage = "Este programa deve ser executado como administrador.{crlf;}Em certas configurações de software, o Windows pode executar este programa sem privilégios de administrador, pelo que deve pedir esses privilégios manualmente.{crlf;}{crlf;}Clique com o botão direito no executável e selecione {quot;}Executar como administrador{quot;}"
93+
SafeModeNotSupported = "Não é possível executar o Sysprep num computador em modo de segurança."
9394
AboutMessage = "Ferramenta de Preparação do Sysprep, versão {0}_{1}{crlf;}- Programa: {2}. Expansões e testes adicionais por Real-MullaC{crlf;}- API DISM: (c) {3}- INI File Parser: (c) {4}"
9495
AutoMode_WarningsDetected = "As seguintes verificações devolveram avisos:{crlf;}{crlf;}{0}{crlf;}Recomenda-se que leia os resultados. Pode continuar, mas o Sysprep poderá falhar ao executar.{crlf;}{crlf;}Deseja continuar?"
9596

MainForm.vb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,12 @@ Public Class MainForm
509509
MsgBox(GetValueFromLanguageData("MainForm.RunAsAdminMessage"), vbOKOnly + vbCritical, GetValueFromLanguageData("MainForm.WndTitle"))
510510
Environment.Exit(1)
511511
End If
512+
' Prevent tool from running in Safe Mode
513+
If SystemInformation.BootMode <> BootMode.Normal Then
514+
DynaLog.LogMessage("This system is in Safe Mode.")
515+
MsgBox(GetValueFromLanguageData("MainForm.SafeModeNotSupported"), vbOKOnly + vbCritical, GetValueFromLanguageData("MainForm.WndTitle"))
516+
Environment.Exit(1)
517+
End If
512518
OriginalWindowState = WindowState
513519
OriginalWindowBounds = Bounds
514520
FormBorderStyle = FormBorderStyle.None

0 commit comments

Comments
 (0)