diff --git a/Contrib/Modern UI/Language files/TradChinese.nsh b/Contrib/Modern UI/Language files/TradChinese.nsh index a9eef299..4603a995 100644 --- a/Contrib/Modern UI/Language files/TradChinese.nsh +++ b/Contrib/Modern UI/Language files/TradChinese.nsh @@ -1,4 +1,4 @@ -;NSIS Modern User Interface - 語言檔案 +;NSIS Modern User Interface - Language File ;Compatible with Modern UI 1.6 ; Language: "Chinese (Traditional)" (1028) @@ -8,7 +8,7 @@ !insertmacro MUI_LANGUAGEFILE_BEGIN "TRADCHINESE" - !insertmacro MUI_LANGUAGEFILE_STRING MUI_LANGNAME "Chinese (Traditional)" ;以語言本身的方式,寫下語言名稱 + !insertmacro MUI_LANGUAGEFILE_STRING MUI_LANGNAME "Chinese (Traditional)" ;(以語言本身的方式,寫下語言名稱) Name of the language in the language itself !insertmacro MUI_LANGUAGEFILE_STRING MUI_NAME "${MUI_PRODUCT} ${MUI_VERSION}" @@ -16,7 +16,7 @@ !insertmacro MUI_LANGUAGEFILE_STRING MUI_TEXT_CONTINUE_INSTALL "按一下 [安裝(I)] 開始安裝過程。" !insertmacro MUI_LANGUAGEFILE_STRING MUI_TEXT_WELCOME_TITLE "歡迎使用 ${MUI_PRODUCT} 安裝精靈" - !insertmacro MUI_LANGUAGEFILE_STRING MUI_TEXT_WELCOME_INFO "這將在你的電腦安裝 ${MUI_PRODUCT} 。\r\n\r\n在開始安裝之前,建議您先關閉其他所有應用程式。這將允許安裝程式更新特定的系統檔案,而不需要重新啟動你的系統。\r\n\r\n" + !insertmacro MUI_LANGUAGEFILE_STRING MUI_TEXT_WELCOME_INFO "這將在你的電腦安裝 ${MUI_PRODUCT} 。\r\n\r\n在開始安裝之前,建議您先關閉其他所有應用程式。這將允許\安裝程式更新特定的系統檔案,而不需要重新啟動你的系統。\r\n\r\n" !insertmacro MUI_LANGUAGEFILE_STRING MUI_TEXT_LICENSE_TITLE "授權合約" !insertmacro MUI_LANGUAGEFILE_STRING MUI_TEXT_LICENSE_SUBTITLE "在安裝 ${MUI_PRODUCT} 之前,請檢閱授權條款。" diff --git a/Contrib/System/SysFunc.nsh b/Contrib/System/SysFunc.nsh index e79237d1..a4abe292 100644 --- a/Contrib/System/SysFunc.nsh +++ b/Contrib/System/SysFunc.nsh @@ -96,14 +96,16 @@ Function systemMessageBox ; may be Module is module handle? StrCpy $1 $2 - IntCmp $1 0 "0" smbnext smbnext - - ; Get module handle - System::Call '${sysGetModuleHandle}($2) .r1' - IntCmp $1 0 "0" smbnext smbnext + IntCmp $1 0 0 smbnext smbnext ; Load module and get handle System::Call '${sysLoadLibrary}($2) .r1' + IntCmp $1 0 "0" smbnext smbnext + + ; Get module handle. This may look stupid (to call GetModuleHandle in case + ; when the LoadLibrary doesn't works, but LoadLibrary couldn't return + ; a handle to starting process (for 'i 0'). + System::Call '${sysGetModuleHandle}($2) .r1' smbnext: ; Create MSGBOXPARAMS structure @@ -113,6 +115,12 @@ smbnext: ; free MSGBOXPARAMS structure System::Free $0 + ; have we got ready module handle at start? + IntCmp $2 0 0 smbskipfree smbskipfree + ; No, then free the module + System::Call '${sysFreeLibrary}(r1)' + +smbskipfree: System::Store "P0 l" FunctionEnd diff --git a/Contrib/System/System.nsh b/Contrib/System/System.nsh index a7cbadab..2c9c8757 100644 --- a/Contrib/System/System.nsh +++ b/Contrib/System/System.nsh @@ -27,6 +27,9 @@ ; HMODULE LoadLibrary(LPCTSTR lpFileName); !define sysLoadLibrary "kernel32::LoadLibraryA(t) i" +; BOOL FreeLibrary(HMODULE hModule); +!define sysFreeLibrary "kernel32::FreeLibrary(i) i" + ; HCURSOR LoadCursor(HINSTANCE hInstance, LPCTSTR lpCursorName); !define sysLoadCursor "user32::LoadCursorA(i, t) i" diff --git a/Contrib/System/System.nsi b/Contrib/System/System.nsi index c3bca8c6..52356cf7 100644 --- a/Contrib/System/System.nsi +++ b/Contrib/System/System.nsi @@ -103,9 +103,6 @@ enumex: ; End of drives or user cancel MessageBox MB_OK "GetFileSysTime example: file '$CMDLINE', year $1, month $2, dow $3, day $4, hour $5, min $6, sec $7, ms $8" - ; last plugin call must not have /NOUNLOAD so NSIS will be able to delete the temporary DLL - SetPluginUnload manual - ; free memory from SYSTEMTIME System::Free $R0 @@ -126,6 +123,11 @@ enumex: ; End of drives or user cancel ; Display splash result MessageBox MB_OK "Splash (callbacks) demo result $R0" + + ; last plugin call must not have /NOUNLOAD so NSIS will be able to delete the temporary DLL + SetPluginUnload manual + ; do nothing + System::Free 0 SectionEnd ; eof