44#define REG_PROGRESS_VALUE 13200
45#define COMPONENT_PROGRESS_VALUE 24000
131 if (in_quotes &&
p[1] !=
'\"')
count--;
147 if (in_quotes)
count--;
152 if (!
count)
goto done;
167 if (in_quotes &&
p[1] !=
'\"')
count--;
197 if(quotes) *quotes =
count;
228 while (*
ptr ==
' ')
ptr++;
242 if (!preserve_case)
wcsupr( prop );
245 while (*ptr2 ==
' ') ptr2++;
252 WARN(
"unbalanced quotes\n");
284 while (*
cmd ==
' ')
cmd++;
293 while (*
cmd ==
' ')
cmd++;
297 if (found)
return cmd;
417 ERR(
"Error is retrieving action name\n");
441 if (package->need_reboot_now)
443 TRACE(
"action %s asked for immediate reboot, suspending installation\n",
473 TRACE(
"Execute Sequence already Run\n");
480 L"SELECT * FROM `InstallExecuteSequence` WHERE `Sequence` > 0 ORDER BY `Sequence`");
483 TRACE(
"Running the actions\n");
498 L"SELECT * FROM `InstallUISequence` WHERE `Sequence` > 0 ORDER BY `Sequence`",
502 TRACE(
"Running the actions\n");
650 TRACE(
"component not scheduled for installation: %s\n",
debugstr_w(component));
657 ERR(
"Unable to get folder id\n");
731 TRACE(
"component not scheduled for removal %s\n",
debugstr_w(component));
738 ERR(
"Unable to get folder id\n");
828 cl =
malloc(
sizeof(*cl) );
917 rc =
MSI_OpenQuery( package->db, &
view,
L"SELECT `Component_` FROM `FeatureComponents` WHERE `Feature_` = '%s'",
939 if (!
child->Feature_Parent)
1022 WARN(
"query failed\n");
1048 if (!
file->Component)
1146 WARN(
"query failed\n");
1159 const WCHAR *file_key;
1169 ERR(
"Failed to find target for patch in File table\n");
1185 TRACE(
"Patch loaded (file %s sequence %u)\n",
debugstr_w(patch->File->File), patch->Sequence);
1229 static const WCHAR select[] =
L"SELECT `Row`, `Column` FROM `_TransformView` WHERE `Table`='Component'";
1257 if (!
MSI_OpenQuery( package->
db, &
view,
L"SELECT * FROM `CreateFolder` WHERE `Directory_` = '%s'",
1279 LPWSTR p, tgt_short, tgt_long, src_short, src_long;
1299 if (tgt_short && !
wcscmp(
L".", tgt_short ))
1301 if (src_short && !
wcscmp(
L".", src_short ))
1305 tgt_long = tgt_short;
1308 src_short = tgt_short;
1309 src_long = tgt_long;
1313 src_long = src_short;
1411 ERR(
"Execution of script %i halted; action %s returned %u\n",
1424 ERR(
"Execution of script %i halted; action %s returned %u\n",
1608 TRACE(
"child %s (level %d request %d) follows disabled parent %s (level %d request %d)\n",
1609 debugstr_w(
fl->feature->Feature),
fl->feature->Level,
fl->feature->ActionRequest,
1628 TRACE(
"child %s (level %d request %d) follows parent %s (level %d request %d)\n",
1629 debugstr_w(
fl->feature->Feature),
fl->feature->Level,
fl->feature->ActionRequest,
1633 fl->feature->ActionRequest =
feature->ActionRequest;
1645 TRACE(
"Checking Install Level\n");
1719 cur->Action =
cur->Installed;
1720 cur->ActionRequest =
cur->Installed;
1742 if (!
cur->Feature_Parent)
1753 if (
feature->Feature_Parent)
continue;
1763 TRACE(
"examining feature %s (level %d installed %d request %d action %d)\n",
1783 switch (
feature->ActionRequest)
1896 TRACE(
"component %s (installed %d request %d action %d)\n",
1949 if (ms1 > ms2)
return 1;
1950 else if (ms1 < ms2)
return -1;
2063 WCHAR *font_version;
2073 if (
file->IsCompressed)
2094 free( file_version );
2103 free( font_version );
2128 while (*
p !=
' ' && (*
q = *
p))
2132 if (*
p !=
'\\' || *
q !=
'\\')
2146 if (
len == 0 ||
p[-1] ==
'\\' ||
p[
n] ==
'\\' )
2149 while (
n && (*
q++ = *
p++))
n--;
2151 while (
q -
ret > 0 &&
q[-1] ==
' ')
q--;
2152 if (
q -
ret > 0 &&
q[-1] !=
'\\')
2210 folder->ResolvedTarget = normalized_path;
2239 TRACE(
"Building directory properties\n");
2242 TRACE(
"Evaluating component conditions\n");
2261 TRACE(
"Evaluating feature conditions\n");
2273 TRACE(
"Calculating file cost\n");
2288 if (((primary_folder[0] >=
'A' && primary_folder[0] <=
'Z') ||
2289 (primary_folder[0] >=
'a' && primary_folder[0] <=
'z')) && primary_folder[1] ==
':')
2295 primary_folder[2] = 0;
2321 free( primary_folder );
2323 free( primary_key );
2377 TRACE(
"Uneven byte count\n");
2407 if ( (*
p <
'0') || (*
p >
'9') )
2413 if (deformated[0] ==
'-')
2426 if (
value[0] ==
'#')
2429 if (
value[1] ==
'%')
2452 ret =
L"HKEY_LOCAL_MACHINE\\";
2457 ret =
L"HKEY_CURRENT_USER\\";
2462 ret =
L"HKEY_CLASSES_ROOT\\";
2466 ret =
L"HKEY_CURRENT_USER\\";
2470 ret =
L"HKEY_LOCAL_MACHINE\\";
2474 ret =
L"HKEY_USERS\\";
2477 ERR(
"Unknown root %i\n",
root);
2569 for (
i = 0;
i < left_count;
i++)
2574 for (
i = 0;
i < right_count;
i++)
2587 unsigned int i,
j,
k;
2589 for (
i = 0;
i < new_count;
i++)
2591 for (
j = 0;
j < old_count;
j++)
2593 if (old[
j] && !
wcscmp(
new[
i], old[
j] ))
2596 for (
k =
j;
k < old_count - 1;
k++) { old[
k] = old[
k + 1]; }
2629 ERR(
"unhandled join op %u\n",
op);
2637 DWORD i, old_len = 0, new_len = 0, old_count = 0, new_count = 0;
2645 new_ptr = (
const WCHAR *)new_value;
2648 if (!new_ptr[0] && new_ptr[new_len - 1])
2654 else if (new_ptr[0] && !new_ptr[new_len - 1])
2659 else if (new_len > 2 && !new_ptr[0] && !new_ptr[new_len - 1])
2674 for (
i = 0;
i < old_count;
i++)
free( old[
i] );
2675 for (
i = 0;
i < new_count;
i++)
free(
new[
i] );
2694 HKEY root_key, hkey;
2696 LPWSTR deformated, uikey;
2714 TRACE(
"component not scheduled for installation %s\n",
debugstr_w(component));
2830 res =
RegQueryInfoKeyW(
key, 0, 0, 0, &subkeys, 0, 0, &
values, 0, 0, 0, 0);
2849 if (!
p[1])
continue;
2906 LPWSTR deformated_key, deformated_name, ui_key_str;
2924 TRACE(
"component not scheduled for removal %s\n",
debugstr_w(component));
2950 lstrcpyW( ui_key_str, root_key_str );
2951 lstrcatW( ui_key_str, deformated_key );
2956 else delete_value( comp, hkey_root, deformated_key, deformated_name );
2957 free( deformated_key );
2966 free( deformated_name );
2974 LPWSTR deformated_key, deformated_name, ui_key_str;
2990 TRACE(
"component not scheduled for installation %s\n",
debugstr_w(component));
3013 lstrcpyW( ui_key_str, root_key_str );
3014 lstrcatW( ui_key_str, deformated_key );
3019 else delete_value( comp, hkey_root, deformated_key, deformated_name );
3020 free( deformated_key );
3029 free( deformated_name );
3075 TRACE(
"InstallValidate\n");
3096 TRACE(
"Feature: %s Installed %d Request %d Action %d\n",
3133 TRACE(
"Checking launch conditions\n");
3168 if (deformated_name)
3173 if (deformated_name)
3179 free(deformated_name);
3186 FIXME(
"UNIMPLEMENTED keypath as ODBC Source\n");
3279 if (
file->Component == comp)
3345 TRACE(
"Component %s (%s) Keypath=%s RefCount=%u Clients=%u Action=%u\n",
3378 L"ORDER BY `DiskId`",
file->Sequence)))
3420 WARN(
"failed to open component key %u\n", rc );
3425 if (
res)
WARN(
"failed to delete component value %ld\n",
res );
3486 ITypeLib_GetLibAttr(tl_struct->
ptLib, &
attr);
3489 ITypeLib_ReleaseTLibAttr(tl_struct->
ptLib,
attr);
3496 ITypeLib_ReleaseTLibAttr(tl_struct->
ptLib,
attr);
3497 ITypeLib_Release(tl_struct->
ptLib);
3539 TRACE(
"component not scheduled for installation %s\n",
debugstr_w(component));
3545 TRACE(
"component has no key path\n");
3573 ERR(
"Failed to register type library %s\n",
debugstr_w(tl_struct.path));
3577 ITypeLib_Release(tl_struct.ptLib);
3578 free(tl_struct.path);
3580 else ERR(
"Failed to load type library %s\n",
debugstr_w(tl_struct.source));
3583 free(tl_struct.source);
3590 ERR(
"failed to load type library: %#lx\n",
hr );
3594 ITypeLib_Release(tlib);
3636 TRACE(
"component not scheduled for removal %s\n",
debugstr_w(component));
3655 WARN(
"failed to unregister typelib: %#lx\n",
hr );
3698 if (!extension ||
wcsicmp( extension,
L".lnk" ))
3702 if (!new_filename)
goto done;
3751 TRACE(
"component not scheduled for installation %s\n",
debugstr_w(component));
3757 &IID_IShellLinkW, (
LPVOID *) &sl );
3761 ERR(
"CLSID_ShellLink not available\n");
3768 ERR(
"QueryInterface(IID_IPersistFile) failed\n");
3777 IShellLinkW_SetPath( sl,
path );
3782 FIXME(
"poorly handled shortcut format, advertised shortcut\n");
3784 IShellLinkW_SetPath( sl,
path );
3792 IShellLinkW_SetArguments(sl,deformated);