44#define REG_PROGRESS_VALUE 13200
45#define COMPONENT_PROGRESS_VALUE 24000
132 if (in_quotes &&
p[1] !=
'\"')
count--;
148 if (in_quotes)
count--;
153 if (!
count)
goto done;
168 if (in_quotes &&
p[1] !=
'\"')
count--;
198 if(quotes) *quotes =
count;
229 while (*
ptr ==
' ')
ptr++;
243 if (!preserve_case)
wcsupr( prop );
246 while (*ptr2 ==
' ') ptr2++;
253 WARN(
"unbalanced quotes\n");
285 while (*
cmd ==
' ')
cmd++;
294 while (*
cmd ==
' ')
cmd++;
298 if (found)
return cmd;
419 ERR(
"Error is retrieving action name\n");
443 if (package->need_reboot_now)
445 TRACE(
"action %s asked for immediate reboot, suspending installation\n",
475 TRACE(
"Execute Sequence already Run\n");
482 L"SELECT * FROM `InstallExecuteSequence` WHERE `Sequence` > 0 ORDER BY `Sequence`");
485 TRACE(
"Running the actions\n");
500 L"SELECT * FROM `InstallUISequence` WHERE `Sequence` > 0 ORDER BY `Sequence`",
504 TRACE(
"Running the actions\n");
652 TRACE(
"component not scheduled for installation: %s\n",
debugstr_w(component));
659 ERR(
"Unable to get folder id\n");
733 TRACE(
"component not scheduled for removal %s\n",
debugstr_w(component));
740 ERR(
"Unable to get folder id\n");
918 rc =
MSI_OpenQuery( package->db, &
view,
L"SELECT `Component_` FROM `FeatureComponents` WHERE `Feature_` = '%s'",
940 if (!
child->Feature_Parent)
1023 WARN(
"query failed\n");
1049 if (!
file->Component)
1147 WARN(
"query failed\n");
1160 const WCHAR *file_key;
1170 ERR(
"Failed to find target for patch in File table\n");
1186 TRACE(
"Patch loaded (file %s sequence %u)\n",
debugstr_w(patch->File->File), patch->Sequence);
1230 static const WCHAR select[] =
L"SELECT `Row`, `Column` FROM `_TransformView` WHERE `Table`='Component'";
1258 if (!
MSI_OpenQuery( package->
db, &
view,
L"SELECT * FROM `CreateFolder` WHERE `Directory_` = '%s'",
1280 LPWSTR p, tgt_short, tgt_long, src_short, src_long;
1300 if (tgt_short && !
wcscmp(
L".", tgt_short ))
1302 if (src_short && !
wcscmp(
L".", src_short ))
1306 tgt_long = tgt_short;
1309 src_short = tgt_short;
1310 src_long = tgt_long;
1314 src_long = src_short;
1412 ERR(
"Execution of script %i halted; action %s returned %u\n",
1425 ERR(
"Execution of script %i halted; action %s returned %u\n",
1609 TRACE(
"child %s (level %d request %d) follows disabled parent %s (level %d request %d)\n",
1610 debugstr_w(
fl->feature->Feature),
fl->feature->Level,
fl->feature->ActionRequest,
1629 TRACE(
"child %s (level %d request %d) follows parent %s (level %d request %d)\n",
1630 debugstr_w(
fl->feature->Feature),
fl->feature->Level,
fl->feature->ActionRequest,
1634 fl->feature->ActionRequest =
feature->ActionRequest;
1646 TRACE(
"Checking Install Level\n");
1720 cur->Action =
cur->Installed;
1721 cur->ActionRequest =
cur->Installed;
1743 if (!
cur->Feature_Parent)
1754 if (
feature->Feature_Parent)
continue;
1764 TRACE(
"examining feature %s (level %d installed %d request %d action %d)\n",
1784 switch (
feature->ActionRequest)
1897 TRACE(
"component %s (installed %d request %d action %d)\n",
1950 if (ms1 > ms2)
return 1;
1951 else if (ms1 < ms2)
return -1;
2064 WCHAR *font_version;
2074 if (
file->IsCompressed)
2130 while (*
p !=
' ' && (*
q = *
p))
2134 if (*
p !=
'\\' || *
q !=
'\\')
2148 if (
len == 0 ||
p[-1] ==
'\\' ||
p[
n] ==
'\\' )
2151 while (
n && (*
q++ = *
p++))
n--;
2153 while (
q -
ret > 0 &&
q[-1] ==
' ')
q--;
2154 if (
q -
ret > 0 &&
q[-1] !=
'\\')
2212 folder->ResolvedTarget = normalized_path;
2241 TRACE(
"Building directory properties\n");
2244 TRACE(
"Evaluating component conditions\n");
2263 TRACE(
"Evaluating feature conditions\n");
2275 TRACE(
"Calculating file cost\n");
2290 if (((primary_folder[0] >=
'A' && primary_folder[0] <=
'Z') ||
2291 (primary_folder[0] >=
'a' && primary_folder[0] <=
'z')) && primary_folder[1] ==
':')
2297 primary_folder[2] = 0;
2379 TRACE(
"Uneven byte count\n");
2409 if ( (*
p <
'0') || (*
p >
'9') )
2415 if (deformated[0] ==
'-')
2428 if (
value[0] ==
'#')
2431 if (
value[1] ==
'%')
2454 ret =
L"HKEY_LOCAL_MACHINE\\";
2459 ret =
L"HKEY_CURRENT_USER\\";
2464 ret =
L"HKEY_CLASSES_ROOT\\";
2468 ret =
L"HKEY_CURRENT_USER\\";
2472 ret =
L"HKEY_LOCAL_MACHINE\\";
2476 ret =
L"HKEY_USERS\\";
2479 ERR(
"Unknown root %i\n",
root);
2571 for (
i = 0;
i < left_count;
i++)
2576 for (
i = 0;
i < right_count;
i++)
2589 unsigned int i,
j,
k;
2591 for (
i = 0;
i < new_count;
i++)
2593 for (
j = 0;
j < old_count;
j++)
2595 if (old[
j] && !
wcscmp(
new[
i], old[
j] ))
2598 for (
k =
j;
k < old_count - 1;
k++) { old[
k] = old[
k + 1]; }
2631 ERR(
"unhandled join op %u\n",
op);
2639 DWORD i, old_len = 0, new_len = 0, old_count = 0, new_count = 0;
2645 if (new_size /
sizeof(
WCHAR) - 1 > 1)
2647 new_ptr = (
const WCHAR *)new_value;
2648 new_len = new_size /
sizeof(
WCHAR) - 1;
2650 if (!new_ptr[0] && new_ptr[new_len - 1])
2656 else if (new_ptr[0] && !new_ptr[new_len - 1])
2661 else if (new_len > 2 && !new_ptr[0] && !new_ptr[new_len - 1])
2669 if (old_size /
sizeof(
WCHAR) - 1 > 1)
2672 old_len = old_size /
sizeof(
WCHAR) - 1;
2696 HKEY root_key, hkey;
2697 DWORD type, old_type, new_size, old_size = 0;
2698 LPWSTR deformated, uikey;
2716 TRACE(
"component not scheduled for installation %s\n",
debugstr_w(component));
2780 if (deformated || new_size)
2832 res =
RegQueryInfoKeyW(
key, 0, 0, 0, &subkeys, 0, 0, &
values, 0, 0, 0, 0);
2851 if (!
p[1])
continue;
2908 LPWSTR deformated_key, deformated_name, ui_key_str;
2926 TRACE(
"component not scheduled for removal %s\n",
debugstr_w(component));
2952 lstrcpyW( ui_key_str, root_key_str );
2953 lstrcatW( ui_key_str, deformated_key );
2958 else delete_value( comp, hkey_root, deformated_key, deformated_name );
2976 LPWSTR deformated_key, deformated_name, ui_key_str;
2992 TRACE(
"component not scheduled for installation %s\n",
debugstr_w(component));
3015 lstrcpyW( ui_key_str, root_key_str );
3016 lstrcatW( ui_key_str, deformated_key );
3021 else delete_value( comp, hkey_root, deformated_key, deformated_name );
3077 TRACE(
"InstallValidate\n");
3098 TRACE(
"Feature: %s Installed %d Request %d Action %d\n",
3135 TRACE(
"Checking launch conditions\n");
3170 if (deformated_name)
3175 if (deformated_name)
3188 FIXME(
"UNIMPLEMENTED keypath as ODBC Source\n");
3281 if (
file->Component == comp)
3347 TRACE(
"Component %s (%s) Keypath=%s RefCount=%u Clients=%u Action=%u\n",
3380 L"ORDER BY `DiskId`",
file->Sequence)))
3422 WARN(
"failed to open component key %u\n", rc );
3427 if (
res)
WARN(
"failed to delete component value %ld\n",
res );
3488 ITypeLib_GetLibAttr(tl_struct->
ptLib, &
attr);
3491 ITypeLib_ReleaseTLibAttr(tl_struct->
ptLib,
attr);
3498 ITypeLib_ReleaseTLibAttr(tl_struct->
ptLib,
attr);
3499 ITypeLib_Release(tl_struct->
ptLib);
3541 TRACE(
"component not scheduled for installation %s\n",
debugstr_w(component));
3547 TRACE(
"component has no key path\n");
3575 ERR(
"Failed to register type library %s\n",
debugstr_w(tl_struct.path));
3579 ITypeLib_Release(tl_struct.ptLib);
3582 else ERR(
"Failed to load type library %s\n",
debugstr_w(tl_struct.source));
3592 ERR(
"failed to load type library: %#lx\n",
hr );
3596 ITypeLib_Release(tlib);
3638 TRACE(
"component not scheduled for removal %s\n",
debugstr_w(component));
3657 WARN(
"failed to unregister typelib: %#lx\n",
hr );
3699 if (!extension ||
wcsicmp( extension,
L".lnk" ))
3749 TRACE(
"component not scheduled for installation %s\n",
debugstr_w(component));
3755 &IID_IShellLinkW, (
LPVOID *) &sl );
3759 ERR(
"CLSID_ShellLink not available\n");
3766 ERR(
"QueryInterface(IID_IPersistFile) failed\n");
3775 IShellLinkW_SetPath( sl,
path );
3780 FIXME(
"poorly handled shortcut format, advertised shortcut\n");
3782 IShellLinkW_SetPath( sl,
path );
3790 IShellLinkW_SetArguments(sl,deformated);
3815 IShellLinkW_SetIconLocation(sl,
path,
index);
3820 IShellLinkW_SetShowCmd(sl,