2 * msiexec.exe implementation
4 * Copyright 2004 Vincent BĂ©ron
5 * Copyright 2005 Mike McCormack
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #define WIN32_NO_STATUS
24 #define COM_NO_WINDOWS_H
35 #include <wine/debug.h>
36 #include <wine/unicode.h>
38 WINE_DEFAULT_DEBUG_CHANNEL(msiexec
);
40 typedef HRESULT (WINAPI
*DLLREGISTERSERVER
)(void);
41 typedef HRESULT (WINAPI
*DLLUNREGISTERSERVER
)(void);
43 DWORD
DoService(void);
47 struct string_list
*next
;
51 static const WCHAR ActionAdmin
[] = {
52 'A','C','T','I','O','N','=','A','D','M','I','N',0 };
53 static const WCHAR RemoveAll
[] = {
54 'R','E','M','O','V','E','=','A','L','L',0 };
56 static const WCHAR InstallRunOnce
[] = {
57 'S','o','f','t','w','a','r','e','\\',
58 'M','i','c','r','o','s','o','f','t','\\',
59 'W','i','n','d','o','w','s','\\',
60 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
61 'I','n','s','t','a','l','l','e','r','\\',
62 'R','u','n','O','n','c','e','E','n','t','r','i','e','s',0};
64 static void ShowUsage(int ExitCode
)
66 WCHAR msiexec_version
[40];
67 WCHAR filename
[MAX_PATH
];
70 HMODULE hmsi
= GetModuleHandleA("msi.dll");
74 /* MsiGetFileVersion need the full path */
76 res
= GetModuleFileNameW(hmsi
, filename
, sizeof(filename
) / sizeof(filename
[0]));
78 WINE_ERR("GetModuleFileName failed: %d\n", GetLastError());
80 len
= sizeof(msiexec_version
) / sizeof(msiexec_version
[0]);
82 res
= MsiGetFileVersionW(filename
, msiexec_version
, &len
, NULL
, NULL
);
84 WINE_ERR("MsiGetFileVersion failed with %d\n", res
);
86 /* Return the length of the resource.
87 No typo: The LPWSTR parameter must be a LPWSTR * for this mode */
88 len
= LoadStringW(hmsi
, 10, (LPWSTR
) &msi_res
, 0);
90 msi_res
= HeapAlloc(GetProcessHeap(), 0, (len
+ 1) * sizeof(WCHAR
));
91 msiexec_help
= HeapAlloc(GetProcessHeap(), 0, (len
+ 1) * sizeof(WCHAR
) + sizeof(msiexec_version
));
92 if (msi_res
&& msiexec_help
) {
94 LoadStringW(hmsi
, 10, msi_res
, len
+ 1);
96 sprintfW(msiexec_help
, msi_res
, msiexec_version
);
97 MsiMessageBoxW(0, msiexec_help
, NULL
, 0, GetUserDefaultLangID(), 0);
99 HeapFree(GetProcessHeap(), 0, msi_res
);
100 HeapFree(GetProcessHeap(), 0, msiexec_help
);
101 ExitProcess(ExitCode
);
104 static BOOL
IsProductCode(LPWSTR str
)
108 if(lstrlenW(str
) != 38)
110 return ( (CLSIDFromString(str
, &ProductCode
) == NOERROR
) );
114 static VOID
StringListAppend(struct string_list
**list
, LPCWSTR str
)
116 struct string_list
*entry
;
119 size
= sizeof *entry
+ lstrlenW(str
) * sizeof (WCHAR
);
120 entry
= HeapAlloc(GetProcessHeap(), 0, size
);
123 WINE_ERR("Out of memory!\n");
126 lstrcpyW(entry
->str
, str
);
130 * Ignoring o(n^2) time complexity to add n strings for simplicity,
131 * add the string to the end of the list to preserve the order.
134 list
= &(*list
)->next
;
138 static LPWSTR
build_properties(struct string_list
*property_list
)
140 struct string_list
*list
;
141 LPWSTR ret
, p
, value
;
148 /* count the space we need */
150 for(list
= property_list
; list
; list
= list
->next
)
151 len
+= lstrlenW(list
->str
) + 3;
153 ret
= HeapAlloc( GetProcessHeap(), 0, len
*sizeof(WCHAR
) );
155 /* add a space before each string, and quote the value */
157 for(list
= property_list
; list
; list
= list
->next
)
159 value
= strchrW(list
->str
,'=');
162 len
= value
- list
->str
;
164 memcpy(p
, list
->str
, len
* sizeof(WCHAR
));
168 /* check if the value contains spaces and maybe quote it */
170 needs_quote
= strchrW(value
,' ') ? 1 : 0;
173 len
= lstrlenW(value
);
174 memcpy(p
, value
, len
* sizeof(WCHAR
));
181 WINE_TRACE("properties -> %s\n", wine_dbgstr_w(ret
) );
186 static LPWSTR
build_transforms(struct string_list
*transform_list
)
188 struct string_list
*list
;
192 /* count the space we need */
194 for(list
= transform_list
; list
; list
= list
->next
)
195 len
+= lstrlenW(list
->str
) + 1;
197 ret
= HeapAlloc( GetProcessHeap(), 0, len
*sizeof(WCHAR
) );
199 /* add all the transforms with a semicolon between each one */
201 for(list
= transform_list
; list
; list
= list
->next
)
203 len
= lstrlenW(list
->str
);
204 lstrcpynW(p
, list
->str
, len
);
214 static DWORD
msi_atou(LPCWSTR str
)
217 while(*str
>= '0' && *str
<= '9')
226 static LPWSTR
msi_strdup(LPCWSTR str
)
228 DWORD len
= lstrlenW(str
)+1;
229 LPWSTR ret
= HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR
)*len
);
234 /* str1 is the same as str2, ignoring case */
235 static BOOL
msi_strequal(LPCWSTR str1
, LPCSTR str2
)
240 len
= MultiByteToWideChar( CP_ACP
, 0, str2
, -1, NULL
, 0);
243 if( lstrlenW(str1
) != (len
-1) )
245 strW
= HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR
)*len
);
246 MultiByteToWideChar( CP_ACP
, 0, str2
, -1, strW
, len
);
247 ret
= CompareStringW(GetThreadLocale(), NORM_IGNORECASE
, str1
, len
, strW
, len
);
248 HeapFree(GetProcessHeap(), 0, strW
);
249 return (ret
== CSTR_EQUAL
);
252 /* prefix is hyphen or dash, and str1 is the same as str2, ignoring case */
253 static BOOL
msi_option_equal(LPCWSTR str1
, LPCSTR str2
)
255 if (str1
[0] != '/' && str1
[0] != '-')
258 /* skip over the hyphen or slash */
259 return msi_strequal(str1
+ 1, str2
);
262 /* str2 is at the beginning of str1, ignoring case */
263 static BOOL
msi_strprefix(LPCWSTR str1
, LPCSTR str2
)
268 len
= MultiByteToWideChar( CP_ACP
, 0, str2
, -1, NULL
, 0);
271 if( lstrlenW(str1
) < (len
-1) )
273 strW
= HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR
)*len
);
274 MultiByteToWideChar( CP_ACP
, 0, str2
, -1, strW
, len
);
275 ret
= CompareStringW(GetThreadLocale(), NORM_IGNORECASE
, str1
, len
-1, strW
, len
-1);
276 HeapFree(GetProcessHeap(), 0, strW
);
277 return (ret
== CSTR_EQUAL
);
280 /* prefix is hyphen or dash, and str2 is at the beginning of str1, ignoring case */
281 static BOOL
msi_option_prefix(LPCWSTR str1
, LPCSTR str2
)
283 if (str1
[0] != '/' && str1
[0] != '-')
286 /* skip over the hyphen or slash */
287 return msi_strprefix(str1
+ 1, str2
);
290 static VOID
*LoadProc(LPCWSTR DllName
, LPCSTR ProcName
, HMODULE
* DllHandle
)
294 *DllHandle
= LoadLibraryExW(DllName
, NULL
, LOAD_WITH_ALTERED_SEARCH_PATH
);
297 fprintf(stderr
, "Unable to load dll %s\n", wine_dbgstr_w(DllName
));
300 proc
= (VOID
*) GetProcAddress(*DllHandle
, ProcName
);
303 fprintf(stderr
, "Dll %s does not implement function %s\n",
304 wine_dbgstr_w(DllName
), ProcName
);
305 FreeLibrary(*DllHandle
);
312 static DWORD
DoDllRegisterServer(LPCWSTR DllName
)
315 DLLREGISTERSERVER pfDllRegisterServer
= NULL
;
316 HMODULE DllHandle
= NULL
;
318 pfDllRegisterServer
= LoadProc(DllName
, "DllRegisterServer", &DllHandle
);
320 hr
= pfDllRegisterServer();
323 fprintf(stderr
, "Failed to register dll %s\n", wine_dbgstr_w(DllName
));
326 printf("Successfully registered dll %s\n", wine_dbgstr_w(DllName
));
328 FreeLibrary(DllHandle
);
332 static DWORD
DoDllUnregisterServer(LPCWSTR DllName
)
335 DLLUNREGISTERSERVER pfDllUnregisterServer
= NULL
;
336 HMODULE DllHandle
= NULL
;
338 pfDllUnregisterServer
= LoadProc(DllName
, "DllUnregisterServer", &DllHandle
);
340 hr
= pfDllUnregisterServer();
343 fprintf(stderr
, "Failed to unregister dll %s\n", wine_dbgstr_w(DllName
));
346 printf("Successfully unregistered dll %s\n", wine_dbgstr_w(DllName
));
348 FreeLibrary(DllHandle
);
352 static DWORD
DoRegServer(void)
354 SC_HANDLE scm
, service
;
355 CHAR path
[MAX_PATH
+12];
358 scm
= OpenSCManagerA(NULL
, SERVICES_ACTIVE_DATABASEA
, SC_MANAGER_CREATE_SERVICE
);
361 fprintf(stderr
, "Failed to open the service control manager.\n");
365 GetSystemDirectoryA(path
, MAX_PATH
);
366 lstrcatA(path
, "\\msiexec.exe /V");
368 service
= CreateServiceA(scm
, "MSIServer", "MSIServer", GENERIC_ALL
,
369 SERVICE_WIN32_SHARE_PROCESS
, SERVICE_DEMAND_START
,
370 SERVICE_ERROR_NORMAL
, path
, NULL
, NULL
,
373 if (service
) CloseServiceHandle(service
);
374 else if (GetLastError() != ERROR_SERVICE_EXISTS
)
376 fprintf(stderr
, "Failed to create MSI service\n");
379 CloseServiceHandle(scm
);
383 static INT
DoEmbedding( LPWSTR key
)
385 printf("Remote custom actions are not supported yet\n");
390 * state machine to break up the command line properly
400 static int chomp( WCHAR
*str
)
402 enum chomp_state state
= cs_token
;
404 int count
= 1, ignore
;
406 for( p
= str
, out
= str
; *p
; p
++ )
434 state
= cs_whitespace
;
462 static void process_args( WCHAR
*cmdline
, int *pargc
, WCHAR
***pargv
)
464 WCHAR
**argv
, *p
= msi_strdup(cmdline
);
468 argv
= HeapAlloc(GetProcessHeap(), 0, sizeof (WCHAR
*)*(n
+1));
472 p
+= lstrlenW(p
) + 1;
480 static BOOL
process_args_from_reg( LPWSTR ident
, int *pargc
, WCHAR
***pargv
)
483 HKEY hkey
= 0, hkeyArgs
= 0;
484 DWORD sz
= 0, type
= 0;
488 r
= RegOpenKeyW(HKEY_LOCAL_MACHINE
, InstallRunOnce
, &hkey
);
489 if(r
!= ERROR_SUCCESS
)
491 r
= RegQueryValueExW(hkey
, ident
, 0, &type
, 0, &sz
);
492 if(r
== ERROR_SUCCESS
&& type
== REG_SZ
)
494 buf
= HeapAlloc(GetProcessHeap(), 0, sz
);
495 r
= RegQueryValueExW(hkey
, ident
, 0, &type
, (LPBYTE
)buf
, &sz
);
496 if( r
== ERROR_SUCCESS
)
498 process_args(buf
, pargc
, pargv
);
501 HeapFree(GetProcessHeap(), 0, buf
);
503 RegCloseKey(hkeyArgs
);
507 int WINAPI
WinMain(HINSTANCE hInstance
, HINSTANCE hPrevInstance
, LPSTR lpCmdLine
, int nCmdShow
)
510 BOOL FunctionInstall
= FALSE
;
511 BOOL FunctionInstallAdmin
= FALSE
;
512 BOOL FunctionRepair
= FALSE
;
513 BOOL FunctionAdvertise
= FALSE
;
514 BOOL FunctionPatch
= FALSE
;
515 BOOL FunctionDllRegisterServer
= FALSE
;
516 BOOL FunctionDllUnregisterServer
= FALSE
;
517 BOOL FunctionRegServer
= FALSE
;
518 BOOL FunctionUnregServer
= FALSE
;
519 BOOL FunctionServer
= FALSE
;
520 BOOL FunctionUnknown
= FALSE
;
522 LPWSTR PackageName
= NULL
;
523 LPWSTR Properties
= NULL
;
524 struct string_list
*property_list
= NULL
;
526 DWORD RepairMode
= 0;
528 DWORD_PTR AdvertiseMode
= 0;
529 struct string_list
*transform_list
= NULL
;
533 LPWSTR LogFileName
= NULL
;
534 DWORD LogAttributes
= 0;
536 LPWSTR PatchFileName
= NULL
;
537 INSTALLTYPE InstallType
= INSTALLTYPE_DEFAULT
;
539 INSTALLUILEVEL InstallUILevel
= INSTALLUILEVEL_FULL
;
541 LPWSTR DllName
= NULL
;
544 LPWSTR
*argvW
= NULL
;
546 /* parse the command line */
547 process_args( GetCommandLineW(), &argc
, &argvW
);
550 * If the args begin with /@ IDENT then we need to load the real
551 * command line out of the RunOnceEntries key in the registry.
552 * We do that before starting to process the real commandline,
553 * then overwrite the commandline again.
555 if(argc
>1 && msi_option_equal(argvW
[1], "@"))
557 if(!process_args_from_reg( argvW
[2], &argc
, &argvW
))
561 if (argc
== 3 && msi_option_equal(argvW
[1], "Embedding"))
562 return DoEmbedding( argvW
[2] );
564 for(i
= 1; i
< argc
; i
++)
566 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
568 if (msi_option_equal(argvW
[i
], "regserver"))
570 FunctionRegServer
= TRUE
;
572 else if (msi_option_equal(argvW
[i
], "unregserver") || msi_option_equal(argvW
[i
], "unregister"))
574 FunctionUnregServer
= TRUE
;
576 else if(msi_option_prefix(argvW
[i
], "i") || msi_option_prefix(argvW
[i
], "package"))
578 LPWSTR argvWi
= argvW
[i
];
579 int argLen
= (msi_option_prefix(argvW
[i
], "i") ? 2 : 8);
580 FunctionInstall
= TRUE
;
581 if(lstrlenW(argvW
[i
]) > argLen
)
588 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
591 PackageName
= argvWi
;
593 else if(msi_option_equal(argvW
[i
], "a"))
595 FunctionInstall
= TRUE
;
596 FunctionInstallAdmin
= TRUE
;
597 InstallType
= INSTALLTYPE_NETWORK_IMAGE
;
601 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
602 PackageName
= argvW
[i
];
603 StringListAppend(&property_list
, ActionAdmin
);
605 else if(msi_option_prefix(argvW
[i
], "f"))
608 int len
= lstrlenW(argvW
[i
]);
609 FunctionRepair
= TRUE
;
610 for(j
= 2; j
< len
; j
++)
616 RepairMode
|= REINSTALLMODE_FILEMISSING
;
620 RepairMode
|= REINSTALLMODE_FILEOLDERVERSION
;
624 RepairMode
|= REINSTALLMODE_FILEEQUALVERSION
;
628 RepairMode
|= REINSTALLMODE_FILEEXACT
;
632 RepairMode
|= REINSTALLMODE_FILEVERIFY
;
636 RepairMode
|= REINSTALLMODE_FILEREPLACE
;
640 RepairMode
|= REINSTALLMODE_USERDATA
;
644 RepairMode
|= REINSTALLMODE_MACHINEDATA
;
648 RepairMode
|= REINSTALLMODE_SHORTCUT
;
652 RepairMode
|= REINSTALLMODE_PACKAGE
;
655 fprintf(stderr
, "Unknown option \"%c\" in Repair mode\n", argvW
[i
][j
]);
661 RepairMode
= REINSTALLMODE_FILEMISSING
|
662 REINSTALLMODE_FILEEQUALVERSION
|
663 REINSTALLMODE_FILEVERIFY
|
664 REINSTALLMODE_MACHINEDATA
|
665 REINSTALLMODE_SHORTCUT
;
670 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
671 PackageName
= argvW
[i
];
673 else if(msi_option_prefix(argvW
[i
], "x") || msi_option_equal(argvW
[i
], "uninstall"))
675 FunctionInstall
= TRUE
;
676 if(msi_option_prefix(argvW
[i
], "x")) PackageName
= argvW
[i
]+2;
677 if(!PackageName
|| !PackageName
[0])
682 PackageName
= argvW
[i
];
684 WINE_TRACE("PackageName = %s\n", wine_dbgstr_w(PackageName
));
685 StringListAppend(&property_list
, RemoveAll
);
687 else if(msi_option_prefix(argvW
[i
], "j"))
690 int len
= lstrlenW(argvW
[i
]);
691 FunctionAdvertise
= TRUE
;
692 for(j
= 2; j
< len
; j
++)
698 AdvertiseMode
= ADVERTISEFLAGS_USERASSIGN
;
702 AdvertiseMode
= ADVERTISEFLAGS_MACHINEASSIGN
;
705 fprintf(stderr
, "Unknown option \"%c\" in Advertise mode\n", argvW
[i
][j
]);
712 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
713 PackageName
= argvW
[i
];
715 else if(msi_strequal(argvW
[i
], "u"))
717 FunctionAdvertise
= TRUE
;
718 AdvertiseMode
= ADVERTISEFLAGS_USERASSIGN
;
722 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
723 PackageName
= argvW
[i
];
725 else if(msi_strequal(argvW
[i
], "m"))
727 FunctionAdvertise
= TRUE
;
728 AdvertiseMode
= ADVERTISEFLAGS_MACHINEASSIGN
;
732 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
733 PackageName
= argvW
[i
];
735 else if(msi_option_equal(argvW
[i
], "t"))
740 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
741 StringListAppend(&transform_list
, argvW
[i
]);
743 else if(msi_option_equal(argvW
[i
], "g"))
748 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
749 Language
= msi_atou(argvW
[i
]);
751 else if(msi_option_prefix(argvW
[i
], "l"))
754 int len
= lstrlenW(argvW
[i
]);
755 for(j
= 2; j
< len
; j
++)
761 LogMode
|= INSTALLLOGMODE_INFO
;
765 LogMode
|= INSTALLLOGMODE_WARNING
;
769 LogMode
|= INSTALLLOGMODE_ERROR
;
773 LogMode
|= INSTALLLOGMODE_ACTIONSTART
;
777 LogMode
|= INSTALLLOGMODE_ACTIONDATA
;
781 LogMode
|= INSTALLLOGMODE_USER
;
785 LogMode
|= INSTALLLOGMODE_COMMONDATA
;
789 LogMode
|= INSTALLLOGMODE_FATALEXIT
;
793 LogMode
|= INSTALLLOGMODE_OUTOFDISKSPACE
;
797 LogMode
|= INSTALLLOGMODE_PROPERTYDUMP
;
801 LogMode
|= INSTALLLOGMODE_VERBOSE
;
804 LogMode
= INSTALLLOGMODE_FATALEXIT
|
805 INSTALLLOGMODE_ERROR
|
806 INSTALLLOGMODE_WARNING
|
807 INSTALLLOGMODE_USER
|
808 INSTALLLOGMODE_INFO
|
809 INSTALLLOGMODE_RESOLVESOURCE
|
810 INSTALLLOGMODE_OUTOFDISKSPACE
|
811 INSTALLLOGMODE_ACTIONSTART
|
812 INSTALLLOGMODE_ACTIONDATA
|
813 INSTALLLOGMODE_COMMONDATA
|
814 INSTALLLOGMODE_PROPERTYDUMP
|
815 INSTALLLOGMODE_PROGRESS
|
816 INSTALLLOGMODE_INITIALIZE
|
817 INSTALLLOGMODE_TERMINATE
|
818 INSTALLLOGMODE_SHOWDIALOG
;
821 LogAttributes
|= INSTALLLOGATTRIBUTES_APPEND
;
824 LogAttributes
|= INSTALLLOGATTRIBUTES_FLUSHEACHLINE
;
833 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
834 LogFileName
= argvW
[i
];
835 if(MsiEnableLogW(LogMode
, LogFileName
, LogAttributes
) != ERROR_SUCCESS
)
837 fprintf(stderr
, "Logging in %s (0x%08x, %u) failed\n",
838 wine_dbgstr_w(LogFileName
), LogMode
, LogAttributes
);
842 else if(msi_option_equal(argvW
[i
], "p"))
844 FunctionPatch
= TRUE
;
848 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
849 PatchFileName
= argvW
[i
];
851 else if(msi_option_prefix(argvW
[i
], "q"))
853 if(lstrlenW(argvW
[i
]) == 2 || msi_strequal(argvW
[i
]+2, "n") ||
854 msi_strequal(argvW
[i
] + 2, "uiet"))
856 InstallUILevel
= INSTALLUILEVEL_NONE
;
858 else if(msi_strequal(argvW
[i
]+2, "b"))
860 InstallUILevel
= INSTALLUILEVEL_BASIC
;
862 else if(msi_strequal(argvW
[i
]+2, "r"))
864 InstallUILevel
= INSTALLUILEVEL_REDUCED
;
866 else if(msi_strequal(argvW
[i
]+2, "f"))
868 InstallUILevel
= INSTALLUILEVEL_FULL
|INSTALLUILEVEL_ENDDIALOG
;
870 else if(msi_strequal(argvW
[i
]+2, "n+"))
872 InstallUILevel
= INSTALLUILEVEL_NONE
|INSTALLUILEVEL_ENDDIALOG
;
874 else if(msi_strequal(argvW
[i
]+2, "b+"))
876 InstallUILevel
= INSTALLUILEVEL_BASIC
|INSTALLUILEVEL_ENDDIALOG
;
878 else if(msi_strequal(argvW
[i
]+2, "b-"))
880 InstallUILevel
= INSTALLUILEVEL_BASIC
|INSTALLUILEVEL_PROGRESSONLY
;
882 else if(msi_strequal(argvW
[i
]+2, "b+!"))
884 InstallUILevel
= INSTALLUILEVEL_BASIC
|INSTALLUILEVEL_ENDDIALOG
;
885 WINE_FIXME("Unknown modifier: !\n");
889 fprintf(stderr
, "Unknown option \"%s\" for UI level\n",
890 wine_dbgstr_w(argvW
[i
]+2));
893 else if(msi_option_equal(argvW
[i
], "y"))
895 FunctionDllRegisterServer
= TRUE
;
899 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
902 else if(msi_option_equal(argvW
[i
], "z"))
904 FunctionDllUnregisterServer
= TRUE
;
908 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
911 else if(msi_option_equal(argvW
[i
], "help") || msi_option_equal(argvW
[i
], "?"))
915 else if(msi_option_equal(argvW
[i
], "m"))
917 FunctionUnknown
= TRUE
;
918 WINE_FIXME("Unknown parameter /m\n");
920 else if(msi_option_equal(argvW
[i
], "D"))
922 FunctionUnknown
= TRUE
;
923 WINE_FIXME("Unknown parameter /D\n");
925 else if (msi_option_equal(argvW
[i
], "V"))
927 FunctionServer
= TRUE
;
930 StringListAppend(&property_list
, argvW
[i
]);
934 MsiSetInternalUI(InstallUILevel
, NULL
);
936 Properties
= build_properties( property_list
);
938 if(FunctionInstallAdmin
&& FunctionPatch
)
939 FunctionInstall
= FALSE
;
944 if(IsProductCode(PackageName
))
945 ReturnCode
= MsiConfigureProductExW(PackageName
, 0, INSTALLSTATE_DEFAULT
, Properties
);
947 ReturnCode
= MsiInstallProductW(PackageName
, Properties
);
949 else if(FunctionRepair
)
951 if(IsProductCode(PackageName
))
952 WINE_FIXME("Product code treatment not implemented yet\n");
954 ReturnCode
= MsiReinstallProductW(PackageName
, RepairMode
);
956 else if(FunctionAdvertise
)
958 LPWSTR Transforms
= build_transforms( property_list
);
959 ReturnCode
= MsiAdvertiseProductW(PackageName
, (LPWSTR
) AdvertiseMode
, Transforms
, Language
);
961 else if(FunctionPatch
)
963 ReturnCode
= MsiApplyPatchW(PatchFileName
, PackageName
, InstallType
, Properties
);
965 else if(FunctionDllRegisterServer
)
967 ReturnCode
= DoDllRegisterServer(DllName
);
969 else if(FunctionDllUnregisterServer
)
971 ReturnCode
= DoDllUnregisterServer(DllName
);
973 else if (FunctionRegServer
)
975 ReturnCode
= DoRegServer();
977 else if (FunctionUnregServer
)
979 WINE_FIXME( "/unregserver not implemented yet, ignoring\n" );
981 else if (FunctionServer
)
983 ReturnCode
= DoService();
985 else if (FunctionUnknown
)
987 WINE_FIXME( "Unknown function, ignoring\n" );