Alexandre Julliard : uninstaller: Only load error strings when needed.

Alexandre Julliard julliard at winehq.org
Tue Mar 3 11:53:41 CST 2009


Module: wine
Branch: master
Commit: 1bd0690e5edc7ac8d3ec74d591cc636aea929159
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1bd0690e5edc7ac8d3ec74d591cc636aea929159

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Mar  3 12:35:35 2009 +0100

uninstaller: Only load error strings when needed.

---

 programs/uninstaller/main.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/programs/uninstaller/main.c b/programs/uninstaller/main.c
index 1eaa3f3..302d834 100644
--- a/programs/uninstaller/main.c
+++ b/programs/uninstaller/main.c
@@ -45,8 +45,6 @@ static unsigned int numentries = 0;
 static int list_need_update = 1;
 static int oldsel = -1;
 static WCHAR *sFilter;
-static WCHAR sAppName[MAX_STRING_LEN];
-static WCHAR sUninstallFailed[MAX_STRING_LEN];
 
 static int FetchUninstallInformation(void);
 static void UninstallProgram(void);
@@ -123,7 +121,6 @@ static void RemoveSpecificProgram(WCHAR *nameW)
 int wmain(int argc, WCHAR *argv[])
 {
     LPCWSTR token = NULL;
-    HINSTANCE hInst = GetModuleHandleW(0);
     static const WCHAR listW[] = { '-','-','l','i','s','t',0 };
     static const WCHAR removeW[] = { '-','-','r','e','m','o','v','e',0 };
     int i = 1;
@@ -156,10 +153,6 @@ int wmain(int argc, WCHAR *argv[])
         }
     }
 
-    /* Load MessageBox's strings */
-    LoadStringW(hInst, IDS_APPNAME, sAppName, sizeof(sAppName)/sizeof(WCHAR));
-    LoadStringW(hInst, IDS_UNINSTALLFAILED, sUninstallFailed, sizeof(sUninstallFailed)/sizeof(WCHAR));
-
     /* Start the GUI control panel */
     Control_RunDLL(GetDesktopWindow(), 0, "appwiz.cpl", SW_SHOW);
     return 1;
@@ -267,6 +260,12 @@ static void UninstallProgram(void)
         }
         else
         {
+            WCHAR sAppName[MAX_STRING_LEN];
+            WCHAR sUninstallFailed[MAX_STRING_LEN];
+            HINSTANCE hInst = GetModuleHandleW(0);
+
+            LoadStringW(hInst, IDS_APPNAME, sAppName, sizeof(sAppName)/sizeof(WCHAR));
+            LoadStringW(hInst, IDS_UNINSTALLFAILED, sUninstallFailed, sizeof(sUninstallFailed)/sizeof(WCHAR));
             wsprintfW(errormsg, sUninstallFailed, entries[i].command);
             if(MessageBoxW(0, errormsg, sAppName, MB_YESNO | MB_ICONQUESTION)==IDYES)
             {




More information about the wine-cvs mailing list