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);
37 DWORD
DoService(void);
41 struct string_list
*next
;
45 static const char UsageStr
[] =
47 " Install a product:\n"
48 " msiexec {package|productcode} [property]\n"
49 " msiexec /i {package|productcode} [property]\n"
50 " msiexec /a package [property]\n"
51 " Repair an installation:\n"
52 " msiexec /f[p|o|e|d|c|a|u|m|s|v] {package|productcode}\n"
53 " Uninstall a product:\n"
54 " msiexec /x {package|productcode} [property]\n"
55 " Advertise a product:\n"
56 " msiexec /j[u|m] package [/t transform] [/g languageid]\n"
57 " msiexec {u|m} package [/t transform] [/g languageid]\n"
59 " msiexec /p patchpackage [property]\n"
60 " msiexec /p patchpackage /a package [property]\n"
61 " Modifiers for above operations:\n"
62 " msiexec /l[*][i|w|e|a|r|u|c|m|o|p|v|][+|!] logfile\n"
63 " msiexec /q{|n|b|r|f|n+|b+|b-}\n"
64 " Register a module:\n"
65 " msiexec /y module\n"
66 " Unregister a module:\n"
67 " msiexec /z module\n"
68 " Display usage and copyright:\n"
70 "NOTE: Product code on commandline unimplemented as of yet\n"
72 "Copyright 2004 Vincent Béron\n";
74 static const WCHAR ActionAdmin
[] = {
75 'A','C','T','I','O','N','=','A','D','M','I','N',0 };
76 static const WCHAR RemoveAll
[] = {
77 'R','E','M','O','V','E','=','A','L','L',0 };
79 static const WCHAR InstallRunOnce
[] = {
80 'S','o','f','t','w','a','r','e','\\',
81 'M','i','c','r','o','s','o','f','t','\\',
82 'W','i','n','d','o','w','s','\\',
83 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
84 'I','n','s','t','a','l','l','e','r','\\',
85 'R','u','n','O','n','c','e','E','n','t','r','i','e','s',0};
87 static void ShowUsage(int ExitCode
)
90 ExitProcess(ExitCode
);
93 static BOOL
IsProductCode(LPWSTR str
)
97 if(lstrlenW(str
) != 38)
99 return ( (CLSIDFromString(str
, &ProductCode
) == NOERROR
) );
103 static VOID
StringListAppend(struct string_list
**list
, LPCWSTR str
)
105 struct string_list
*entry
;
108 size
= sizeof *entry
+ lstrlenW(str
) * sizeof (WCHAR
);
109 entry
= HeapAlloc(GetProcessHeap(), 0, size
);
112 WINE_ERR("Out of memory!\n");
115 lstrcpyW(entry
->str
, str
);
119 * Ignoring o(n^2) time complexity to add n strings for simplicity,
120 * add the string to the end of the list to preserve the order.
123 list
= &(*list
)->next
;
127 static LPWSTR
build_properties(struct string_list
*property_list
)
129 struct string_list
*list
;
130 LPWSTR ret
, p
, value
;
137 /* count the space we need */
139 for(list
= property_list
; list
; list
= list
->next
)
140 len
+= lstrlenW(list
->str
) + 3;
142 ret
= HeapAlloc( GetProcessHeap(), 0, len
*sizeof(WCHAR
) );
144 /* add a space before each string, and quote the value */
146 for(list
= property_list
; list
; list
= list
->next
)
148 value
= strchrW(list
->str
,'=');
151 len
= value
- list
->str
;
153 memcpy(p
, list
->str
, len
* sizeof(WCHAR
));
157 /* check if the value contains spaces and maybe quote it */
159 needs_quote
= strchrW(value
,' ') ? 1 : 0;
162 len
= lstrlenW(value
);
163 memcpy(p
, value
, len
* sizeof(WCHAR
));
170 WINE_TRACE("properties -> %s\n", wine_dbgstr_w(ret
) );
175 static LPWSTR
build_transforms(struct string_list
*transform_list
)
177 struct string_list
*list
;
181 /* count the space we need */
183 for(list
= transform_list
; list
; list
= list
->next
)
184 len
+= lstrlenW(list
->str
) + 1;
186 ret
= HeapAlloc( GetProcessHeap(), 0, len
*sizeof(WCHAR
) );
188 /* add all the transforms with a semicolon between each one */
190 for(list
= transform_list
; list
; list
= list
->next
)
192 len
= lstrlenW(list
->str
);
193 lstrcpynW(p
, list
->str
, len
);
203 static DWORD
msi_atou(LPCWSTR str
)
206 while(*str
>= '0' && *str
<= '9')
215 static LPWSTR
msi_strdup(LPCWSTR str
)
217 DWORD len
= lstrlenW(str
)+1;
218 LPWSTR ret
= HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR
)*len
);
223 /* str1 is the same as str2, ignoring case */
224 static BOOL
msi_strequal(LPCWSTR str1
, LPCSTR str2
)
229 len
= MultiByteToWideChar( CP_ACP
, 0, str2
, -1, NULL
, 0);
232 if( lstrlenW(str1
) != (len
-1) )
234 strW
= HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR
)*len
);
235 MultiByteToWideChar( CP_ACP
, 0, str2
, -1, strW
, len
);
236 ret
= CompareStringW(GetThreadLocale(), NORM_IGNORECASE
, str1
, len
, strW
, len
);
237 HeapFree(GetProcessHeap(), 0, strW
);
238 return (ret
== CSTR_EQUAL
);
241 /* prefix is hyphen or dash, and str1 is the same as str2, ignoring case */
242 static BOOL
msi_option_equal(LPCWSTR str1
, LPCSTR str2
)
244 if (str1
[0] != '/' && str1
[0] != '-')
247 /* skip over the hyphen or slash */
248 return msi_strequal(str1
+ 1, str2
);
251 /* str2 is at the beginning of str1, ignoring case */
252 static BOOL
msi_strprefix(LPCWSTR str1
, LPCSTR str2
)
257 len
= MultiByteToWideChar( CP_ACP
, 0, str2
, -1, NULL
, 0);
260 if( lstrlenW(str1
) < (len
-1) )
262 strW
= HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR
)*len
);
263 MultiByteToWideChar( CP_ACP
, 0, str2
, -1, strW
, len
);
264 ret
= CompareStringW(GetThreadLocale(), NORM_IGNORECASE
, str1
, len
-1, strW
, len
-1);
265 HeapFree(GetProcessHeap(), 0, strW
);
266 return (ret
== CSTR_EQUAL
);
269 /* prefix is hyphen or dash, and str2 is at the beginning of str1, ignoring case */
270 static BOOL
msi_option_prefix(LPCWSTR str1
, LPCSTR str2
)
272 if (str1
[0] != '/' && str1
[0] != '-')
275 /* skip over the hyphen or slash */
276 return msi_strprefix(str1
+ 1, str2
);
279 static VOID
*LoadProc(LPCWSTR DllName
, LPCSTR ProcName
, HMODULE
* DllHandle
)
283 *DllHandle
= LoadLibraryExW(DllName
, NULL
, LOAD_WITH_ALTERED_SEARCH_PATH
);
286 fprintf(stderr
, "Unable to load dll %s\n", wine_dbgstr_w(DllName
));
289 proc
= (VOID
*) GetProcAddress(*DllHandle
, ProcName
);
292 fprintf(stderr
, "Dll %s does not implement function %s\n",
293 wine_dbgstr_w(DllName
), ProcName
);
294 FreeLibrary(*DllHandle
);
301 static DWORD
DoDllRegisterServer(LPCWSTR DllName
)
304 DLLREGISTERSERVER pfDllRegisterServer
= NULL
;
305 HMODULE DllHandle
= NULL
;
307 pfDllRegisterServer
= LoadProc(DllName
, "DllRegisterServer", &DllHandle
);
309 hr
= pfDllRegisterServer();
312 fprintf(stderr
, "Failed to register dll %s\n", wine_dbgstr_w(DllName
));
315 printf("Successfully registered dll %s\n", wine_dbgstr_w(DllName
));
317 FreeLibrary(DllHandle
);
321 static DWORD
DoDllUnregisterServer(LPCWSTR DllName
)
324 DLLUNREGISTERSERVER pfDllUnregisterServer
= NULL
;
325 HMODULE DllHandle
= NULL
;
327 pfDllUnregisterServer
= LoadProc(DllName
, "DllUnregisterServer", &DllHandle
);
329 hr
= pfDllUnregisterServer();
332 fprintf(stderr
, "Failed to unregister dll %s\n", wine_dbgstr_w(DllName
));
335 printf("Successfully unregistered dll %s\n", wine_dbgstr_w(DllName
));
337 FreeLibrary(DllHandle
);
341 static DWORD
DoRegServer(void)
343 SC_HANDLE scm
, service
;
344 CHAR path
[MAX_PATH
+12];
347 scm
= OpenSCManagerA(NULL
, SERVICES_ACTIVE_DATABASEA
, SC_MANAGER_CREATE_SERVICE
);
350 fprintf(stderr
, "Failed to open the service control manager.\n");
354 GetSystemDirectoryA(path
, MAX_PATH
);
355 lstrcatA(path
, "\\msiexec.exe /V");
357 service
= CreateServiceA(scm
, "MSIServer", "MSIServer", GENERIC_ALL
,
358 SERVICE_WIN32_SHARE_PROCESS
, SERVICE_DEMAND_START
,
359 SERVICE_ERROR_NORMAL
, path
, NULL
, NULL
,
362 if (service
) CloseServiceHandle(service
);
363 else if (GetLastError() != ERROR_SERVICE_EXISTS
)
365 fprintf(stderr
, "Failed to create MSI service\n");
368 CloseServiceHandle(scm
);
372 static INT
DoEmbedding( LPWSTR key
)
374 printf("Remote custom actions are not supported yet\n");
379 * state machine to break up the command line properly
389 static int chomp( WCHAR
*str
)
391 enum chomp_state state
= cs_token
;
393 int count
= 1, ignore
;
395 for( p
= str
, out
= str
; *p
; p
++ )
423 state
= cs_whitespace
;
451 static void process_args( WCHAR
*cmdline
, int *pargc
, WCHAR
***pargv
)
453 WCHAR
**argv
, *p
= msi_strdup(cmdline
);
457 argv
= HeapAlloc(GetProcessHeap(), 0, sizeof (WCHAR
*)*(n
+1));
461 p
+= lstrlenW(p
) + 1;
469 static BOOL
process_args_from_reg( LPWSTR ident
, int *pargc
, WCHAR
***pargv
)
472 HKEY hkey
= 0, hkeyArgs
= 0;
473 DWORD sz
= 0, type
= 0;
477 r
= RegOpenKeyW(HKEY_LOCAL_MACHINE
, InstallRunOnce
, &hkey
);
478 if(r
!= ERROR_SUCCESS
)
480 r
= RegQueryValueExW(hkey
, ident
, 0, &type
, 0, &sz
);
481 if(r
== ERROR_SUCCESS
&& type
== REG_SZ
)
483 buf
= HeapAlloc(GetProcessHeap(), 0, sz
);
484 r
= RegQueryValueExW(hkey
, ident
, 0, &type
, (LPBYTE
)buf
, &sz
);
485 if( r
== ERROR_SUCCESS
)
487 process_args(buf
, pargc
, pargv
);
490 HeapFree(GetProcessHeap(), 0, buf
);
492 RegCloseKey(hkeyArgs
);
496 int WINAPI
WinMain(HINSTANCE hInstance
, HINSTANCE hPrevInstance
, LPSTR lpCmdLine
, int nCmdShow
)
499 BOOL FunctionInstall
= FALSE
;
500 BOOL FunctionInstallAdmin
= FALSE
;
501 BOOL FunctionRepair
= FALSE
;
502 BOOL FunctionAdvertise
= FALSE
;
503 BOOL FunctionPatch
= FALSE
;
504 BOOL FunctionDllRegisterServer
= FALSE
;
505 BOOL FunctionDllUnregisterServer
= FALSE
;
506 BOOL FunctionRegServer
= FALSE
;
507 BOOL FunctionUnregServer
= FALSE
;
508 BOOL FunctionServer
= FALSE
;
509 BOOL FunctionUnknown
= FALSE
;
511 LPWSTR PackageName
= NULL
;
512 LPWSTR Properties
= NULL
;
513 struct string_list
*property_list
= NULL
;
515 DWORD RepairMode
= 0;
517 DWORD_PTR AdvertiseMode
= 0;
518 struct string_list
*transform_list
= NULL
;
522 LPWSTR LogFileName
= NULL
;
523 DWORD LogAttributes
= 0;
525 LPWSTR PatchFileName
= NULL
;
526 INSTALLTYPE InstallType
= INSTALLTYPE_DEFAULT
;
528 INSTALLUILEVEL InstallUILevel
= INSTALLUILEVEL_FULL
;
530 LPWSTR DllName
= NULL
;
533 LPWSTR
*argvW
= NULL
;
535 /* parse the command line */
536 process_args( GetCommandLineW(), &argc
, &argvW
);
539 * If the args begin with /@ IDENT then we need to load the real
540 * command line out of the RunOnceEntries key in the registry.
541 * We do that before starting to process the real commandline,
542 * then overwrite the commandline again.
544 if(argc
>1 && msi_option_equal(argvW
[1], "@"))
546 if(!process_args_from_reg( argvW
[2], &argc
, &argvW
))
550 if (argc
== 3 && msi_option_equal(argvW
[1], "Embedding"))
551 return DoEmbedding( argvW
[2] );
553 for(i
= 1; i
< argc
; i
++)
555 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
557 if (msi_option_equal(argvW
[i
], "regserver"))
559 FunctionRegServer
= TRUE
;
561 else if (msi_option_equal(argvW
[i
], "unregserver") || msi_option_equal(argvW
[i
], "unregister"))
563 FunctionUnregServer
= TRUE
;
565 else if(msi_option_prefix(argvW
[i
], "i"))
567 LPWSTR argvWi
= argvW
[i
];
568 FunctionInstall
= TRUE
;
569 if(lstrlenW(argvWi
) > 2)
576 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
579 PackageName
= argvWi
;
581 else if(msi_option_equal(argvW
[i
], "a"))
583 FunctionInstall
= TRUE
;
584 FunctionInstallAdmin
= TRUE
;
585 InstallType
= INSTALLTYPE_NETWORK_IMAGE
;
589 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
590 PackageName
= argvW
[i
];
591 StringListAppend(&property_list
, ActionAdmin
);
593 else if(msi_option_prefix(argvW
[i
], "f"))
596 int len
= lstrlenW(argvW
[i
]);
597 FunctionRepair
= TRUE
;
598 for(j
= 2; j
< len
; j
++)
604 RepairMode
|= REINSTALLMODE_FILEMISSING
;
608 RepairMode
|= REINSTALLMODE_FILEOLDERVERSION
;
612 RepairMode
|= REINSTALLMODE_FILEEQUALVERSION
;
616 RepairMode
|= REINSTALLMODE_FILEEXACT
;
620 RepairMode
|= REINSTALLMODE_FILEVERIFY
;
624 RepairMode
|= REINSTALLMODE_FILEREPLACE
;
628 RepairMode
|= REINSTALLMODE_USERDATA
;
632 RepairMode
|= REINSTALLMODE_MACHINEDATA
;
636 RepairMode
|= REINSTALLMODE_SHORTCUT
;
640 RepairMode
|= REINSTALLMODE_PACKAGE
;
643 fprintf(stderr
, "Unknown option \"%c\" in Repair mode\n", argvW
[i
][j
]);
649 RepairMode
= REINSTALLMODE_FILEMISSING
|
650 REINSTALLMODE_FILEEQUALVERSION
|
651 REINSTALLMODE_FILEVERIFY
|
652 REINSTALLMODE_MACHINEDATA
|
653 REINSTALLMODE_SHORTCUT
;
658 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
659 PackageName
= argvW
[i
];
661 else if(msi_option_prefix(argvW
[i
], "x"))
663 FunctionInstall
= TRUE
;
664 PackageName
= argvW
[i
]+2;
670 PackageName
= argvW
[i
];
672 WINE_TRACE("PackageName = %s\n", wine_dbgstr_w(PackageName
));
673 StringListAppend(&property_list
, RemoveAll
);
675 else if(msi_option_prefix(argvW
[i
], "j"))
678 int len
= lstrlenW(argvW
[i
]);
679 FunctionAdvertise
= TRUE
;
680 for(j
= 2; j
< len
; j
++)
686 AdvertiseMode
= ADVERTISEFLAGS_USERASSIGN
;
690 AdvertiseMode
= ADVERTISEFLAGS_MACHINEASSIGN
;
693 fprintf(stderr
, "Unknown option \"%c\" in Advertise mode\n", argvW
[i
][j
]);
700 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
701 PackageName
= argvW
[i
];
703 else if(msi_strequal(argvW
[i
], "u"))
705 FunctionAdvertise
= TRUE
;
706 AdvertiseMode
= ADVERTISEFLAGS_USERASSIGN
;
710 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
711 PackageName
= argvW
[i
];
713 else if(msi_strequal(argvW
[i
], "m"))
715 FunctionAdvertise
= TRUE
;
716 AdvertiseMode
= ADVERTISEFLAGS_MACHINEASSIGN
;
720 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
721 PackageName
= argvW
[i
];
723 else if(msi_option_equal(argvW
[i
], "t"))
728 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
729 StringListAppend(&transform_list
, argvW
[i
]);
731 else if(msi_option_equal(argvW
[i
], "g"))
736 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
737 Language
= msi_atou(argvW
[i
]);
739 else if(msi_option_prefix(argvW
[i
], "l"))
742 int len
= lstrlenW(argvW
[i
]);
743 for(j
= 2; j
< len
; j
++)
749 LogMode
|= INSTALLLOGMODE_INFO
;
753 LogMode
|= INSTALLLOGMODE_WARNING
;
757 LogMode
|= INSTALLLOGMODE_ERROR
;
761 LogMode
|= INSTALLLOGMODE_ACTIONSTART
;
765 LogMode
|= INSTALLLOGMODE_ACTIONDATA
;
769 LogMode
|= INSTALLLOGMODE_USER
;
773 LogMode
|= INSTALLLOGMODE_COMMONDATA
;
777 LogMode
|= INSTALLLOGMODE_FATALEXIT
;
781 LogMode
|= INSTALLLOGMODE_OUTOFDISKSPACE
;
785 LogMode
|= INSTALLLOGMODE_PROPERTYDUMP
;
789 LogMode
|= INSTALLLOGMODE_VERBOSE
;
792 LogMode
= INSTALLLOGMODE_FATALEXIT
|
793 INSTALLLOGMODE_ERROR
|
794 INSTALLLOGMODE_WARNING
|
795 INSTALLLOGMODE_USER
|
796 INSTALLLOGMODE_INFO
|
797 INSTALLLOGMODE_RESOLVESOURCE
|
798 INSTALLLOGMODE_OUTOFDISKSPACE
|
799 INSTALLLOGMODE_ACTIONSTART
|
800 INSTALLLOGMODE_ACTIONDATA
|
801 INSTALLLOGMODE_COMMONDATA
|
802 INSTALLLOGMODE_PROPERTYDUMP
|
803 INSTALLLOGMODE_PROGRESS
|
804 INSTALLLOGMODE_INITIALIZE
|
805 INSTALLLOGMODE_TERMINATE
|
806 INSTALLLOGMODE_SHOWDIALOG
;
809 LogAttributes
|= INSTALLLOGATTRIBUTES_APPEND
;
812 LogAttributes
|= INSTALLLOGATTRIBUTES_FLUSHEACHLINE
;
821 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
822 LogFileName
= argvW
[i
];
823 if(MsiEnableLogW(LogMode
, LogFileName
, LogAttributes
) != ERROR_SUCCESS
)
825 fprintf(stderr
, "Logging in %s (0x%08x, %u) failed\n",
826 wine_dbgstr_w(LogFileName
), LogMode
, LogAttributes
);
830 else if(msi_option_equal(argvW
[i
], "p"))
832 FunctionPatch
= TRUE
;
836 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
837 PatchFileName
= argvW
[i
];
839 else if(msi_option_prefix(argvW
[i
], "q"))
841 if(lstrlenW(argvW
[i
]) == 2 || msi_strequal(argvW
[i
]+2, "n") ||
842 msi_strequal(argvW
[i
] + 2, "uiet"))
844 InstallUILevel
= INSTALLUILEVEL_NONE
;
846 else if(msi_strequal(argvW
[i
]+2, "b"))
848 InstallUILevel
= INSTALLUILEVEL_BASIC
;
850 else if(msi_strequal(argvW
[i
]+2, "r"))
852 InstallUILevel
= INSTALLUILEVEL_REDUCED
;
854 else if(msi_strequal(argvW
[i
]+2, "f"))
856 InstallUILevel
= INSTALLUILEVEL_FULL
|INSTALLUILEVEL_ENDDIALOG
;
858 else if(msi_strequal(argvW
[i
]+2, "n+"))
860 InstallUILevel
= INSTALLUILEVEL_NONE
|INSTALLUILEVEL_ENDDIALOG
;
862 else if(msi_strequal(argvW
[i
]+2, "b+"))
864 InstallUILevel
= INSTALLUILEVEL_BASIC
|INSTALLUILEVEL_ENDDIALOG
;
866 else if(msi_strequal(argvW
[i
]+2, "b-"))
868 InstallUILevel
= INSTALLUILEVEL_BASIC
|INSTALLUILEVEL_PROGRESSONLY
;
870 else if(msi_strequal(argvW
[i
]+2, "b+!"))
872 InstallUILevel
= INSTALLUILEVEL_BASIC
|INSTALLUILEVEL_ENDDIALOG
;
873 WINE_FIXME("Unknown modifier: !\n");
877 fprintf(stderr
, "Unknown option \"%s\" for UI level\n",
878 wine_dbgstr_w(argvW
[i
]+2));
881 else if(msi_option_equal(argvW
[i
], "y"))
883 FunctionDllRegisterServer
= TRUE
;
887 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
890 else if(msi_option_equal(argvW
[i
], "z"))
892 FunctionDllUnregisterServer
= TRUE
;
896 WINE_TRACE("argvW[%d] = %s\n", i
, wine_dbgstr_w(argvW
[i
]));
899 else if(msi_option_equal(argvW
[i
], "h") || msi_option_equal(argvW
[i
], "?"))
903 else if(msi_option_equal(argvW
[i
], "m"))
905 FunctionUnknown
= TRUE
;
906 WINE_FIXME("Unknown parameter /m\n");
908 else if(msi_option_equal(argvW
[i
], "D"))
910 FunctionUnknown
= TRUE
;
911 WINE_FIXME("Unknown parameter /D\n");
913 else if (msi_option_equal(argvW
[i
], "V"))
915 FunctionServer
= TRUE
;
918 StringListAppend(&property_list
, argvW
[i
]);
922 MsiSetInternalUI(InstallUILevel
, NULL
);
924 Properties
= build_properties( property_list
);
926 if(FunctionInstallAdmin
&& FunctionPatch
)
927 FunctionInstall
= FALSE
;
932 if(IsProductCode(PackageName
))
933 ReturnCode
= MsiConfigureProductExW(PackageName
, 0, INSTALLSTATE_DEFAULT
, Properties
);
935 ReturnCode
= MsiInstallProductW(PackageName
, Properties
);
937 else if(FunctionRepair
)
939 if(IsProductCode(PackageName
))
940 WINE_FIXME("Product code treatment not implemented yet\n");
942 ReturnCode
= MsiReinstallProductW(PackageName
, RepairMode
);
944 else if(FunctionAdvertise
)
946 LPWSTR Transforms
= build_transforms( property_list
);
947 ReturnCode
= MsiAdvertiseProductW(PackageName
, (LPWSTR
) AdvertiseMode
, Transforms
, Language
);
949 else if(FunctionPatch
)
951 ReturnCode
= MsiApplyPatchW(PatchFileName
, PackageName
, InstallType
, Properties
);
953 else if(FunctionDllRegisterServer
)
955 ReturnCode
= DoDllRegisterServer(DllName
);
957 else if(FunctionDllUnregisterServer
)
959 ReturnCode
= DoDllUnregisterServer(DllName
);
961 else if (FunctionRegServer
)
963 ReturnCode
= DoRegServer();
965 else if (FunctionUnregServer
)
967 WINE_FIXME( "/unregserver not implemented yet, ignoring\n" );
969 else if (FunctionServer
)
971 ReturnCode
= DoService();
973 else if (FunctionUnknown
)
975 WINE_FIXME( "Unknown function, ignoring\n" );