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
29 #include "wine/debug.h"
30 #include "wine/unicode.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(msiexec
);
34 typedef HRESULT (WINAPI
*DLLREGISTERSERVER
)(void);
35 typedef HRESULT (WINAPI
*DLLUNREGISTERSERVER
)(void);
39 struct string_list
*next
;
43 static const char UsageStr
[] =
45 " Install a product:\n"
46 " msiexec {package|productcode} [property]\n"
47 " msiexec /i {package|productcode} [property]\n"
48 " msiexec /a package [property]\n"
49 " Repair an installation:\n"
50 " msiexec /f[p|o|e|d|c|a|u|m|s|v] {package|productcode}\n"
51 " Uninstall a product:\n"
52 " msiexec /x {package|productcode} [property]\n"
53 " Advertise a product:\n"
54 " msiexec /j[u|m] package [/t transform] [/g languageid]\n"
55 " msiexec {u|m} package [/t transform] [/g languageid]\n"
57 " msiexec /p patchpackage [property]\n"
58 " msiexec /p patchpackage /a package [property]\n"
59 " Modifiers for above operations:\n"
60 " msiexec /l[*][i|w|e|a|r|u|c|m|o|p|v|][+|!] logfile\n"
61 " msiexec /q{|n|b|r|f|n+|b+|b-}\n"
62 " Register a module:\n"
63 " msiexec /y module\n"
64 " Unregister a module:\n"
65 " msiexec /z module\n"
66 " Display usage and copyright:\n"
68 "NOTE: Product code on commandline unimplemented as of yet\n"
70 "Copyright 2004 Vincent Béron\n";
72 static const WCHAR ActionAdmin
[] = {
73 'A','C','T','I','O','N','=','A','D','M','I','N',0 };
74 static const WCHAR RemoveAll
[] = {
75 'R','E','M','O','V','E','=','A','L','L',0 };
77 static const WCHAR InstallRunOnce
[] = {
78 'S','o','f','t','w','a','r','e','\\',
79 'M','i','c','r','o','s','o','f','t','\\',
80 'W','i','n','d','o','w','s','\\',
81 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
82 'I','n','s','t','a','l','l','e','r','\\',
83 'R','u','n','O','n','c','e','E','n','t','r','i','e','s',0};
85 static void ShowUsage(int ExitCode
)
88 ExitProcess(ExitCode
);
91 static BOOL
IsProductCode(LPWSTR str
)
95 if(lstrlenW(str
) != 38)
97 return ( (CLSIDFromString(str
, &ProductCode
) == NOERROR
) );
101 static VOID
StringListAppend(struct string_list
**list
, LPCWSTR str
)
103 struct string_list
*entry
;
106 size
= sizeof *entry
+ lstrlenW(str
) * sizeof (WCHAR
);
107 entry
= HeapAlloc(GetProcessHeap(), 0, size
);
110 WINE_ERR("Out of memory!\n");
113 lstrcpyW(entry
->str
, str
);
117 * Ignoring o(n^2) time complexity to add n strings for simplicity,
118 * add the string to the end of the list to preserve the order.
121 list
= &(*list
)->next
;
125 static LPWSTR
build_properties(struct string_list
*property_list
)
127 struct string_list
*list
;
128 LPWSTR ret
, p
, value
;
135 /* count the space we need */
137 for(list
= property_list
; list
; list
= list
->next
)
138 len
+= lstrlenW(list
->str
) + 3;
140 ret
= HeapAlloc( GetProcessHeap(), 0, len
*sizeof(WCHAR
) );
142 /* add a space before each string, and quote the value */
144 for(list
= property_list
; list
; list
= list
->next
)
146 value
= strchrW(list
->str
,'=');
149 len
= value
- list
->str
;
151 memcpy(p
, list
->str
, len
* sizeof(WCHAR
));
155 /* check if the value contains spaces and maybe quote it */
157 needs_quote
= strchrW(value
,' ') ? 1 : 0;
160 len
= lstrlenW(value
);
161 memcpy(p
, value
, len
* sizeof(WCHAR
));
168 WINE_TRACE("properties -> %s\n", wine_dbgstr_w(ret
) );
173 static LPWSTR
build_transforms(struct string_list
*transform_list
)
175 struct string_list
*list
;
179 /* count the space we need */
181 for(list
= transform_list
; list
; list
= list
->next
)
182 len
+= lstrlenW(list
->str
) + 1;
184 ret
= HeapAlloc( GetProcessHeap(), 0, len
*sizeof(WCHAR
) );
186 /* add all the transforms with a semicolon between each one */
188 for(list
= transform_list
; list
; list
= list
->next
)
190 len
= lstrlenW(list
->str
);
191 lstrcpynW(p
, list
->str
, len
);
201 static DWORD
msi_atou(LPCWSTR str
)
204 while(*str
>= '0' && *str
<= '9')
213 static LPWSTR
msi_strdup(LPCWSTR str
)
215 DWORD len
= lstrlenW(str
)+1;
216 LPWSTR ret
= HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR
)*len
);
221 /* str1 is the same as str2, ignoring case */
222 static BOOL
msi_strequal(LPCWSTR str1
, LPCSTR str2
)
227 len
= MultiByteToWideChar( CP_ACP
, 0, str2
, -1, NULL
, 0);
230 if( lstrlenW(str1
) != (len
-1) )
232 strW
= HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR
)*len
);
233 MultiByteToWideChar( CP_ACP
, 0, str2
, -1, strW
, len
);
234 ret
= CompareStringW(GetThreadLocale(), NORM_IGNORECASE
, str1
, len
, strW
, len
);
235 HeapFree(GetProcessHeap(), 0, strW
);
236 return (ret
== CSTR_EQUAL
);
239 /* prefix is hyphen or dash, and str1 is the same as str2, ignoring case */
240 static BOOL
msi_option_equal(LPCWSTR str1
, LPCSTR str2
)
242 if (str1
[0] != '/' && str1
[0] != '-')
245 /* skip over the hyphen or slash */
246 return msi_strequal(str1
+ 1, str2
);
249 /* str2 is at the beginning of str1, ignoring case */
250 static BOOL
msi_strprefix(LPCWSTR str1
, LPCSTR str2
)
255 len
= MultiByteToWideChar( CP_ACP
, 0, str2
, -1, NULL
, 0);
258 if( lstrlenW(str1
) < (len
-1) )
260 strW
= HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR
)*len
);
261 MultiByteToWideChar( CP_ACP
, 0, str2
, -1, strW
, len
);
262 ret
= CompareStringW(GetThreadLocale(), NORM_IGNORECASE
, str1
, len
-1, strW
, len
-1);
263 HeapFree(GetProcessHeap(), 0, strW
);
264 return (ret
== CSTR_EQUAL
);
267 /* prefix is hyphen or dash, and str2 is at the beginning of str1, ignoring case */
268 static BOOL
msi_option_prefix(LPCWSTR str1
, LPCSTR str2
)
270 if (str1
[0] != '/' && str1
[0] != '-')
273 /* skip over the hyphen or slash */
274 return msi_strprefix(str1
+ 1, str2
);
277 static VOID
*LoadProc(LPCWSTR DllName
, LPCSTR ProcName
, HMODULE
* DllHandle
)
281 *DllHandle
= LoadLibraryExW(DllName
, NULL
, LOAD_WITH_ALTERED_SEARCH_PATH
);
284 fprintf(stderr
, "Unable to load dll %s\n", wine_dbgstr_w(DllName
));
287 proc
= (VOID
*) GetProcAddress(*DllHandle
, ProcName
);
290 fprintf(stderr
, "Dll %s does not implement function %s\n",
291 wine_dbgstr_w(DllName
), ProcName
);
292 FreeLibrary(*DllHandle
);
299 static DWORD
DoDllRegisterServer(LPCWSTR DllName
)
302 DLLREGISTERSERVER pfDllRegisterServer
= NULL
;
303 HMODULE DllHandle
= NULL
;
305 pfDllRegisterServer
= LoadProc(DllName
, "DllRegisterServer", &DllHandle
);
307 hr
= pfDllRegisterServer();
310 fprintf(stderr
, "Failed to register dll %s\n", wine_dbgstr_w(DllName
));
313 printf("Successfully registered dll %s\n", wine_dbgstr_w(DllName
));
315 FreeLibrary(DllHandle
);
319 static DWORD
DoDllUnregisterServer(LPCWSTR DllName
)
322 DLLUNREGISTERSERVER pfDllUnregisterServer
= NULL
;
323 HMODULE DllHandle
= NULL
;
325 pfDllUnregisterServer
= LoadProc(DllName
, "DllUnregisterServer", &DllHandle
);
327 hr
= pfDllUnregisterServer();
330 fprintf(stderr
, "Failed to unregister dll %s\n", wine_dbgstr_w(DllName
));
333 printf("Successfully unregistered dll %s\n", wine_dbgstr_w(DllName
));
335 FreeLibrary(DllHandle
);
339 static DWORD
DoRegServer(void)
341 SC_HANDLE scm
, service
;
342 CHAR path
[MAX_PATH
+12];
345 scm
= OpenSCManager(NULL
, SERVICES_ACTIVE_DATABASE
, SC_MANAGER_CREATE_SERVICE
);
348 fprintf(stderr
, "Failed to open the service control manager.\n");
352 GetSystemDirectory(path
, MAX_PATH
);
353 lstrcatA(path
, "\\msiexec.exe");
355 service
= CreateServiceA(scm
, "MSIServer", "MSIServer", GENERIC_ALL
,
356 SERVICE_WIN32_SHARE_PROCESS
, SERVICE_DEMAND_START
,
357 SERVICE_ERROR_NORMAL
, path
, NULL
, NULL
,
360 if (service
) CloseServiceHandle(service
);
361 else if (GetLastError() != ERROR_SERVICE_EXISTS
)
363 fprintf(stderr
, "Failed to create MSI service\n");
366 CloseServiceHandle(scm
);
370 static INT
DoEmbedding( LPWSTR key
)
372 printf("Remote custom actions are not supported yet\n");
377 * state machine to break up the command line properly
387 static int chomp( WCHAR
*str
)
389 enum chomp_state state
= cs_whitespace
;
391 int count
= 0, ignore
;
393 for( p
= str
, out
= str
; *p
; p
++ )
421 state
= cs_whitespace
;
449 static void process_args( WCHAR
*cmdline
, int *pargc
, WCHAR
***pargv
)
451 WCHAR
**argv
, *p
= msi_strdup(cmdline
);
455 argv
= HeapAlloc(GetProcessHeap(), 0, sizeof (WCHAR
*)*(n
+1));
459 p
+= lstrlenW(p
) + 1;
467 static BOOL
process_args_from_reg( LPWSTR ident
, int *pargc
, WCHAR
***pargv
)
470 HKEY hkey
= 0, hkeyArgs
= 0;
471 DWORD sz
= 0, type
= 0;
475 r
= RegOpenKeyW(HKEY_LOCAL_MACHINE
, InstallRunOnce
, &hkey
);
476 if(r
!= ERROR_SUCCESS
)
478 r
= RegQueryValueExW(hkey
, ident
, 0, &type
, 0, &sz
);
479 if(r
== ERROR_SUCCESS
&& type
== REG_SZ
)
481 buf
= HeapAlloc(GetProcessHeap(), 0, sz
);
482 r
= RegQueryValueExW(hkey
, ident
, 0, &type
, (LPBYTE
)buf
, &sz
);
483 if( r
== ERROR_SUCCESS
)
485 process_args(buf
, pargc
, pargv
);
489 RegCloseKey(hkeyArgs
);
493 int main(int argc
, char **argv
)
496 BOOL FunctionInstall
= FALSE
;
497 BOOL FunctionInstallAdmin
= FALSE
;
498 BOOL FunctionRepair
= FALSE
;
499 BOOL FunctionAdvertise
= FALSE
;
500 BOOL FunctionPatch
= FALSE
;
501 BOOL FunctionDllRegisterServer
= FALSE
;
502 BOOL FunctionDllUnregisterServer
= FALSE
;
503 BOOL FunctionRegServer
= FALSE
;
504 BOOL FunctionUnregServer
= FALSE
;
505 BOOL FunctionUnknown
= FALSE
;
507 LPWSTR PackageName
= NULL
;
508 LPWSTR Properties
= NULL
;
509 struct string_list
*property_list
= NULL
;
511 DWORD RepairMode
= 0;
513 DWORD_PTR AdvertiseMode
= 0;
514 struct string_list
*transform_list
= NULL
;
518 LPWSTR LogFileName
= NULL
;
519 DWORD LogAttributes
= 0;
521 LPWSTR PatchFileName
= NULL
;
522 INSTALLTYPE InstallType
= INSTALLTYPE_DEFAULT
;
524 INSTALLUILEVEL InstallUILevel
= INSTALLUILEVEL_FULL
;
526 LPWSTR DllName
= NULL
;
528 LPWSTR
*argvW
= NULL
;
530 /* overwrite the command line */
531 process_args( GetCommandLineW(), &argc
, &argvW
);
534 * If the args begin with /@ IDENT then we need to load the real
535 * command line out of the RunOnceEntries key in the registry.
536 * We do that before starting to process the real commandline,
537 * then overwrite the commandline again.
539 if(argc
>1 && msi_option_equal(argvW
[1], "@"))
541 if(!process_args_from_reg( argvW
[2], &argc
, &argvW
))
545 if (argc
== 3 && msi_option_equal(argvW
[1], "Embedding"))
546 return DoEmbedding( argvW
[2] );
548 for(i
= 1; i
< argc
; i
++)
550 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
552 if (msi_option_equal(argvW
[i
], "regserver"))
554 FunctionRegServer
= TRUE
;
556 else if (msi_option_equal(argvW
[i
], "unregserver") || msi_option_equal(argvW
[i
], "unregister"))
558 FunctionUnregServer
= TRUE
;
560 else if(msi_option_prefix(argvW
[i
], "i"))
562 LPWSTR argvWi
= argvW
[i
];
563 FunctionInstall
= TRUE
;
564 if(lstrlenW(argvWi
) > 2)
571 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
574 PackageName
= argvWi
;
576 else if(msi_option_equal(argvW
[i
], "a"))
578 FunctionInstall
= TRUE
;
579 FunctionInstallAdmin
= TRUE
;
580 InstallType
= INSTALLTYPE_NETWORK_IMAGE
;
584 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
585 PackageName
= argvW
[i
];
586 StringListAppend(&property_list
, ActionAdmin
);
588 else if(msi_option_prefix(argvW
[i
], "f"))
591 int len
= lstrlenW(argvW
[i
]);
592 FunctionRepair
= TRUE
;
593 for(j
= 2; j
< len
; j
++)
599 RepairMode
|= REINSTALLMODE_FILEMISSING
;
603 RepairMode
|= REINSTALLMODE_FILEOLDERVERSION
;
607 RepairMode
|= REINSTALLMODE_FILEEQUALVERSION
;
611 RepairMode
|= REINSTALLMODE_FILEEXACT
;
615 RepairMode
|= REINSTALLMODE_FILEVERIFY
;
619 RepairMode
|= REINSTALLMODE_FILEREPLACE
;
623 RepairMode
|= REINSTALLMODE_USERDATA
;
627 RepairMode
|= REINSTALLMODE_MACHINEDATA
;
631 RepairMode
|= REINSTALLMODE_SHORTCUT
;
635 RepairMode
|= REINSTALLMODE_PACKAGE
;
638 fprintf(stderr
, "Unknown option \"%c\" in Repair mode\n", argvW
[i
][j
]);
644 RepairMode
= REINSTALLMODE_FILEMISSING
|
645 REINSTALLMODE_FILEEQUALVERSION
|
646 REINSTALLMODE_FILEVERIFY
|
647 REINSTALLMODE_MACHINEDATA
|
648 REINSTALLMODE_SHORTCUT
;
653 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
654 PackageName
= argvW
[i
];
656 else if(msi_option_prefix(argvW
[i
], "x"))
658 FunctionInstall
= TRUE
;
659 PackageName
= argvW
[i
]+2;
665 PackageName
= argvW
[i
];
667 WINE_TRACE("PackageName = %s\n", wine_dbgstr_w(PackageName
));
668 StringListAppend(&property_list
, RemoveAll
);
670 else if(msi_option_prefix(argvW
[i
], "j"))
673 int len
= lstrlenW(argvW
[i
]);
674 FunctionAdvertise
= TRUE
;
675 for(j
= 2; j
< len
; j
++)
681 AdvertiseMode
= ADVERTISEFLAGS_USERASSIGN
;
685 AdvertiseMode
= ADVERTISEFLAGS_MACHINEASSIGN
;
688 fprintf(stderr
, "Unknown option \"%c\" in Advertise mode\n", argvW
[i
][j
]);
695 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
696 PackageName
= argvW
[i
];
698 else if(msi_strequal(argvW
[i
], "u"))
700 FunctionAdvertise
= TRUE
;
701 AdvertiseMode
= ADVERTISEFLAGS_USERASSIGN
;
705 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
706 PackageName
= argvW
[i
];
708 else if(msi_strequal(argvW
[i
], "m"))
710 FunctionAdvertise
= TRUE
;
711 AdvertiseMode
= ADVERTISEFLAGS_MACHINEASSIGN
;
715 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
716 PackageName
= argvW
[i
];
718 else if(msi_option_equal(argvW
[i
], "t"))
723 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
724 StringListAppend(&transform_list
, argvW
[i
]);
726 else if(msi_option_equal(argvW
[i
], "g"))
731 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
732 Language
= msi_atou(argvW
[i
]);
734 else if(msi_option_prefix(argvW
[i
], "l"))
737 int len
= lstrlenW(argvW
[i
]);
738 for(j
= 2; j
< len
; j
++)
744 LogMode
|= INSTALLLOGMODE_INFO
;
748 LogMode
|= INSTALLLOGMODE_WARNING
;
752 LogMode
|= INSTALLLOGMODE_ERROR
;
756 LogMode
|= INSTALLLOGMODE_ACTIONSTART
;
760 LogMode
|= INSTALLLOGMODE_ACTIONDATA
;
764 LogMode
|= INSTALLLOGMODE_USER
;
768 LogMode
|= INSTALLLOGMODE_COMMONDATA
;
772 LogMode
|= INSTALLLOGMODE_FATALEXIT
;
776 LogMode
|= INSTALLLOGMODE_OUTOFDISKSPACE
;
780 LogMode
|= INSTALLLOGMODE_PROPERTYDUMP
;
784 LogMode
|= INSTALLLOGMODE_VERBOSE
;
787 LogMode
= INSTALLLOGMODE_FATALEXIT
|
788 INSTALLLOGMODE_ERROR
|
789 INSTALLLOGMODE_WARNING
|
790 INSTALLLOGMODE_USER
|
791 INSTALLLOGMODE_INFO
|
792 INSTALLLOGMODE_RESOLVESOURCE
|
793 INSTALLLOGMODE_OUTOFDISKSPACE
|
794 INSTALLLOGMODE_ACTIONSTART
|
795 INSTALLLOGMODE_ACTIONDATA
|
796 INSTALLLOGMODE_COMMONDATA
|
797 INSTALLLOGMODE_PROPERTYDUMP
|
798 INSTALLLOGMODE_PROGRESS
|
799 INSTALLLOGMODE_INITIALIZE
|
800 INSTALLLOGMODE_TERMINATE
|
801 INSTALLLOGMODE_SHOWDIALOG
;
804 LogAttributes
|= INSTALLLOGATTRIBUTES_APPEND
;
807 LogAttributes
|= INSTALLLOGATTRIBUTES_FLUSHEACHLINE
;
816 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
817 LogFileName
= argvW
[i
];
818 if(MsiEnableLogW(LogMode
, LogFileName
, LogAttributes
) != ERROR_SUCCESS
)
820 fprintf(stderr
, "Logging in %s (0x%08x, %u) failed\n",
821 wine_dbgstr_w(LogFileName
), LogMode
, LogAttributes
);
825 else if(msi_option_equal(argvW
[i
], "p"))
827 FunctionPatch
= TRUE
;
831 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
832 PatchFileName
= argvW
[i
];
834 else if(msi_option_prefix(argvW
[i
], "q"))
836 if(lstrlenW(argvW
[i
]) == 2 || msi_strequal(argvW
[i
]+2, "n") ||
837 msi_strequal(argvW
[i
] + 2, "uiet"))
839 InstallUILevel
= INSTALLUILEVEL_NONE
;
841 else if(msi_strequal(argvW
[i
]+2, "b"))
843 InstallUILevel
= INSTALLUILEVEL_BASIC
;
845 else if(msi_strequal(argvW
[i
]+2, "r"))
847 InstallUILevel
= INSTALLUILEVEL_REDUCED
;
849 else if(msi_strequal(argvW
[i
]+2, "f"))
851 InstallUILevel
= INSTALLUILEVEL_FULL
|INSTALLUILEVEL_ENDDIALOG
;
853 else if(msi_strequal(argvW
[i
]+2, "n+"))
855 InstallUILevel
= INSTALLUILEVEL_NONE
|INSTALLUILEVEL_ENDDIALOG
;
857 else if(msi_strequal(argvW
[i
]+2, "b+"))
859 InstallUILevel
= INSTALLUILEVEL_BASIC
|INSTALLUILEVEL_ENDDIALOG
;
861 else if(msi_strequal(argvW
[i
]+2, "b-"))
863 InstallUILevel
= INSTALLUILEVEL_BASIC
|INSTALLUILEVEL_PROGRESSONLY
;
865 else if(msi_strequal(argvW
[i
]+2, "b+!"))
867 InstallUILevel
= INSTALLUILEVEL_BASIC
|INSTALLUILEVEL_ENDDIALOG
;
868 WINE_FIXME("Unknown modifier: !\n");
872 fprintf(stderr
, "Unknown option \"%s\" for UI level\n",
873 wine_dbgstr_w(argvW
[i
]+2));
876 else if(msi_option_equal(argvW
[i
], "y"))
878 FunctionDllRegisterServer
= TRUE
;
882 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
885 else if(msi_option_equal(argvW
[i
], "z"))
887 FunctionDllUnregisterServer
= TRUE
;
891 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
894 else if(msi_option_equal(argvW
[i
], "h") || msi_option_equal(argvW
[i
], "?"))
898 else if(msi_option_equal(argvW
[i
], "m"))
900 FunctionUnknown
= TRUE
;
901 WINE_FIXME("Unknown parameter /m\n");
903 else if(msi_option_equal(argvW
[i
], "D"))
905 FunctionUnknown
= TRUE
;
906 WINE_FIXME("Unknown parameter /D\n");
909 StringListAppend(&property_list
, argvW
[i
]);
913 MsiSetInternalUI(InstallUILevel
, NULL
);
915 Properties
= build_properties( property_list
);
917 if(FunctionInstallAdmin
&& FunctionPatch
)
918 FunctionInstall
= FALSE
;
923 if(IsProductCode(PackageName
))
924 ReturnCode
= MsiConfigureProductExW(PackageName
, 0, INSTALLSTATE_DEFAULT
, Properties
);
926 ReturnCode
= MsiInstallProductW(PackageName
, Properties
);
928 else if(FunctionRepair
)
930 if(IsProductCode(PackageName
))
931 WINE_FIXME("Product code treatment not implemented yet\n");
933 ReturnCode
= MsiReinstallProductW(PackageName
, RepairMode
);
935 else if(FunctionAdvertise
)
937 LPWSTR Transforms
= build_transforms( property_list
);
938 ReturnCode
= MsiAdvertiseProductW(PackageName
, (LPWSTR
) AdvertiseMode
, Transforms
, Language
);
940 else if(FunctionPatch
)
942 ReturnCode
= MsiApplyPatchW(PatchFileName
, PackageName
, InstallType
, Properties
);
944 else if(FunctionDllRegisterServer
)
946 ReturnCode
= DoDllRegisterServer(DllName
);
948 else if(FunctionDllUnregisterServer
)
950 ReturnCode
= DoDllUnregisterServer(DllName
);
952 else if (FunctionRegServer
)
954 ReturnCode
= DoRegServer();
956 else if (FunctionUnregServer
)
958 WINE_FIXME( "/unregserver not implemented yet, ignoring\n" );
960 else if (FunctionUnknown
)
962 WINE_FIXME( "Unknown function, ignoring\n" );