msi: Inform the user with an error message when the MSI file path is invalid [try2]

James Hawkins truiken at gmail.com
Thu Aug 24 14:34:51 CDT 2006


Hi,

This version shows the user the following message:

"The specified installation package could not be opened.  Please check
the file path and try again."

This fixes bug 4404 and matches native behavior.
http://bugs.winehq.org/show_bug.cgi?id=4404


Changelog:
* Inform the user with an error message when the MSI file path is invalid.

 dlls/msi/helpers.c |   15 +++++++++++++++
 dlls/msi/msi_Bg.rc |    1 +
 dlls/msi/msi_De.rc |    1 +
 dlls/msi/msi_En.rc |    1 +
 dlls/msi/msi_Eo.rc |    1 +
 dlls/msi/msi_Es.rc |    1 +
 dlls/msi/msi_Fi.rc |    1 +
 dlls/msi/msi_Fr.rc |    1 +
 dlls/msi/msi_Hu.rc |    1 +
 dlls/msi/msi_It.rc |    1 +
 dlls/msi/msi_Ko.rc |    1 +
 dlls/msi/msi_Nl.rc |    1 +
 dlls/msi/msi_No.rc |    1 +
 dlls/msi/msi_Pt.rc |    1 +
 dlls/msi/msi_Ru.rc |    1 +
 dlls/msi/msi_Tr.rc |    1 +
 dlls/msi/package.c |    7 +++++++
 17 files changed, 37 insertions(+), 0 deletions(-)

-- 
James Hawkins
-------------- next part --------------
diff --git a/dlls/msi/helpers.c b/dlls/msi/helpers.c
index 51184d5..33a7fa2 100644
--- a/dlls/msi/helpers.c
+++ b/dlls/msi/helpers.c
@@ -1008,3 +1008,18 @@ WCHAR* generate_error_string(MSIPACKAGE 
     data = NULL;
     return data;
 }
