diff --git a/ReleaseGenerators/PascalABCNETMini.nsi b/ReleaseGenerators/PascalABCNETMini.nsi index 34c2a96a7..8acdbdcb2 100644 --- a/ReleaseGenerators/PascalABCNETMini.nsi +++ b/ReleaseGenerators/PascalABCNETMini.nsi @@ -3,6 +3,7 @@ OutFile "..\Release\PascalABCNETMiniSetup.exe" !include PascalABCNET_head.nsh !include PascalABCNET_sections_min.nsh !include PascalABCNET_end.nsh +!include "nsProcess.nsh" Function .onInit IfFileExists "$WINDIR\Microsoft.NET\Framework\v4.0.30319\System.dll" +3 0 @@ -11,4 +12,11 @@ Function .onInit !insertmacro MUI_LANGDLL_DISPLAY Goto exit exit: +checkprocess: + ${nsProcess::FindProcess} "PascalABCNET.exe" $R0 + StrCmp $R0 0 0 notRunning + MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION $(DESC_IsRunning) IDRETRY checkprocess IDCANCEL end + end: + Abort +notRunning: FunctionEnd \ No newline at end of file diff --git a/ReleaseGenerators/PascalABCNETStandart.nsi b/ReleaseGenerators/PascalABCNETStandart.nsi index f10b93309..235421773 100644 --- a/ReleaseGenerators/PascalABCNETStandart.nsi +++ b/ReleaseGenerators/PascalABCNETStandart.nsi @@ -3,6 +3,7 @@ OutFile "..\Release\PascalABCNETSetup.exe" !include PascalABCNET_head.nsh !include PascalABCNET_sections.nsh !include PascalABCNET_end.nsh +!include "nsProcess.nsh" Function .onInit IfFileExists "$WINDIR\Microsoft.NET\Framework\v4.0.30319\System.dll" +3 0 @@ -10,5 +11,12 @@ Function .onInit Abort !insertmacro MUI_LANGDLL_DISPLAY Goto exit - exit: +exit: +checkprocess: + ${nsProcess::FindProcess} "PascalABCNET.exe" $R0 + StrCmp $R0 0 0 notRunning + MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION $(DESC_IsRunning) IDRETRY checkprocess IDCANCEL end + end: + Abort +notRunning: FunctionEnd \ No newline at end of file diff --git a/ReleaseGenerators/PascalABCNET_end.nsh b/ReleaseGenerators/PascalABCNET_end.nsh index 9d58fdf19..ae6c116c9 100644 --- a/ReleaseGenerators/PascalABCNET_end.nsh +++ b/ReleaseGenerators/PascalABCNET_end.nsh @@ -51,7 +51,7 @@ SectionEnd ;Function .onInit -; !insertmacro MUI_LANGDLL_DISPLAY + ;FunctionEnd @@ -100,8 +100,8 @@ SectionEnd LangString DESC_ConsoleCompiler_Desc ${LANG_ENGLISH} " " LangString DESC_INTERNAL_ERROR_REPORT_Desc ${LANG_RUSSIAN} "Позволяет отправить разработчикам отчет о ошибках в работе компилятора" LangString DESC_INTERNAL_ERROR_REPORT_Desc ${LANG_ENGLISH} " " - LangString DESC_PT4_Desc ${LANG_RUSSIAN} "Электронный задачник Programming Taskbook Copyright (c)М.Э.Абрамян, 1998-2014" - LangString DESC_PT4_Desc ${LANG_ENGLISH} "Programming Taskbook Copyright (c) M.E. Abramyan, 1998-2014" + LangString DESC_PT4_Desc ${LANG_RUSSIAN} "Электронный задачник Programming Taskbook Copyright (c)М.Э.Абрамян, 1998-2017" + LangString DESC_PT4_Desc ${LANG_ENGLISH} "Programming Taskbook Copyright (c) M.E. Abramyan, 1998-2017" LangString DESC_Samples_Desc ${LANG_RUSSIAN} "Файлы примеров" LangString DESC_Samples_Desc ${LANG_ENGLISH} "Samples" LangString DESC_RusLoc_Desc ${LANG_RUSSIAN} "Поддержка русcкого языка" @@ -136,6 +136,8 @@ SectionEnd LangString DESC_Remove ${LANG_ENGLISH} "Remove" LangString DESC_PT4Setup ${LANG_RUSSIAN} "Настройка задачника PT4" LangString DESC_PT4Setup ${LANG_ENGLISH} "PT4 Setup" + LangString DESC_IsRunning ${LANG_RUSSIAN} "Невозможно начать установку, так как запущена среда PascalABC.NET. Закройте PascalABC.NET и нажмите Повторить" + LangString DESC_IsRunning ${LANG_ENGLISH} "PascalABC.NET is running. Please close it first" LicenseLangString MUILicense ${LANG_RUSSIAN} "License.rtf" LicenseLangString MUILicense ${LANG_ENGLISH} "License_en.rtf" diff --git a/ReleaseGenerators/nsProcess.nsh b/ReleaseGenerators/nsProcess.nsh new file mode 100644 index 000000000..9ef6098d2 --- /dev/null +++ b/ReleaseGenerators/nsProcess.nsh @@ -0,0 +1,28 @@ +!define nsProcess::FindProcess `!insertmacro nsProcess::FindProcess` + +!macro nsProcess::FindProcess _FILE _ERR + nsProcess::_FindProcess /NOUNLOAD `${_FILE}` + Pop ${_ERR} +!macroend + + +!define nsProcess::KillProcess `!insertmacro nsProcess::KillProcess` + +!macro nsProcess::KillProcess _FILE _ERR + nsProcess::_KillProcess /NOUNLOAD `${_FILE}` + Pop ${_ERR} +!macroend + +!define nsProcess::CloseProcess `!insertmacro nsProcess::CloseProcess` + +!macro nsProcess::CloseProcess _FILE _ERR + nsProcess::_CloseProcess /NOUNLOAD `${_FILE}` + Pop ${_ERR} +!macroend + + +!define nsProcess::Unload `!insertmacro nsProcess::Unload` + +!macro nsProcess::Unload + nsProcess::_Unload +!macroend diff --git a/Utils/NSIS/Unicode/Plugins/FindProcDLL.dll b/Utils/NSIS/Unicode/Plugins/FindProcDLL.dll new file mode 100644 index 000000000..22c8398f1 Binary files /dev/null and b/Utils/NSIS/Unicode/Plugins/FindProcDLL.dll differ diff --git a/Utils/NSIS/Unicode/Plugins/nsProcess.dll b/Utils/NSIS/Unicode/Plugins/nsProcess.dll new file mode 100644 index 000000000..2478624ee Binary files /dev/null and b/Utils/NSIS/Unicode/Plugins/nsProcess.dll differ