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_LEAN_AND_MEAN
30 #include "wine/debug.h"
31 #include "wine/unicode.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(msiexec
);
35 typedef HRESULT (WINAPI
*DLLREGISTERSERVER
)(void);
36 typedef HRESULT (WINAPI
*DLLUNREGISTERSERVER
)(void);
38 DWORD
DoService(void);
42 struct string_list
*next
;
46 static const WCHAR ActionAdmin
[] = {
47 'A','C','T','I','O','N','=','A','D','M','I','N',0 };
48 static const WCHAR RemoveAll
[] = {
49 'R','E','M','O','V','E','=','A','L','L',0 };
51 static const WCHAR InstallRunOnce
[] = {
52 'S','o','f','t','w','a','r','e','\\',
53 'M','i','c','r','o','s','o','f','t','\\',
54 'W','i','n','d','o','w','s','\\',
55 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
56 'I','n','s','t','a','l','l','e','r','\\',
57 'R','u','n','O','n','c','e','E','n','t','r','i','e','s',0};
59 static void ShowUsage(int ExitCode
)
61 WCHAR msiexec_version
[40];
62 WCHAR filename
[MAX_PATH
];
65 HMODULE hmsi
= GetModuleHandleA("msi.dll");
69 /* MsiGetFileVersion need the full path */
71 res
= GetModuleFileNameW(hmsi
, filename
, sizeof(filename
) / sizeof(filename
[0]));
73 WINE_ERR("GetModuleFileName failed: %d\n", GetLastError());
75 len
= sizeof(msiexec_version
) / sizeof(msiexec_version
[0]);
77 res
= MsiGetFileVersionW(filename
, msiexec_version
, &len
, NULL
, NULL
);
79 WINE_ERR("MsiGetFileVersion failed with %d\n", res
);
81 /* Return the length of the resource.
82 No typo: The LPWSTR parameter must be a LPWSTR * for this mode */
83 len
= LoadStringW(hmsi
, 10, (LPWSTR
) &msi_res
, 0);
85 msi_res
= HeapAlloc(GetProcessHeap(), 0, (len
+ 1) * sizeof(WCHAR
));
86 msiexec_help
= HeapAlloc(GetProcessHeap(), 0, (len
+ 1) * sizeof(WCHAR
) + sizeof(msiexec_version
));
87 if (msi_res
&& msiexec_help
) {
89 LoadStringW(hmsi
, 10, msi_res
, len
+ 1);
91 sprintfW(msiexec_help
, msi_res
, msiexec_version
);
92 MsiMessageBoxW(0, msiexec_help
, NULL
, 0, GetUserDefaultLangID(), 0);
94 HeapFree(GetProcessHeap(), 0, msi_res
);
95 HeapFree(GetProcessHeap(), 0, msiexec_help
);
96 ExitProcess(ExitCode
);
99 static BOOL
IsProductCode(LPWSTR str
)
103 if(lstrlenW(str
) != 38)
105 return ( (CLSIDFromString(str
, &ProductCode
) == NOERROR
) );
109 static VOID
StringListAppend(struct string_list
**list
, LPCWSTR str
)
111 struct string_list
*entry
;
114 size
= sizeof *entry
+ lstrlenW(str
) * sizeof (WCHAR
);
115 entry
= HeapAlloc(GetProcessHeap(), 0, size
);
118 WINE_ERR("Out of memory!\n");
121 lstrcpyW(entry
->str
, str
);
125 * Ignoring o(n^2) time complexity to add n strings for simplicity,
126 * add the string to the end of the list to preserve the order.
129 list
= &(*list
)->next
;
133 static LPWSTR
build_properties(struct string_list
*property_list
)
135 struct string_list
*list
;
136 LPWSTR ret
, p
, value
;
143 /* count the space we need */
145 for(list
= property_list
; list
; list
= list
->next
)
146 len
+= lstrlenW(list
->str
) + 3;
148 ret
= HeapAlloc( GetProcessHeap(), 0, len
*sizeof(WCHAR
) );
150 /* add a space before each string, and quote the value */
152 for(list
= property_list
; list
; list
= list
->next
)
154 value
= strchrW(list
->str
,'=');
157 len
= value
- list
->str
;
159 memcpy(p
, list
->str
, len
* sizeof(WCHAR
));
163 /* check if the value contains spaces and maybe quote it */
165 needs_quote
= strchrW(value
,' ') ? 1 : 0;
168 len
= lstrlenW(value
);
169 memcpy(p
, value
, len
* sizeof(WCHAR
));
176 WINE_TRACE("properties -> %s\n", wine_dbgstr_w(ret
) );
181 static LPWSTR
build_transforms(struct string_list
*transform_list
)
183 struct string_list
*list
;
187 /* count the space we need */
189 for(list
= transform_list
; list
; list
= list
->next
)
190 len
+= lstrlenW(list
->str
) + 1;
192 ret
= HeapAlloc( GetProcessHeap(), 0, len
*sizeof(WCHAR
) );
194 /* add all the transforms with a semicolon between each one */
196 for(list
= transform_list
; list
; list
= list
->next
)
198 len
= lstrlenW(list
->str
);
199 lstrcpynW(p
, list
->str
, len
);
209 static DWORD
msi_atou(LPCWSTR str
)
212 while(*str
>= '0' && *str
<= '9')
221 static LPWSTR
msi_strdup(LPCWSTR str
)
223 DWORD len
= lstrlenW(str
)+1;
224 LPWSTR ret
= HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR
)*len
);
229 /* str1 is the same as str2, ignoring case */
230 static BOOL
msi_strequal(LPCWSTR str1
, LPCSTR str2
)
235 len
= MultiByteToWideChar( CP_ACP
, 0, str2
, -1, NULL
, 0);
238 if( lstrlenW(str1
) != (len
-1) )
240 strW
= HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR
)*len
);
241 MultiByteToWideChar( CP_ACP
, 0, str2
, -1, strW
, len
);
242 ret
= CompareStringW(GetThreadLocale(), NORM_IGNORECASE
, str1
, len
, strW
, len
);
243 HeapFree(GetProcessHeap(), 0, strW
);
244 return (ret
== CSTR_EQUAL
);
247 /* prefix is hyphen or dash, and str1 is the same as str2, ignoring case */
248 static BOOL
msi_option_equal(LPCWSTR str1
, LPCSTR str2
)
250 if (str1
[0] != '/' && str1
[0] != '-')
253 /* skip over the hyphen or slash */
254 return msi_strequal(str1
+ 1, str2
);
257 /* str2 is at the beginning of str1, ignoring case */
258 static BOOL
msi_strprefix(LPCWSTR str1
, LPCSTR str2
)
263 len
= MultiByteToWideChar( CP_ACP
, 0, str2
, -1, NULL
, 0);
266 if( lstrlenW(str1
) < (len
-1) )
268 strW
= HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR
)*len
);
269 MultiByteToWideChar( CP_ACP
, 0, str2
, -1, strW
, len
);
270 ret
= CompareStringW(GetThreadLocale(), NORM_IGNORECASE
, str1
, len
-1, strW
, len
-1);
271 HeapFree(GetProcessHeap(), 0, strW
);
272 return (ret
== CSTR_EQUAL
);
275 /* prefix is hyphen or dash, and str2 is at the beginning of str1, ignoring case */
276 static BOOL
msi_option_prefix(LPCWSTR str1
, LPCSTR str2
)
278 if (str1
[0] != '/' && str1
[0] != '-')
281 /* skip over the hyphen or slash */
282 return msi_strprefix(str1
+ 1, str2
);
285 static VOID
*LoadProc(LPCWSTR DllName
, LPCSTR ProcName
, HMODULE
* DllHandle
)
289 *DllHandle
= LoadLibraryExW(DllName
, NULL
, LOAD_WITH_ALTERED_SEARCH_PATH
);
292 fprintf(stderr
, "Unable to load dll %s\n", wine_dbgstr_w(DllName
));
295 proc
= (VOID
*) GetProcAddress(*DllHandle
, ProcName
);
298 fprintf(stderr
, "Dll %s does not implement function %s\n",
299 wine_dbgstr_w(DllName
), ProcName
);
300 FreeLibrary(*DllHandle
);
307 static DWORD
DoDllRegisterServer(LPCWSTR DllName
)
310 DLLREGISTERSERVER pfDllRegisterServer
= NULL
;
311 HMODULE DllHandle
= NULL
;
313 pfDllRegisterServer
= LoadProc(DllName
, "DllRegisterServer", &DllHandle
);
315 hr
= pfDllRegisterServer();
318 fprintf(stderr
, "Failed to register dll %s\n", wine_dbgstr_w(DllName
));
321 printf("Successfully registered dll %s\n", wine_dbgstr_w(DllName
));
323 FreeLibrary(DllHandle
);
327 static DWORD
DoDllUnregisterServer(LPCWSTR DllName
)
330 DLLUNREGISTERSERVER pfDllUnregisterServer
= NULL
;
331 HMODULE DllHandle
= NULL
;
333 pfDllUnregisterServer
= LoadProc(DllName
, "DllUnregisterServer", &DllHandle
);
335 hr
= pfDllUnregisterServer();
338 fprintf(stderr
, "Failed to unregister dll %s\n", wine_dbgstr_w(DllName
));
341 printf("Successfully unregistered dll %s\n", wine_dbgstr_w(DllName
));
343 FreeLibrary(DllHandle
);
347 static DWORD
DoRegServer(void)
349 SC_HANDLE scm
, service
;
350 CHAR path
[MAX_PATH
+12];
353 scm
= OpenSCManagerA(NULL
, SERVICES_ACTIVE_DATABASEA
, SC_MANAGER_CREATE_SERVICE
);
356 fprintf(stderr
, "Failed to open the service control manager.\n");
360 GetSystemDirectoryA(path
, MAX_PATH
);
361 lstrcatA(path
, "\\msiexec.exe /V");
363 service
= CreateServiceA(scm
, "MSIServer", "MSIServer", GENERIC_ALL
,
364 SERVICE_WIN32_SHARE_PROCESS
, SERVICE_DEMAND_START
,
365 SERVICE_ERROR_NORMAL
, path
, NULL
, NULL
,
368 if (service
) CloseServiceHandle(service
);
369 else if (GetLastError() != ERROR_SERVICE_EXISTS
)
371 fprintf(stderr
, "Failed to create MSI service\n");
374 CloseServiceHandle(scm
);
378 static INT
DoEmbedding( LPWSTR key
)
380 printf("Remote custom actions are not supported yet\n");
385 * state machine to break up the command line properly
395 static int chomp( WCHAR
*str
)
397 enum chomp_state state
= cs_token
;
399 int count
= 1, ignore
;
401 for( p
= str
, out
= str
; *p
; p
++ )
429 state
= cs_whitespace
;
457 static void process_args( WCHAR
*cmdline
, int *pargc
, WCHAR
***pargv
)
459 WCHAR
**argv
, *p
= msi_strdup(cmdline
);
463 argv
= HeapAlloc(GetProcessHeap(), 0, sizeof (WCHAR
*)*(n
+1));
467 p
+= lstrlenW(p
) + 1;
475 static BOOL
process_args_from_reg( const WCHAR
*ident
, int *pargc
, WCHAR
***pargv
)
479 DWORD sz
= 0, type
= 0;
483 r
= RegOpenKeyW(HKEY_LOCAL_MACHINE
, InstallRunOnce
, &hkey
);
484 if(r
!= ERROR_SUCCESS
)
486 r
= RegQueryValueExW(hkey
, ident
, 0, &type
, 0, &sz
);
487 if(r
== ERROR_SUCCESS
&& type
== REG_SZ
)
489 int len
= lstrlenW( *pargv
[0] );
490 if (!(buf
= HeapAlloc( GetProcessHeap(), 0, sz
+ (len
+ 1) * sizeof(WCHAR
) )))
495 memcpy( buf
, *pargv
[0], len
* sizeof(WCHAR
) );
497 r
= RegQueryValueExW(hkey
, ident
, 0, &type
, (LPBYTE
)(buf
+ len
), &sz
);
498 if( r
== ERROR_SUCCESS
)
500 process_args(buf
, pargc
, pargv
);
503 HeapFree(GetProcessHeap(), 0, buf
);
509 int WINAPI
WinMain(HINSTANCE hInstance
, HINSTANCE hPrevInstance
, LPSTR lpCmdLine
, int nCmdShow
)
512 BOOL FunctionInstall
= FALSE
;
513 BOOL FunctionInstallAdmin
= FALSE
;
514 BOOL FunctionRepair
= FALSE
;
515 BOOL FunctionAdvertise
= FALSE
;
516 BOOL FunctionPatch
= FALSE
;
517 BOOL FunctionDllRegisterServer
= FALSE
;
518 BOOL FunctionDllUnregisterServer
= FALSE
;
519 BOOL FunctionRegServer
= FALSE
;
520 BOOL FunctionUnregServer
= FALSE
;
521 BOOL FunctionServer
= FALSE
;
522 BOOL FunctionUnknown
= FALSE
;
524 LPWSTR PackageName
= NULL
;
525 LPWSTR Properties
= NULL
;
526 struct string_list
*property_list
= NULL
;
528 DWORD RepairMode
= 0;
530 DWORD_PTR AdvertiseMode
= 0;
531 struct string_list
*transform_list
= NULL
;
535 LPWSTR LogFileName
= NULL
;
536 DWORD LogAttributes
= 0;
538 LPWSTR PatchFileName
= NULL
;
539 INSTALLTYPE InstallType
= INSTALLTYPE_DEFAULT
;
541 INSTALLUILEVEL InstallUILevel
= INSTALLUILEVEL_FULL
;
543 LPWSTR DllName
= NULL
;
546 LPWSTR
*argvW
= NULL
;
548 /* parse the command line */
549 process_args( GetCommandLineW(), &argc
, &argvW
);
552 * If the args begin with /@ IDENT then we need to load the real
553 * command line out of the RunOnceEntries key in the registry.
554 * We do that before starting to process the real commandline,
555 * then overwrite the commandline again.
557 if(argc
>1 && msi_option_equal(argvW
[1], "@"))
559 if(!process_args_from_reg( argvW
[2], &argc
, &argvW
))
563 if (argc
== 3 && msi_option_equal(argvW
[1], "Embedding"))
564 return DoEmbedding( argvW
[2] );
566 for(i
= 1; i
< argc
; i
++)
568 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
570 if (msi_option_equal(argvW
[i
], "regserver"))
572 FunctionRegServer
= TRUE
;
574 else if (msi_option_equal(argvW
[i
], "unregserver") || msi_option_equal(argvW
[i
], "unregister")
575 || msi_option_equal(argvW
[i
], "unreg"))
577 FunctionUnregServer
= TRUE
;
579 else if(msi_option_prefix(argvW
[i
], "i") || msi_option_prefix(argvW
[i
], "package"))
581 LPWSTR argvWi
= argvW
[i
];
582 int argLen
= (msi_option_prefix(argvW
[i
], "i") ? 2 : 8);
583 FunctionInstall
= TRUE
;
584 if(lstrlenW(argvW
[i
]) > argLen
)
591 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
594 PackageName
= argvWi
;
596 else if(msi_option_equal(argvW
[i
], "a"))
598 FunctionInstall
= TRUE
;
599 FunctionInstallAdmin
= TRUE
;
600 InstallType
= INSTALLTYPE_NETWORK_IMAGE
;
604 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
605 PackageName
= argvW
[i
];
606 StringListAppend(&property_list
, ActionAdmin
);
608 else if(msi_option_prefix(argvW
[i
], "f"))
611 int len
= lstrlenW(argvW
[i
]);
612 FunctionRepair
= TRUE
;
613 for(j
= 2; j
< len
; j
++)
619 RepairMode
|= REINSTALLMODE_FILEMISSING
;
623 RepairMode
|= REINSTALLMODE_FILEOLDERVERSION
;
627 RepairMode
|= REINSTALLMODE_FILEEQUALVERSION
;
631 RepairMode
|= REINSTALLMODE_FILEEXACT
;
635 RepairMode
|= REINSTALLMODE_FILEVERIFY
;
639 RepairMode
|= REINSTALLMODE_FILEREPLACE
;
643 RepairMode
|= REINSTALLMODE_USERDATA
;
647 RepairMode
|= REINSTALLMODE_MACHINEDATA
;
651 RepairMode
|= REINSTALLMODE_SHORTCUT
;
655 RepairMode
|= REINSTALLMODE_PACKAGE
;
658 fprintf(stderr
, "Unknown option \"%c\" in Repair mode\n", argvW
[i
][j
]);
664 RepairMode
= REINSTALLMODE_FILEMISSING
|
665 REINSTALLMODE_FILEEQUALVERSION
|
666 REINSTALLMODE_FILEVERIFY
|
667 REINSTALLMODE_MACHINEDATA
|
668 REINSTALLMODE_SHORTCUT
;
673 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
674 PackageName
= argvW
[i
];
676 else if(msi_option_prefix(argvW
[i
], "x") || msi_option_equal(argvW
[i
], "uninstall"))
678 FunctionInstall
= TRUE
;
679 if(msi_option_prefix(argvW
[i
], "x")) PackageName
= argvW
[i
]+2;
680 if(!PackageName
|| !PackageName
[0])
685 PackageName
= argvW
[i
];
687 WINE_TRACE("PackageName = %s\n", wine_dbgstr_w(PackageName
));
688 StringListAppend(&property_list
, RemoveAll
);
690 else if(msi_option_prefix(argvW
[i
], "j"))
693 int len
= lstrlenW(argvW
[i
]);
694 FunctionAdvertise
= TRUE
;
695 for(j
= 2; j
< len
; j
++)
701 AdvertiseMode
= ADVERTISEFLAGS_USERASSIGN
;
705 AdvertiseMode
= ADVERTISEFLAGS_MACHINEASSIGN
;
708 fprintf(stderr
, "Unknown option \"%c\" in Advertise mode\n", argvW
[i
][j
]);
715 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
716 PackageName
= argvW
[i
];
718 else if(msi_strequal(argvW
[i
], "u"))
720 FunctionAdvertise
= TRUE
;
721 AdvertiseMode
= ADVERTISEFLAGS_USERASSIGN
;
725 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
726 PackageName
= argvW
[i
];
728 else if(msi_strequal(argvW
[i
], "m"))
730 FunctionAdvertise
= TRUE
;
731 AdvertiseMode
= ADVERTISEFLAGS_MACHINEASSIGN
;
735 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
736 PackageName
= argvW
[i
];
738 else if(msi_option_equal(argvW
[i
], "t"))
743 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
744 StringListAppend(&transform_list
, argvW
[i
]);
746 else if(msi_option_equal(argvW
[i
], "g"))
751 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
752 Language
= msi_atou(argvW
[i
]);
754 else if(msi_option_prefix(argvW
[i
], "l"))
757 int len
= lstrlenW(argvW
[i
]);
758 for(j
= 2; j
< len
; j
++)
764 LogMode
|= INSTALLLOGMODE_INFO
;
768 LogMode
|= INSTALLLOGMODE_WARNING
;
772 LogMode
|= INSTALLLOGMODE_ERROR
;
776 LogMode
|= INSTALLLOGMODE_ACTIONSTART
;
780 LogMode
|= INSTALLLOGMODE_ACTIONDATA
;
784 LogMode
|= INSTALLLOGMODE_USER
;
788 LogMode
|= INSTALLLOGMODE_COMMONDATA
;
792 LogMode
|= INSTALLLOGMODE_FATALEXIT
;
796 LogMode
|= INSTALLLOGMODE_OUTOFDISKSPACE
;
800 LogMode
|= INSTALLLOGMODE_PROPERTYDUMP
;
804 LogMode
|= INSTALLLOGMODE_VERBOSE
;
807 LogMode
= INSTALLLOGMODE_FATALEXIT
|
808 INSTALLLOGMODE_ERROR
|
809 INSTALLLOGMODE_WARNING
|
810 INSTALLLOGMODE_USER
|
811 INSTALLLOGMODE_INFO
|
812 INSTALLLOGMODE_RESOLVESOURCE
|
813 INSTALLLOGMODE_OUTOFDISKSPACE
|
814 INSTALLLOGMODE_ACTIONSTART
|
815 INSTALLLOGMODE_ACTIONDATA
|
816 INSTALLLOGMODE_COMMONDATA
|
817 INSTALLLOGMODE_PROPERTYDUMP
|
818 INSTALLLOGMODE_PROGRESS
|
819 INSTALLLOGMODE_INITIALIZE
|
820 INSTALLLOGMODE_TERMINATE
|
821 INSTALLLOGMODE_SHOWDIALOG
;
824 LogAttributes
|= INSTALLLOGATTRIBUTES_APPEND
;
827 LogAttributes
|= INSTALLLOGATTRIBUTES_FLUSHEACHLINE
;
836 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
837 LogFileName
= argvW
[i
];
838 if(MsiEnableLogW(LogMode
, LogFileName
, LogAttributes
) != ERROR_SUCCESS
)
840 fprintf(stderr
, "Logging in %s (0x%08x, %u) failed\n",
841 wine_dbgstr_w(LogFileName
), LogMode
, LogAttributes
);
845 else if(msi_option_equal(argvW
[i
], "p"))
847 FunctionPatch
= TRUE
;
851 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
852 PatchFileName
= argvW
[i
];
854 else if(msi_option_prefix(argvW
[i
], "q"))
856 if(lstrlenW(argvW
[i
]) == 2 || msi_strequal(argvW
[i
]+2, "n") ||
857 msi_strequal(argvW
[i
] + 2, "uiet"))
859 InstallUILevel
= INSTALLUILEVEL_NONE
;
861 else if(msi_strequal(argvW
[i
]+2, "b"))
863 InstallUILevel
= INSTALLUILEVEL_BASIC
;
865 else if(msi_strequal(argvW
[i
]+2, "r"))
867 InstallUILevel
= INSTALLUILEVEL_REDUCED
;
869 else if(msi_strequal(argvW
[i
]+2, "f"))
871 InstallUILevel
= INSTALLUILEVEL_FULL
|INSTALLUILEVEL_ENDDIALOG
;
873 else if(msi_strequal(argvW
[i
]+2, "n+"))
875 InstallUILevel
= INSTALLUILEVEL_NONE
|INSTALLUILEVEL_ENDDIALOG
;
877 else if(msi_strequal(argvW
[i
]+2, "b+"))
879 InstallUILevel
= INSTALLUILEVEL_BASIC
|INSTALLUILEVEL_ENDDIALOG
;
881 else if(msi_strequal(argvW
[i
]+2, "b-"))
883 InstallUILevel
= INSTALLUILEVEL_BASIC
|INSTALLUILEVEL_PROGRESSONLY
;
885 else if(msi_strequal(argvW
[i
]+2, "b+!"))
887 InstallUILevel
= INSTALLUILEVEL_BASIC
|INSTALLUILEVEL_ENDDIALOG
;
888 WINE_FIXME("Unknown modifier: !\n");
890 else if(msi_strequal(argvW
[i
]+2, "b!"))
892 InstallUILevel
= INSTALLUILEVEL_BASIC
;
893 WINE_FIXME("Unknown modifier: !\n");
897 fprintf(stderr
, "Unknown option \"%s\" for UI level\n",
898 wine_dbgstr_w(argvW
[i
]+2));
901 else if(msi_option_equal(argvW
[i
], "y"))
903 FunctionDllRegisterServer
= TRUE
;
907 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
910 else if(msi_option_equal(argvW
[i
], "z"))
912 FunctionDllUnregisterServer
= TRUE
;
916 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
919 else if(msi_option_equal(argvW
[i
], "help") || msi_option_equal(argvW
[i
], "?"))
923 else if(msi_option_equal(argvW
[i
], "m"))
925 FunctionUnknown
= TRUE
;
926 WINE_FIXME("Unknown parameter /m\n");
928 else if(msi_option_equal(argvW
[i
], "D"))
930 FunctionUnknown
= TRUE
;
931 WINE_FIXME("Unknown parameter /D\n");
933 else if (msi_option_equal(argvW
[i
], "V"))
935 FunctionServer
= TRUE
;
938 StringListAppend(&property_list
, argvW
[i
]);
942 MsiSetInternalUI(InstallUILevel
, NULL
);
944 Properties
= build_properties( property_list
);
946 if(FunctionInstallAdmin
&& FunctionPatch
)
947 FunctionInstall
= FALSE
;
952 if(IsProductCode(PackageName
))
953 ReturnCode
= MsiConfigureProductExW(PackageName
, 0, INSTALLSTATE_DEFAULT
, Properties
);
955 ReturnCode
= MsiInstallProductW(PackageName
, Properties
);
957 else if(FunctionRepair
)
959 if(IsProductCode(PackageName
))
960 WINE_FIXME("Product code treatment not implemented yet\n");
962 ReturnCode
= MsiReinstallProductW(PackageName
, RepairMode
);
964 else if(FunctionAdvertise
)
966 LPWSTR Transforms
= build_transforms( property_list
);
967 ReturnCode
= MsiAdvertiseProductW(PackageName
, (LPWSTR
) AdvertiseMode
, Transforms
, Language
);
969 else if(FunctionPatch
)
971 ReturnCode
= MsiApplyPatchW(PatchFileName
, PackageName
, InstallType
, Properties
);
973 else if(FunctionDllRegisterServer
)
975 ReturnCode
= DoDllRegisterServer(DllName
);
977 else if(FunctionDllUnregisterServer
)
979 ReturnCode
= DoDllUnregisterServer(DllName
);
981 else if (FunctionRegServer
)
983 ReturnCode
= DoRegServer();
985 else if (FunctionUnregServer
)
987 WINE_FIXME( "/unregserver not implemented yet, ignoring\n" );
989 else if (FunctionServer
)
991 ReturnCode
= DoService();
993 else if (FunctionUnknown
)
995 WINE_FIXME( "Unknown function, ignoring\n" );