+
+void msi_ui_error( DWORD msg_id, DWORD type )
+{
+    WCHAR text[2048];
+
+    static const WCHAR title[] = {
+        'W','i','n','d','o','w','s',' ','I','n','s','t','a','l','l','e','r',0
+    };
+
+    if (!MsiLoadStringW( -1, msg_id, text, sizeof(text) / sizeof(text[0]),
+                         MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL) ))
+        return;
+
+    MessageBoxW( NULL, text, title, type );
+}
diff --git a/dlls/msi/msi_Bg.rc b/dlls/msi/msi_Bg.rc
index d5818ef..53b0775 100644
--- a/dlls/msi/msi_Bg.rc
+++ b/dlls/msi/msi_Bg.rc
@@ -22,6 +22,7 @@ LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT
 
 STRINGTABLE DISCARDABLE
 {
+	4 "The specified installation package could not be opened.  Please check the file path and try again."
 	5 "????? %s ?? ? ???????"
 	9 "????????? ???? %s"
 	10 "?????????? ?????????"
diff --git a/dlls/msi/msi_De.rc b/dlls/msi/msi_De.rc
index c07a3eb..9c1ef66 100644
--- a/dlls/msi/msi_De.rc
+++ b/dlls/msi/msi_De.rc
@@ -22,6 +22,7 @@ LANGUAGE LANG_GERMAN, SUBLANG_DEFAULT
 
 STRINGTABLE DISCARDABLE
 {
+	4 "The specified installation package could not be opened.  Please check the file path and try again."
 	5 "Der Pfad %s wurde nicht gefunden."
 	9 "Bitte Disk %s einlegen."
 	10 "schlechte Parameter"
diff --git a/dlls/msi/msi_En.rc b/dlls/msi/msi_En.rc
index 066d812..e51d9ed 100644
--- a/dlls/msi/msi_En.rc
+++ b/dlls/msi/msi_En.rc
@@ -22,6 +22,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
 
 STRINGTABLE DISCARDABLE
 {
+	4 "The specified installation package could not be opened.  Please check the file path and try again."
 	5 "path %s not found"
 	9 "insert disk %s"
 	10 "bad parameters"
diff --git a/dlls/msi/msi_Eo.rc b/dlls/msi/msi_Eo.rc
index 5b050c1..cd8a41e 100644
--- a/dlls/msi/msi_Eo.rc
+++ b/dlls/msi/msi_Eo.rc
@@ -22,6 +22,7 @@ LANGUAGE LANG_ESPERANTO, SUBLANG_DEFAULT
 
 STRINGTABLE DISCARDABLE
 {
+	4 "The specified installation package could not be opened.  Please check the file path and try again."
 	5 "Mi ne trovis la vojon %s"
 	9 "en?ovu la diskon %s"
 	10 "nekorektaj parametroj"
diff --git a/dlls/msi/msi_Es.rc b/dlls/msi/msi_Es.rc
index 43e7652..c873ec0 100644
--- a/dlls/msi/msi_Es.rc
+++ b/dlls/msi/msi_Es.rc
@@ -22,6 +22,7 @@ LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
 
 STRINGTABLE DISCARDABLE
 {
+	4 "The specified installation package could not be opened.  Please check the file path and try again."
 	5 "ruta %s no encontrada"
 	9 "inserte el disco %s"
 	10 "par?metros incorrectos"
diff --git a/dlls/msi/msi_Fi.rc b/dlls/msi/msi_Fi.rc
index 18686d9..82cb2a7 100644
--- a/dlls/msi/msi_Fi.rc
+++ b/dlls/msi/msi_Fi.rc
@@ -22,6 +22,7 @@ LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT
 
 STRINGTABLE DISCARDABLE
 {
+	4 "The specified installation package could not be opened.  Please check the file path and try again."
 	5 "Polkua %s ei l?ydy."
 	9 "Anna levy %s"
 	10 "Virheelliset parametrit."
diff --git a/dlls/msi/msi_Fr.rc b/dlls/msi/msi_Fr.rc
index fa50f68..c92e56d 100644
--- a/dlls/msi/msi_Fr.rc
+++ b/dlls/msi/msi_Fr.rc
@@ -22,6 +22,7 @@ LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
 
 STRINGTABLE DISCARDABLE
 {
+	4 "The specified installation package could not be opened.  Please check the file path and try again."
 	5 "Le chemin %s est introuvable"
 	9 "ins?rez le disque %s"
 	10 "mauvais param?tres"
diff --git a/dlls/msi/msi_Hu.rc b/dlls/msi/msi_Hu.rc
index 4dacfe2..30c02b9 100644
--- a/dlls/msi/msi_Hu.rc
+++ b/dlls/msi/msi_Hu.rc
@@ -22,6 +22,7 @@ LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT
 
 STRINGTABLE DISCARDABLE
 {
+	4 "The specified installation package could not be opened.  Please check the file path and try again."
 	5 "%s ?tvonal nem tal?lhat?"
 	9 "helyezze be a lemezt: %s"
 	10 "rossz param?terek"
diff --git a/dlls/msi/msi_It.rc b/dlls/msi/msi_It.rc
index 7a3056c..8410552 100644
--- a/dlls/msi/msi_It.rc
+++ b/dlls/msi/msi_It.rc
@@ -22,6 +22,7 @@ LANGUAGE LANG_ITALIAN, SUBLANG_DEFAULT
 
 STRINGTABLE DISCARDABLE
 {
+	4 "The specified installation package could not be opened.  Please check the file path and try again."
 	5 "percorso %s non trovato"
 	9 "inserire disco %s"
 	10 "parametri incorretti"
diff --git a/dlls/msi/msi_Ko.rc b/dlls/msi/msi_Ko.rc
index 50b6225..72bbf5f 100644
--- a/dlls/msi/msi_Ko.rc
+++ b/dlls/msi/msi_Ko.rc
@@ -22,6 +22,7 @@ LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
 
 STRINGTABLE DISCARDABLE
 {
+	4 "The specified installation package could not be opened.  Please check the file path and try again."
 	5 "%s  ?????? ?????? ????????"
 	9 "?????? %s ????"
 	10 "?????? ????????"
diff --git a/dlls/msi/msi_Nl.rc b/dlls/msi/msi_Nl.rc
index f941c29..7beceac 100644
--- a/dlls/msi/msi_Nl.rc
+++ b/dlls/msi/msi_Nl.rc
@@ -22,6 +22,7 @@ LANGUAGE LANG_DUTCH, SUBLANG_DEFAULT
 
 STRINGTABLE DISCARDABLE
 {
+	4 "The specified installation package could not be opened.  Please check the file path and try again."
 	5 "Pad %s niet gevonden"
 	9 "Plaats disk %s"
 	10 "Ongeldige parameters"
diff --git a/dlls/msi/msi_No.rc b/dlls/msi/msi_No.rc
index 5aaa271..2ceb115 100644
--- a/dlls/msi/msi_No.rc
+++ b/dlls/msi/msi_No.rc
@@ -22,6 +22,7 @@ LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGI
 
 STRINGTABLE DISCARDABLE
 {
+	4 "The specified installation package could not be opened.  Please check the file path and try again."
 	5 "Fant ikke stien '%s'."
 	9 "Sett i disk '%s'"
 	10 "Gale parametere."
diff --git a/dlls/msi/msi_Pt.rc b/dlls/msi/msi_Pt.rc
index 7b814ff..849b3fe 100644
--- a/dlls/msi/msi_Pt.rc
+++ b/dlls/msi/msi_Pt.rc
@@ -22,6 +22,7 @@ LANGUAGE LANG_PORTUGUESE, SUBLANG_DEFAUL
 
 STRINGTABLE DISCARDABLE
 {
+	4 "The specified installation package could not be opened.  Please check the file path and try again."
 	5 "caminho %s n?o encontrado"
 	9 "insira disco %s"
 	10 "par?metros inv?lidos"
diff --git a/dlls/msi/msi_Ru.rc b/dlls/msi/msi_Ru.rc
index 23e55ab..9c351c6 100644
--- a/dlls/msi/msi_Ru.rc
+++ b/dlls/msi/msi_Ru.rc
@@ -22,6 +22,7 @@ LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
 
 STRINGTABLE DISCARDABLE
 {
+	4 "The specified installation package could not be opened.  Please check the file path and try again."
 	5 "???? %s ?? ??????"
 	9 "???????? ???? %s"
 	10 "???????? ?????????"
diff --git a/dlls/msi/msi_Tr.rc b/dlls/msi/msi_Tr.rc
index dda287c..ce25ed0 100644
--- a/dlls/msi/msi_Tr.rc
+++ b/dlls/msi/msi_Tr.rc
@@ -22,6 +22,7 @@ LANGUAGE LANG_TURKISH, SUBLANG_DEFAULT
 
 STRINGTABLE DISCARDABLE
 {
+	4 "The specified installation package could not be opened.  Please check the file path and try again."
 	5 "%s yolu bulunamad?"
 	9 "%s nolu diski yerle?tirin"
 	10 "bozuk parametreler"
diff --git a/dlls/msi/package.c b/dlls/msi/package.c
index d172c50..d2b6f2f 100644
--- a/dlls/msi/package.c
+++ b/dlls/msi/package.c
@@ -47,6 +47,8 @@ #include "action.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(msi);
 
+extern void msi_ui_error( DWORD msg_id, DWORD type );
+
 static void MSI_FreePackage( MSIOBJECTHDR *arg)
 {
     MSIPACKAGE *package= (MSIPACKAGE*) arg;
@@ -549,7 +551,12 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage,
             DeleteFileW( file );
 
         if( r != ERROR_SUCCESS )
+        {
+            if (GetLastError() == ERROR_FILE_NOT_FOUND)
+                msi_ui_error( 4, MB_OK | MB_ICONWARNING );
+
             return r;
+        }
     }
 
     package = MSI_CreatePackage( db );
-- 
1.4.2



More information about the wine-patches mailing list