Commit c5a1443f authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

We cannot internally load the files in FileCost because that action

may be skipped or not called. So do it in CostInitialize. Quote the file path in SelfRegModules. Do not write squished null guids to the feature registration.
parent 32e93f30
...@@ -1763,67 +1763,6 @@ static void load_feature(MSIPACKAGE* package, MSIRECORD * row) ...@@ -1763,67 +1763,6 @@ static void load_feature(MSIPACKAGE* package, MSIRECORD * row)
msiobj_release(&view->hdr); msiobj_release(&view->hdr);
} }
/*
* I am not doing any of the costing functionality yet.
* Mostly looking at doing the Component and Feature loading
*
* The native MSI does A LOT of modification to tables here. Mostly adding
* a lot of temporary columns to the Feature and Component tables.
*
* note: Native msi also tracks the short filename. But I am only going to
* track the long ones. Also looking at this directory table
* it appears that the directory table does not get the parents
* resolved base on property only based on their entries in the
* directory table.
*/
static UINT ACTION_CostInitialize(MSIPACKAGE *package)
{
MSIQUERY * view;
MSIRECORD * row;
UINT rc;
static const WCHAR Query_all[] =
{'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ',
'F','e','a','t','u','r','e',0};
static const WCHAR szCosting[] =
{'C','o','s','t','i','n','g','C','o','m','p','l','e','t','e',0 };
static const WCHAR szZero[] = { '0', 0 };
WCHAR buffer[3];
DWORD sz = 3;
MSI_GetPropertyW(package, szCosting, buffer, &sz);
if (buffer[0]=='1')
return ERROR_SUCCESS;
MSI_SetPropertyW(package, szCosting, szZero);
MSI_SetPropertyW(package, cszRootDrive , c_colon);
rc = MSI_DatabaseOpenViewW(package->db,Query_all,&view);
if (rc != ERROR_SUCCESS)
return rc;
rc = MSI_ViewExecute(view,0);
if (rc != ERROR_SUCCESS)
{
MSI_ViewClose(view);
msiobj_release(&view->hdr);
return rc;
}
while (1)
{
DWORD rc;
rc = MSI_ViewFetch(view,&row);
if (rc != ERROR_SUCCESS)
break;
load_feature(package,row);
msiobj_release(&row->hdr);
}
MSI_ViewClose(view);
msiobj_release(&view->hdr);
return ERROR_SUCCESS;
}
static UINT load_file(MSIPACKAGE* package, MSIRECORD * row) static UINT load_file(MSIPACKAGE* package, MSIRECORD * row)
{ {
DWORD index = package->loaded_files; DWORD index = package->loaded_files;
...@@ -1875,7 +1814,7 @@ static UINT load_file(MSIPACKAGE* package, MSIRECORD * row) ...@@ -1875,7 +1814,7 @@ static UINT load_file(MSIPACKAGE* package, MSIRECORD * row)
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
static UINT ACTION_FileCost(MSIPACKAGE *package) static UINT load_all_files(MSIPACKAGE *package)
{ {
MSIQUERY * view; MSIQUERY * view;
MSIRECORD * row; MSIRECORD * row;
...@@ -1917,6 +1856,76 @@ static UINT ACTION_FileCost(MSIPACKAGE *package) ...@@ -1917,6 +1856,76 @@ static UINT ACTION_FileCost(MSIPACKAGE *package)
return ERROR_SUCCESS; return ERROR_SUCCESS;
} }
/*
* I am not doing any of the costing functionality yet.
* Mostly looking at doing the Component and Feature loading
*
* The native MSI does A LOT of modification to tables here. Mostly adding
* a lot of temporary columns to the Feature and Component tables.
*
* note: Native msi also tracks the short filename. But I am only going to
* track the long ones. Also looking at this directory table
* it appears that the directory table does not get the parents
* resolved base on property only based on their entries in the
* directory table.
*/
static UINT ACTION_CostInitialize(MSIPACKAGE *package)
{
MSIQUERY * view;
MSIRECORD * row;
UINT rc;
static const WCHAR Query_all[] =
{'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ',
'F','e','a','t','u','r','e',0};
static const WCHAR szCosting[] =
{'C','o','s','t','i','n','g','C','o','m','p','l','e','t','e',0 };
static const WCHAR szZero[] = { '0', 0 };
WCHAR buffer[3];
DWORD sz = 3;
MSI_GetPropertyW(package, szCosting, buffer, &sz);
if (buffer[0]=='1')
return ERROR_SUCCESS;
MSI_SetPropertyW(package, szCosting, szZero);
MSI_SetPropertyW(package, cszRootDrive , c_colon);
rc = MSI_DatabaseOpenViewW(package->db,Query_all,&view);
if (rc != ERROR_SUCCESS)
return rc;
rc = MSI_ViewExecute(view,0);
if (rc != ERROR_SUCCESS)
{
MSI_ViewClose(view);
msiobj_release(&view->hdr);
return rc;
}
while (1)
{
DWORD rc;
rc = MSI_ViewFetch(view,&row);
if (rc != ERROR_SUCCESS)
break;
load_feature(package,row);
msiobj_release(&row->hdr);
}
MSI_ViewClose(view);
msiobj_release(&view->hdr);
load_all_files(package);
return ERROR_SUCCESS;
}
static UINT ACTION_FileCost(MSIPACKAGE *package)
{
return ERROR_SUCCESS;
}
static INT load_folder(MSIPACKAGE *package, const WCHAR* dir) static INT load_folder(MSIPACKAGE *package, const WCHAR* dir)
{ {
static const WCHAR Query[] = static const WCHAR Query[] =
...@@ -4080,8 +4089,9 @@ static UINT ACTION_ProcessComponents(MSIPACKAGE *package) ...@@ -4080,8 +4089,9 @@ static UINT ACTION_ProcessComponents(MSIPACKAGE *package)
/* do the refcounting */ /* do the refcounting */
ACTION_RefCountComponent( package, i); ACTION_RefCountComponent( package, i);
TRACE("Component %s, Keypath=%s, RefCount=%i\n", TRACE("Component %s (%s), Keypath=%s, RefCount=%i\n",
debugstr_w(package->components[i].Component), debugstr_w(package->components[i].Component),
debugstr_w(squished_cc),
debugstr_w(package->components[i].FullKeypath), debugstr_w(package->components[i].FullKeypath),
package->components[i].RefCount); package->components[i].RefCount);
/* /*
...@@ -5498,7 +5508,8 @@ static UINT ACTION_SelfRegModules(MSIPACKAGE *package) ...@@ -5498,7 +5508,8 @@ static UINT ACTION_SelfRegModules(MSIPACKAGE *package)
'S','e','l','f','R','e','g',0}; 'S','e','l','f','R','e','g',0};
static const WCHAR ExeStr[] = static const WCHAR ExeStr[] =
{'r','e','g','s','v','r','3','2','.','e','x','e',' ','/','s',' ',0}; {'r','e','g','s','v','r','3','2','.','e','x','e',' ','\"',0};
static const WCHAR close[] = {'\"',0};
STARTUPINFOW si; STARTUPINFOW si;
PROCESS_INFORMATION info; PROCESS_INFORMATION info;
BOOL brc; BOOL brc;
...@@ -5552,6 +5563,7 @@ static UINT ACTION_SelfRegModules(MSIPACKAGE *package) ...@@ -5552,6 +5563,7 @@ static UINT ACTION_SelfRegModules(MSIPACKAGE *package)
filename = HeapAlloc(GetProcessHeap(),0,len*sizeof(WCHAR)); filename = HeapAlloc(GetProcessHeap(),0,len*sizeof(WCHAR));
strcpyW(filename,ExeStr); strcpyW(filename,ExeStr);
strcatW(filename,package->files[index].TargetPath); strcatW(filename,package->files[index].TargetPath);
strcatW(filename,close);
TRACE("Registering %s\n",debugstr_w(filename)); TRACE("Registering %s\n",debugstr_w(filename));
brc = CreateProcessW(NULL, filename, NULL, NULL, FALSE, 0, NULL, brc = CreateProcessW(NULL, filename, NULL, NULL, FALSE, 0, NULL,
...@@ -5617,6 +5629,9 @@ static UINT ACTION_PublishFeatures(MSIPACKAGE *package) ...@@ -5617,6 +5629,9 @@ static UINT ACTION_PublishFeatures(MSIPACKAGE *package)
{ {
WCHAR buf[21]; WCHAR buf[21];
memset(buf,0,sizeof(buf)); memset(buf,0,sizeof(buf));
if (package->components
[package->features[i].Components[j]].ComponentId[0]!=0)
{
TRACE("From %s\n",debugstr_w(package->components TRACE("From %s\n",debugstr_w(package->components
[package->features[i].Components[j]].ComponentId)); [package->features[i].Components[j]].ComponentId));
CLSIDFromString(package->components CLSIDFromString(package->components
...@@ -5626,6 +5641,7 @@ static UINT ACTION_PublishFeatures(MSIPACKAGE *package) ...@@ -5626,6 +5641,7 @@ static UINT ACTION_PublishFeatures(MSIPACKAGE *package)
TRACE("to %s\n",debugstr_w(buf)); TRACE("to %s\n",debugstr_w(buf));
strcatW(data,buf); strcatW(data,buf);
} }
}
if (package->features[i].Feature_Parent[0]) if (package->features[i].Feature_Parent[0])
{ {
static const WCHAR sep[] = {'\2',0}; static const WCHAR sep[] = {'\2',0};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment