ReactOS  0.4.13-dev-73-gcfe54aa
install.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "wine/debug.h"
#include "msi.h"
#include "msidefs.h"
#include "objbase.h"
#include "oleauto.h"
#include "msipriv.h"
#include "msiserver.h"
#include "wine/unicode.h"
Include dependency graph for install.c:

Go to the source code of this file.

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msi)
 
UINT WINAPI MsiDoActionA (MSIHANDLE hInstall, LPCSTR szAction)
 
UINT WINAPI MsiDoActionW (MSIHANDLE hInstall, LPCWSTR szAction)
 
UINT WINAPI MsiSequenceA (MSIHANDLE hInstall, LPCSTR szTable, INT iSequenceMode)
 
UINT WINAPI MsiSequenceW (MSIHANDLE hInstall, LPCWSTR szTable, INT iSequenceMode)
 
UINT msi_strcpy_to_awstring (const WCHAR *str, int len, awstring *awbuf, DWORD *sz)
 
const WCHARmsi_get_target_folder (MSIPACKAGE *package, const WCHAR *name)
 
static UINT MSI_GetTargetPath (MSIHANDLE hInstall, LPCWSTR szFolder, awstring *szPathBuf, LPDWORD pcchPathBuf)
 
UINT WINAPI MsiGetTargetPathA (MSIHANDLE hInstall, LPCSTR szFolder, LPSTR szPathBuf, LPDWORD pcchPathBuf)
 
UINT WINAPI MsiGetTargetPathW (MSIHANDLE hInstall, LPCWSTR szFolder, LPWSTR szPathBuf, LPDWORD pcchPathBuf)
 
static WCHARget_source_root (MSIPACKAGE *package)
 
WCHARmsi_resolve_source_folder (MSIPACKAGE *package, const WCHAR *name, MSIFOLDER **folder)
 
static UINT MSI_GetSourcePath (MSIHANDLE hInstall, LPCWSTR szFolder, awstring *szPathBuf, LPDWORD pcchPathBuf)
 
UINT WINAPI MsiGetSourcePathA (MSIHANDLE hInstall, LPCSTR szFolder, LPSTR szPathBuf, LPDWORD pcchPathBuf)
 
UINT WINAPI MsiGetSourcePathW (MSIHANDLE hInstall, LPCWSTR szFolder, LPWSTR szPathBuf, LPDWORD pcchPathBuf)
 
UINT WINAPI MsiSetTargetPathA (MSIHANDLE hInstall, LPCSTR szFolder, LPCSTR szFolderPath)
 
static void set_target_path (MSIPACKAGE *package, MSIFOLDER *folder, const WCHAR *path)
 
UINT MSI_SetTargetPathW (MSIPACKAGE *package, LPCWSTR szFolder, LPCWSTR szFolderPath)
 
UINT WINAPI MsiSetTargetPathW (MSIHANDLE hInstall, LPCWSTR szFolder, LPCWSTR szFolderPath)
 
BOOL WINAPI MsiGetMode (MSIHANDLE hInstall, MSIRUNMODE iRunMode)
 
UINT WINAPI MsiSetMode (MSIHANDLE hInstall, MSIRUNMODE iRunMode, BOOL fState)
 
UINT WINAPI MsiSetFeatureStateA (MSIHANDLE hInstall, LPCSTR szFeature, INSTALLSTATE iState)
 
void ACTION_UpdateComponentStates (MSIPACKAGE *package, MSIFEATURE *feature)
 
UINT MSI_SetFeatureStateW (MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE iState)
 
UINT WINAPI MsiSetFeatureStateW (MSIHANDLE hInstall, LPCWSTR szFeature, INSTALLSTATE iState)
 
UINT WINAPI MsiSetFeatureAttributesA (MSIHANDLE handle, LPCSTR feature, DWORD attrs)
 
static DWORD unmap_feature_attributes (DWORD attrs)
 
UINT WINAPI MsiSetFeatureAttributesW (MSIHANDLE handle, LPCWSTR name, DWORD attrs)
 
UINT WINAPI MsiGetFeatureStateA (MSIHANDLE hInstall, LPCSTR szFeature, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
 
UINT MSI_GetFeatureStateW (MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
 
UINT WINAPI MsiGetFeatureStateW (MSIHANDLE hInstall, LPCWSTR szFeature, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
 
UINT WINAPI MsiGetFeatureCostA (MSIHANDLE hInstall, LPCSTR szFeature, MSICOSTTREE iCostTree, INSTALLSTATE iState, LPINT piCost)
 
static INT feature_cost (MSIFEATURE *feature)
 
UINT MSI_GetFeatureCost (MSIPACKAGE *package, MSIFEATURE *feature, MSICOSTTREE tree, INSTALLSTATE state, LPINT cost)
 
UINT WINAPI MsiGetFeatureCostW (MSIHANDLE hInstall, LPCWSTR szFeature, MSICOSTTREE iCostTree, INSTALLSTATE iState, LPINT piCost)
 
UINT WINAPI MsiGetFeatureInfoA (MSIHANDLE handle, LPCSTR feature, LPDWORD attrs, LPSTR title, LPDWORD title_len, LPSTR help, LPDWORD help_len)
 
static DWORD map_feature_attributes (DWORD attrs)
 
static UINT MSI_GetFeatureInfo (MSIPACKAGE *package, LPCWSTR name, LPDWORD attrs, LPWSTR title, LPDWORD title_len, LPWSTR help, LPDWORD help_len)
 
UINT WINAPI MsiGetFeatureInfoW (MSIHANDLE handle, LPCWSTR feature, LPDWORD attrs, LPWSTR title, LPDWORD title_len, LPWSTR help, LPDWORD help_len)
 
UINT WINAPI MsiSetComponentStateA (MSIHANDLE hInstall, LPCSTR szComponent, INSTALLSTATE iState)
 
UINT WINAPI MsiGetComponentStateA (MSIHANDLE hInstall, LPCSTR szComponent, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
 
static UINT MSI_SetComponentStateW (MSIPACKAGE *package, LPCWSTR szComponent, INSTALLSTATE iState)
 
UINT MSI_GetComponentStateW (MSIPACKAGE *package, LPCWSTR szComponent, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
 
UINT WINAPI MsiSetComponentStateW (MSIHANDLE hInstall, LPCWSTR szComponent, INSTALLSTATE iState)
 
UINT WINAPI MsiGetComponentStateW (MSIHANDLE hInstall, LPCWSTR szComponent, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
 
LANGID WINAPI MsiGetLanguage (MSIHANDLE hInstall)
 
UINT MSI_SetInstallLevel (MSIPACKAGE *package, int iInstallLevel)
 
UINT WINAPI MsiSetInstallLevel (MSIHANDLE hInstall, int iInstallLevel)
 
UINT WINAPI MsiGetFeatureValidStatesW (MSIHANDLE hInstall, LPCWSTR szFeature, LPDWORD pInstallState)
 
UINT WINAPI MsiGetFeatureValidStatesA (MSIHANDLE hInstall, LPCSTR szFeature, LPDWORD pInstallState)
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 23 of file install.c.

Function Documentation

◆ ACTION_UpdateComponentStates()

void ACTION_UpdateComponentStates ( MSIPACKAGE package,
MSIFEATURE feature 
)

Definition at line 858 of file install.c.

859 {
860  INSTALLSTATE newstate;
861  ComponentList *cl;
862 
863  newstate = feature->ActionRequest;
864  if (newstate == INSTALLSTATE_ABSENT) newstate = INSTALLSTATE_UNKNOWN;
865 
866  LIST_FOR_EACH_ENTRY(cl, &feature->Components, ComponentList, entry)
867  {
868  MSICOMPONENT *component = cl->component;
869 
870  if (!component->Enabled) continue;
871 
872  TRACE("Modifying (%d): Component %s (Installed %d, Action %d, Request %d)\n",
873  newstate, debugstr_w(component->Component), component->Installed,
874  component->Action, component->ActionRequest);
875 
876  if (newstate == INSTALLSTATE_LOCAL)
877  {
878  component->Action = INSTALLSTATE_LOCAL;
879  component->ActionRequest = INSTALLSTATE_LOCAL;
880  }
881  else
882  {
883  ComponentList *clist;
884  MSIFEATURE *f;
885 
886  component->hasLocalFeature = FALSE;
887 
888  component->Action = newstate;
889  component->ActionRequest = newstate;
890  /* if any other feature wants it local we need to set it local */
892  {
893  if ( f->ActionRequest != INSTALLSTATE_LOCAL &&
894  f->ActionRequest != INSTALLSTATE_SOURCE )
895  {
896  continue;
897  }
898  LIST_FOR_EACH_ENTRY(clist, &f->Components, ComponentList, entry)
899  {
900  if (clist->component == component &&
901  (f->ActionRequest == INSTALLSTATE_LOCAL ||
902  f->ActionRequest == INSTALLSTATE_SOURCE))
903  {
904  TRACE("Saved by %s\n", debugstr_w(f->Feature));
905  component->hasLocalFeature = TRUE;
906 
908  {
909  if (f->Attributes & msidbFeatureAttributesFavorSource)
910  {
911  component->Action = INSTALLSTATE_SOURCE;
912  component->ActionRequest = INSTALLSTATE_SOURCE;
913  }
914  else
915  {
916  component->Action = INSTALLSTATE_LOCAL;
917  component->ActionRequest = INSTALLSTATE_LOCAL;
918  }
919  }
920  else if (component->Attributes & msidbComponentAttributesSourceOnly)
921  {
922  component->Action = INSTALLSTATE_SOURCE;
923  component->ActionRequest = INSTALLSTATE_SOURCE;
924  }
925  else
926  {
927  component->Action = INSTALLSTATE_LOCAL;
928  component->ActionRequest = INSTALLSTATE_LOCAL;
929  }
930  }
931  }
932  }
933  }
934  TRACE("Result (%d): Component %s (Installed %d, Action %d, Request %d)\n",
935  newstate, debugstr_w(component->Component), component->Installed,
936  component->Action, component->ActionRequest);
937  }
938 }
INTERNETFEATURELIST feature
Definition: misc.c:1689
#define TRUE
Definition: types.h:120
uint8_t entry
Definition: isohybrid.c:63
INSTALLSTATE Action
Definition: msipriv.h:510
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define debugstr_w
Definition: kernel32.h:32
INSTALLSTATE ActionRequest
Definition: msipriv.h:509
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
struct list features
Definition: msipriv.h:393
LPWSTR Component
Definition: msipriv.h:502
unsigned int hasLocalFeature
Definition: msipriv.h:522
int INSTALLSTATE
Definition: msiserver.idl:35
#define f
Definition: ke_i.h:83
INSTALLSTATE Installed
Definition: msipriv.h:508
MSICOMPONENT * component
Definition: msipriv.h:529

Referenced by msi_seltree_update_feature_installstate(), and MSI_SetFeatureStateW().

◆ feature_cost()

static INT feature_cost ( MSIFEATURE feature)
static

Definition at line 1189 of file install.c.

1190 {
1191  INT cost = 0;
1192  ComponentList *cl;
1193 
1194  LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry )
1195  {
1196  cost += cl->component->Cost;
1197  }
1198  return cost;
1199 }
INTERNETFEATURELIST feature
Definition: misc.c:1689
uint8_t entry
Definition: isohybrid.c:63
int32_t INT
Definition: typedefs.h:56
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
MSICOMPONENT * component
Definition: msipriv.h:529

Referenced by MSI_GetFeatureCost().

◆ get_source_root()

static WCHAR* get_source_root ( MSIPACKAGE package)
static

Definition at line 345 of file install.c.

346 {
347  msi_set_sourcedir_props( package, FALSE );
348  return msi_dup_property( package->db, szSourceDir );
349 }
UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace)
Definition: action.c:441
MSIDATABASE * db
Definition: msipriv.h:386
static const WCHAR szSourceDir[]
Definition: msipriv.h:1100
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop) DECLSPEC_HIDDEN
Definition: package.c:2370

Referenced by msi_resolve_source_folder().

◆ map_feature_attributes()

static DWORD map_feature_attributes ( DWORD  attrs)
static

Definition at line 1346 of file install.c.

1347 {
1348  DWORD ret = 0;
1349 
1356  return ret;
1357 }
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret

Referenced by MSI_GetFeatureInfo().

◆ msi_get_target_folder()

const WCHAR* msi_get_target_folder ( MSIPACKAGE package,
const WCHAR name 
)

Definition at line 209 of file install.c.

210 {
212 
213  if (!folder) return NULL;
214  if (!folder->ResolvedTarget)
215  {
217  while (parent->Parent && strcmpW( parent->Parent, parent->Directory ))
218  {
219  parent = msi_get_loaded_folder( package, parent->Parent );
220  }
221  msi_resolve_target_folder( package, parent->Directory, TRUE );
222  }
223  return folder->ResolvedTarget;
224 }
#define TRUE
Definition: types.h:120
Definition: fci.c:115
smooth NULL
Definition: ftsmooth.c:416
struct CFFOLDER folder
Definition: fdi.c:110
r parent
Definition: btrfs.c:2659
MSIFOLDER * msi_get_loaded_folder(MSIPACKAGE *package, const WCHAR *dir)
Definition: action.c:685
void msi_resolve_target_folder(MSIPACKAGE *package, const WCHAR *name, BOOL load_prop)
Definition: action.c:2333
Definition: name.c:36
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229

Referenced by deformat_component(), get_duplicate_filename(), get_ini_file_name(), get_link_file(), HANDLE_CustomType34(), ITERATE_CreateFolders(), ITERATE_CreateShortcuts(), ITERATE_InstallODBCDriver(), ITERATE_RegisterTypeLibraries(), ITERATE_RemoveFolders(), msi_create_directory(), MSI_GetTargetPath(), MSI_SetTargetPathW(), resolve_keypath(), and set_target_path().

◆ MSI_GetComponentStateW()

UINT MSI_GetComponentStateW ( MSIPACKAGE package,
LPCWSTR  szComponent,
INSTALLSTATE piInstalled,
INSTALLSTATE piAction 
)

Definition at line 1480 of file install.c.

1482 {
1483  MSICOMPONENT *comp;
1484 
1485  TRACE("%p %s %p %p\n", package, debugstr_w(szComponent),
1486  piInstalled, piAction);
1487 
1488  comp = msi_get_loaded_component(package,szComponent);
1489  if (!comp)
1490  return ERROR_UNKNOWN_COMPONENT;
1491 
1492  if (piInstalled)
1493  {
1494  if (comp->Enabled)
1495  *piInstalled = comp->Installed;
1496  else
1497  *piInstalled = INSTALLSTATE_UNKNOWN;
1498  }
1499 
1500  if (piAction)
1501  {
1502  if (comp->Enabled)
1503  *piAction = comp->Action;
1504  else
1505  *piAction = INSTALLSTATE_UNKNOWN;
1506  }
1507 
1508  TRACE("states (%i, %i)\n", comp->Installed, comp->Action );
1509  return ERROR_SUCCESS;
1510 }
#define ERROR_SUCCESS
Definition: deptool.c:10
INSTALLSTATE Action
Definition: msipriv.h:510
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
MSICOMPONENT * msi_get_loaded_component(MSIPACKAGE *package, const WCHAR *Component)
Definition: action.c:652
#define ERROR_UNKNOWN_COMPONENT
Definition: winerror.h:965
INSTALLSTATE Installed
Definition: msipriv.h:508

Referenced by MsiGetComponentStateW(), and yyparse().

◆ MSI_GetFeatureCost()

UINT MSI_GetFeatureCost ( MSIPACKAGE package,
MSIFEATURE feature,
MSICOSTTREE  tree,
INSTALLSTATE  state,
LPINT  cost 
)

Definition at line 1201 of file install.c.

1203 {
1204  TRACE("%s, %u, %d, %p\n", debugstr_w(feature->Feature), tree, state, cost);
1205 
1206  *cost = 0;
1207  switch (tree)
1208  {
1209  case MSICOSTTREE_CHILDREN:
1210  {
1211  MSIFEATURE *child;
1212 
1214  {
1215  if (child->ActionRequest == state)
1216  *cost += feature_cost( child );
1217  }
1218  break;
1219  }
1220  case MSICOSTTREE_PARENTS:
1221  {
1222  const WCHAR *feature_parent = feature->Feature_Parent;
1223  for (;;)
1224  {
1225  MSIFEATURE *parent = msi_get_loaded_feature( package, feature_parent );
1226  if (!parent)
1227  break;
1228 
1229  if (parent->ActionRequest == state)
1230  *cost += feature_cost( parent );
1231 
1232  feature_parent = parent->Feature_Parent;
1233  }
1234  break;
1235  }
1236  case MSICOSTTREE_SELFONLY:
1237  if (feature->ActionRequest == state)
1238  *cost = feature_cost( feature );
1239  break;
1240 
1241  default:
1242  WARN("unhandled cost tree %u\n", tree);
1243  break;
1244  }
1245 
1246  *cost /= 512;
1247  return ERROR_SUCCESS;
1248 }
INTERNETFEATURELIST feature
Definition: misc.c:1689
MSIFEATURE * msi_get_loaded_feature(MSIPACKAGE *package, const WCHAR *Feature)
Definition: action.c:663
#define ERROR_SUCCESS
Definition: deptool.c:10
uint8_t entry
Definition: isohybrid.c:63
#define WARN(fmt,...)
Definition: debug.h:111
static HWND child
Definition: cursoricon.c:298
static INT feature_cost(MSIFEATURE *feature)
Definition: install.c:1189
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
r parent
Definition: btrfs.c:2659
__wchar_t WCHAR
Definition: xmlstorage.h:180
static int state
Definition: maze.c:121

Referenced by msi_vcl_get_cost(), and MsiGetFeatureCostW().

◆ MSI_GetFeatureInfo()

static UINT MSI_GetFeatureInfo ( MSIPACKAGE package,
LPCWSTR  name,
LPDWORD  attrs,
LPWSTR  title,
LPDWORD  title_len,
LPWSTR  help,
LPDWORD  help_len 
)
static

Definition at line 1359 of file install.c.

1361 {
1362  UINT r = ERROR_SUCCESS;
1364  int len;
1365 
1366  if (!feature) return ERROR_UNKNOWN_FEATURE;
1367  if (attrs) *attrs = map_feature_attributes( feature->Attributes );
1368  if (title_len)
1369  {
1370  if (feature->Title) len = strlenW( feature->Title );
1371  else len = 0;
1372  if (*title_len <= len)
1373  {
1374  *title_len = len;
1375  if (title) r = ERROR_MORE_DATA;
1376  }
1377  else if (title)
1378  {
1379  if (feature->Title) strcpyW( title, feature->Title );
1380  else *title = 0;
1381  *title_len = len;
1382  }
1383  }
1384  if (help_len)
1385  {
1386  if (feature->Description) len = strlenW( feature->Description );
1387  else len = 0;
1388  if (*help_len <= len)
1389  {
1390  *help_len = len;
1391  if (help) r = ERROR_MORE_DATA;
1392  }
1393  else if (help)
1394  {
1395  if (feature->Description) strcpyW( help, feature->Description );
1396  else *help = 0;
1397  *help_len = len;
1398  }
1399  }
1400  return r;
1401 }
INTERNETFEATURELIST feature
Definition: misc.c:1689
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
MSIFEATURE * msi_get_loaded_feature(MSIPACKAGE *package, const WCHAR *Feature)
Definition: action.c:663
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define ERROR_UNKNOWN_FEATURE
Definition: winerror.h:964
GLenum GLsizei len
Definition: glext.h:6722
#define ERROR_MORE_DATA
Definition: dderror.h:13
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
unsigned int UINT
Definition: ndis.h:50
Definition: name.c:36
static DWORD map_feature_attributes(DWORD attrs)
Definition: install.c:1346
int help
Definition: sort.c:20
static char title[]
Definition: ps.c:92

Referenced by MsiGetFeatureInfoW().

◆ MSI_GetFeatureStateW()

UINT MSI_GetFeatureStateW ( MSIPACKAGE package,
LPCWSTR  szFeature,
INSTALLSTATE piInstalled,
INSTALLSTATE piAction 
)

Definition at line 1100 of file install.c.

1102 {
1104 
1105  feature = msi_get_loaded_feature(package,szFeature);
1106  if (!feature)
1107  return ERROR_UNKNOWN_FEATURE;
1108 
1109  if (piInstalled)
1110  *piInstalled = feature->Installed;
1111 
1112  if (piAction)
1113  *piAction = feature->ActionRequest;
1114 
1115  TRACE("returning %i %i\n", feature->Installed, feature->ActionRequest);
1116 
1117  return ERROR_SUCCESS;
1118 }
INTERNETFEATURELIST feature
Definition: misc.c:1689
MSIFEATURE * msi_get_loaded_feature(MSIPACKAGE *package, const WCHAR *Feature)
Definition: action.c:663
#define ERROR_SUCCESS
Definition: deptool.c:10
#define TRACE(s)
Definition: solgame.cpp:4
#define ERROR_UNKNOWN_FEATURE
Definition: winerror.h:964

Referenced by MsiGetFeatureStateW(), and yyparse().

◆ MSI_GetSourcePath()

static UINT MSI_GetSourcePath ( MSIHANDLE  hInstall,
LPCWSTR  szFolder,
awstring szPathBuf,
LPDWORD  pcchPathBuf 
)
static

Definition at line 396 of file install.c.

398 {
399  MSIPACKAGE *package;
400  LPWSTR path;
402 
403  TRACE("%s %p %p\n", debugstr_w(szFolder), szPathBuf, pcchPathBuf );
404 
405  if (!szFolder)
407 
408  package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE );
409  if (!package)
410  {
411  HRESULT hr;
412  IWineMsiRemotePackage *remote_package;
413  LPWSTR value = NULL;
414  BSTR folder;
415  DWORD len;
416 
417  remote_package = (IWineMsiRemotePackage *)msi_get_remote( hInstall );
418  if (!remote_package)
419  return ERROR_INVALID_HANDLE;
420 
421  folder = SysAllocString( szFolder );
422  if (!folder)
423  {
424  IWineMsiRemotePackage_Release( remote_package );
425  return ERROR_OUTOFMEMORY;
426  }
427 
428  len = 0;
429  hr = IWineMsiRemotePackage_GetSourcePath( remote_package, folder, NULL, &len );
430  if (FAILED(hr))
431  goto done;
432 
433  len++;
434  value = msi_alloc(len * sizeof(WCHAR));
435  if (!value)
436  {
438  goto done;
439  }
440 
441  hr = IWineMsiRemotePackage_GetSourcePath( remote_package, folder, value, &len );
442  if (FAILED(hr))
443  goto done;
444 
445  r = msi_strcpy_to_awstring( value, len, szPathBuf, pcchPathBuf );
446 
447 done:
448  IWineMsiRemotePackage_Release( remote_package );
450  msi_free( value );
451 
452  if (FAILED(hr))
453  {
455  return HRESULT_CODE(hr);
456 
457  return ERROR_FUNCTION_FAILED;
458  }
459 
460  return r;
461  }
462 
463  if (szPathBuf->str.w && !pcchPathBuf )
464  {
465  msiobj_release( &package->hdr );
467  }
468 
469  path = msi_resolve_source_folder( package, szFolder, NULL );
470  msiobj_release( &package->hdr );
471 
472  TRACE("path = %s\n", debugstr_w(path));
473  if (!path)
474  return ERROR_DIRECTORY;
475 
476  r = msi_strcpy_to_awstring( path, -1, szPathBuf, pcchPathBuf );
477  msi_free( path );
478  return r;
479 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
Definition: fci.c:115
HRESULT hr
Definition: shlfolder.c:183
MSIOBJECTHDR hdr
Definition: msipriv.h:385
GLsizei const GLchar ** path
Definition: glext.h:7234
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
OLECHAR * BSTR
Definition: compat.h:1934
LPWSTR w
Definition: msipriv.h:720
WCHAR * msi_resolve_source_folder(MSIPACKAGE *package, const WCHAR *name, MSIFOLDER **folder)
Definition: install.c:351
#define ERROR_DIRECTORY
Definition: winerror.h:295
UINT msi_strcpy_to_awstring(const WCHAR *str, int len, awstring *awbuf, DWORD *sz)
Definition: install.c:181
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define HRESULT_FACILITY(hr)
Definition: winerror.h:79
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
struct CFFOLDER folder
Definition: fdi.c:110
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
union awstring::@478 str
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
GLenum GLsizei len
Definition: glext.h:6722
#define FACILITY_WIN32
Definition: winerror.h:27
Definition: services.c:325
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
#define HRESULT_CODE(hr)
Definition: winerror.h:76
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
IUnknown * msi_get_remote(MSIHANDLE handle)
Definition: handle.c:182
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by MsiGetSourcePathA(), and MsiGetSourcePathW().

◆ MSI_GetTargetPath()

static UINT MSI_GetTargetPath ( MSIHANDLE  hInstall,
LPCWSTR  szFolder,
awstring szPathBuf,
LPDWORD  pcchPathBuf 
)
static

Definition at line 229 of file install.c.

231 {
232  MSIPACKAGE *package;
233  const WCHAR *path;
235 
236  if (!szFolder)
238 
239  package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE );
240  if (!package)
241  {
242  HRESULT hr;
243  IWineMsiRemotePackage *remote_package;
244  LPWSTR value = NULL;
245  BSTR folder;
246  DWORD len;
247 
248  remote_package = (IWineMsiRemotePackage *)msi_get_remote( hInstall );
249  if (!remote_package)
250  return ERROR_INVALID_HANDLE;
251 
252  folder = SysAllocString( szFolder );
253  if (!folder)
254  {
255  IWineMsiRemotePackage_Release( remote_package );
256  return ERROR_OUTOFMEMORY;
257  }
258 
259  len = 0;
260  hr = IWineMsiRemotePackage_GetTargetPath( remote_package, folder, NULL, &len );
261  if (FAILED(hr))
262  goto done;
263 
264  len++;
265  value = msi_alloc(len * sizeof(WCHAR));
266  if (!value)
267  {
269  goto done;
270  }
271 
272  hr = IWineMsiRemotePackage_GetTargetPath( remote_package, folder, value, &len );
273  if (FAILED(hr))
274  goto done;
275 
276  r = msi_strcpy_to_awstring( value, len, szPathBuf, pcchPathBuf );
277 
278 done:
279  IWineMsiRemotePackage_Release( remote_package );
281  msi_free( value );
282 
283  if (FAILED(hr))
284  {
286  return HRESULT_CODE(hr);
287 
288  return ERROR_FUNCTION_FAILED;
289  }
290 
291  return r;
292  }
293 
294  path = msi_get_target_folder( package, szFolder );
295  msiobj_release( &package->hdr );
296 
297  if (!path)
298  return ERROR_DIRECTORY;
299 
300  return msi_strcpy_to_awstring( path, -1, szPathBuf, pcchPathBuf );
301 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
Definition: fci.c:115
HRESULT hr
Definition: shlfolder.c:183
MSIOBJECTHDR hdr
Definition: msipriv.h:385
GLsizei const GLchar ** path
Definition: glext.h:7234
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
OLECHAR * BSTR
Definition: compat.h:1934
#define ERROR_DIRECTORY
Definition: winerror.h:295
UINT msi_strcpy_to_awstring(const WCHAR *str, int len, awstring *awbuf, DWORD *sz)
Definition: install.c:181
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define HRESULT_FACILITY(hr)
Definition: winerror.h:79
smooth NULL
Definition: ftsmooth.c:416
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
struct CFFOLDER folder
Definition: fdi.c:110
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
GLenum GLsizei len
Definition: glext.h:6722
const WCHAR * msi_get_target_folder(MSIPACKAGE *package, const WCHAR *name)
Definition: install.c:209
#define FACILITY_WIN32
Definition: winerror.h:27
Definition: services.c:325
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
#define HRESULT_CODE(hr)
Definition: winerror.h:76
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
IUnknown * msi_get_remote(MSIHANDLE handle)
Definition: handle.c:182
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by MsiGetTargetPathA(), and MsiGetTargetPathW().

◆ msi_resolve_source_folder()

WCHAR* msi_resolve_source_folder ( MSIPACKAGE package,
const WCHAR name,
MSIFOLDER **  folder 
)

Definition at line 351 of file install.c.

352 {
353  MSIFOLDER *f;
354  LPWSTR p, path = NULL, parent;
355 
356  TRACE("working to resolve %s\n", debugstr_w(name));
357 
359  if (!(f = msi_get_loaded_folder( package, name ))) return NULL;
360 
361  /* special resolving for root dir */
362  if (!strcmpW( name, szTargetDir ) && !f->ResolvedSource)
363  {
364  f->ResolvedSource = get_source_root( package );
365  }
366  if (folder) *folder = f;
367  if (f->ResolvedSource)
368  {
369  path = strdupW( f->ResolvedSource );
370  TRACE(" already resolved to %s\n", debugstr_w(path));
371  return path;
372  }
373  if (!f->Parent) return path;
374  parent = f->Parent;
375  TRACE(" ! parent is %s\n", debugstr_w(parent));
376 
377  p = msi_resolve_source_folder( package, parent, NULL );
378 
380  path = get_source_root( package );
381  else if (package->WordCount & msidbSumInfoSourceTypeSFN)
382  path = msi_build_directory_name( 3, p, f->SourceShortPath, NULL );
383  else
384  path = msi_build_directory_name( 3, p, f->SourceLongPath, NULL );
385 
386  TRACE("-> %s\n", debugstr_w(path));
387  f->ResolvedSource = strdupW( path );
388  msi_free( p );
389 
390  return path;
391 }
Definition: fci.c:115
GLsizei const GLchar ** path
Definition: glext.h:7234
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
static WCHAR * get_source_root(MSIPACKAGE *package)
Definition: install.c:345
WCHAR * msi_resolve_source_folder(MSIPACKAGE *package, const WCHAR *name, MSIFOLDER **folder)
Definition: install.c:351
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
UINT WordCount
Definition: msipriv.h:436
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
r parent
Definition: btrfs.c:2659
MSIFOLDER * msi_get_loaded_folder(MSIPACKAGE *package, const WCHAR *dir)
Definition: action.c:685
static const WCHAR szSourceDir[]
Definition: msipriv.h:1100
#define f
Definition: ke_i.h:83
Definition: services.c:325
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
Definition: name.c:36
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229
static const WCHAR szTargetDir[]
Definition: msipriv.h:1103
WCHAR * msi_build_directory_name(DWORD count,...)
Definition: action.c:2164
GLfloat GLfloat p
Definition: glext.h:8902
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by deformat_component(), MSI_GetSourcePath(), msi_resolve_file_source(), and msi_resolve_source_folder().

◆ MSI_SetComponentStateW()

static UINT MSI_SetComponentStateW ( MSIPACKAGE package,
LPCWSTR  szComponent,
INSTALLSTATE  iState 
)
static

Definition at line 1463 of file install.c.

1465 {
1466  MSICOMPONENT *comp;
1467 
1468  TRACE("%p %s %d\n", package, debugstr_w(szComponent), iState);
1469 
1470  comp = msi_get_loaded_component(package, szComponent);
1471  if (!comp)
1472  return ERROR_UNKNOWN_COMPONENT;
1473 
1474  if (comp->Enabled)
1475  comp->Action = iState;
1476 
1477  return ERROR_SUCCESS;
1478 }
#define ERROR_SUCCESS
Definition: deptool.c:10
INSTALLSTATE Action
Definition: msipriv.h:510
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
MSICOMPONENT * msi_get_loaded_component(MSIPACKAGE *package, const WCHAR *Component)
Definition: action.c:652
#define ERROR_UNKNOWN_COMPONENT
Definition: winerror.h:965

Referenced by MsiSetComponentStateW().

◆ MSI_SetFeatureStateW()

UINT MSI_SetFeatureStateW ( MSIPACKAGE package,
LPCWSTR  szFeature,
INSTALLSTATE  iState 
)

Definition at line 940 of file install.c.

941 {
942  UINT rc = ERROR_SUCCESS;
944 
945  TRACE("%s %i\n", debugstr_w(szFeature), iState);
946 
947  feature = msi_get_loaded_feature( package, szFeature );
948  if (!feature)
949  return ERROR_UNKNOWN_FEATURE;
950 
951  if (iState == INSTALLSTATE_ADVERTISED &&
953  return ERROR_FUNCTION_FAILED;
954 
955  feature->ActionRequest = iState;
956 
958 
959  /* update all the features that are children of this feature */
961  {
962  if (child->Feature_Parent && !strcmpW( szFeature, child->Feature_Parent ))
963  MSI_SetFeatureStateW(package, child->Feature, iState);
964  }
965 
966  return rc;
967 }
INTERNETFEATURELIST feature
Definition: misc.c:1689
MSIFEATURE * msi_get_loaded_feature(MSIPACKAGE *package, const WCHAR *Feature)
Definition: action.c:663
#define ERROR_SUCCESS
Definition: deptool.c:10
uint8_t entry
Definition: isohybrid.c:63
static HWND child
Definition: cursoricon.c:298
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
#define ERROR_UNKNOWN_FEATURE
Definition: winerror.h:964
struct list features
Definition: msipriv.h:393
UINT MSI_SetFeatureStateW(MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE iState)
Definition: install.c:940
unsigned int UINT
Definition: ndis.h:50
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229
void ACTION_UpdateComponentStates(MSIPACKAGE *package, MSIFEATURE *feature)
Definition: install.c:858

Referenced by event_add_local(), event_add_source(), event_remove(), MSI_SetFeatureStateW(), MsiConfigureFeatureW(), and MsiSetFeatureStateW().

◆ MSI_SetInstallLevel()

UINT MSI_SetInstallLevel ( MSIPACKAGE package,
int  iInstallLevel 
)

Definition at line 1644 of file install.c.

1645 {
1646  static const WCHAR fmt[] = { '%','d',0 };
1647  WCHAR level[6];
1648  int len;
1649  UINT r;
1650 
1651  TRACE("%p %i\n", package, iInstallLevel);
1652 
1653  if (iInstallLevel > 32767)
1654  return ERROR_INVALID_PARAMETER;
1655 
1656  if (iInstallLevel < 1)
1657  return MSI_SetFeatureStates( package );
1658 
1659  len = sprintfW( level, fmt, iInstallLevel );
1660  r = msi_set_property( package->db, szInstallLevel, level, len );
1661  if ( r == ERROR_SUCCESS )
1662  r = MSI_SetFeatureStates( package );
1663 
1664  return r;
1665 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
GLint level
Definition: gl.h:1546
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define TRACE(s)
Definition: solgame.cpp:4
UINT MSI_SetFeatureStates(MSIPACKAGE *package)
Definition: action.c:1794
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
GLenum GLsizei len
Definition: glext.h:6722
#define sprintfW
Definition: unicode.h:58
unsigned int UINT
Definition: ndis.h:50
UINT msi_set_property(MSIDATABASE *, const WCHAR *, const WCHAR *, int) DECLSPEC_HIDDEN
Definition: package.c:2149
Definition: dsound.c:943
static const WCHAR szInstallLevel[]
Definition: msipriv.h:1190

Referenced by event_set_install_level(), and MsiSetInstallLevel().

◆ MSI_SetTargetPathW()

UINT MSI_SetTargetPathW ( MSIPACKAGE package,
LPCWSTR  szFolder,
LPCWSTR  szFolderPath 
)

Definition at line 567 of file install.c.

568 {
569  DWORD attrib;
570  MSIFOLDER *folder;
571  MSIFILE *file;
572 
573  TRACE("%p %s %s\n", package, debugstr_w(szFolder), debugstr_w(szFolderPath));
574 
575  attrib = GetFileAttributesW(szFolderPath);
576  /* native MSI tests writeability by making temporary files at each drive */
577  if (attrib != INVALID_FILE_ATTRIBUTES &&
578  (attrib & FILE_ATTRIBUTE_OFFLINE || attrib & FILE_ATTRIBUTE_READONLY))
579  {
580  return ERROR_FUNCTION_FAILED;
581  }
582  if (!(folder = msi_get_loaded_folder( package, szFolder ))) return ERROR_DIRECTORY;
583 
584  set_target_path( package, folder, szFolderPath );
585 
586  LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry )
587  {
588  const WCHAR *dir;
589  MSICOMPONENT *comp = file->Component;
590 
591  if (!comp->Enabled || msi_is_global_assembly( comp )) continue;
592 
593  dir = msi_get_target_folder( package, comp->Directory );
594  msi_free( file->TargetPath );
595  file->TargetPath = msi_build_directory_name( 2, dir, file->FileName );
596  }
597  return ERROR_SUCCESS;
598 }
Definition: fci.c:115
#define ERROR_SUCCESS
Definition: deptool.c:10
uint8_t entry
Definition: isohybrid.c:63
BOOL msi_is_global_assembly(MSICOMPONENT *comp)
Definition: action.c:2193
static void set_target_path(MSIPACKAGE *package, MSIFOLDER *folder, const WCHAR *path)
Definition: install.c:545
#define ERROR_DIRECTORY
Definition: winerror.h:295
struct list files
Definition: msipriv.h:394
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:802
#define debugstr_w
Definition: kernel32.h:32
unsigned int dir
Definition: maze.c:112
struct CFFOLDER folder
Definition: fdi.c:110
#define TRACE(s)
Definition: solgame.cpp:4
LPWSTR Directory
Definition: msipriv.h:504
__wchar_t WCHAR
Definition: xmlstorage.h:180
const char file[]
Definition: icontest.c:11
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
unsigned long DWORD
Definition: ntddk_ex.h:95
MSIFOLDER * msi_get_loaded_folder(MSIPACKAGE *package, const WCHAR *dir)
Definition: action.c:685
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
const WCHAR * msi_get_target_folder(MSIPACKAGE *package, const WCHAR *name)
Definition: install.c:209
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
WCHAR * msi_build_directory_name(DWORD count,...)
Definition: action.c:2164
#define FILE_ATTRIBUTE_OFFLINE
Definition: nt_native.h:712
Definition: fci.c:126

Referenced by ACTION_CustomAction(), event_set_target_path(), and MsiSetTargetPathW().

◆ msi_strcpy_to_awstring()

UINT msi_strcpy_to_awstring ( const WCHAR str,
int  len,
awstring awbuf,
DWORD sz 
)

Definition at line 181 of file install.c.

182 {
183  UINT r = ERROR_SUCCESS;
184 
185  if (awbuf->str.w && !sz)
187  if (!sz)
188  return ERROR_SUCCESS;
189 
190  if (len < 0) len = strlenW( str );
191 
192  if (awbuf->unicode && awbuf->str.w)
193  memcpy( awbuf->str.w, str, min(len + 1, *sz) * sizeof(WCHAR) );
194  else
195  {
196  int lenA = WideCharToMultiByte( CP_ACP, 0, str, len + 1, NULL, 0, NULL, NULL );
197  if (lenA) lenA--;
198  WideCharToMultiByte( CP_ACP, 0, str, len + 1, awbuf->str.a, *sz, NULL, NULL );
199  if (awbuf->str.a && *sz && lenA >= *sz)
200  awbuf->str.a[*sz - 1] = 0;
201  len = lenA;
202  }
203  if (awbuf->str.w && len >= *sz)
204  r = ERROR_MORE_DATA;
205  *sz = len;
206  return r;
207 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define ERROR_SUCCESS
Definition: deptool.c:10
#define WideCharToMultiByte
Definition: compat.h:101
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define CP_ACP
Definition: compat.h:99
LPWSTR w
Definition: msipriv.h:720
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
LPSTR a
Definition: msipriv.h:719
__wchar_t WCHAR
Definition: xmlstorage.h:180
union awstring::@478 str
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define ERROR_MORE_DATA
Definition: dderror.h:13
BOOL unicode
Definition: msipriv.h:717
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50

Referenced by MSI_EnumComponentQualifiers(), MSI_GetComponentPath(), MSI_GetProductInfo(), MSI_GetProperty(), MSI_GetSourcePath(), MSI_GetTargetPath(), MSI_GetUserInfo(), and MsiFormatRecordW().

◆ MsiDoActionA()

UINT WINAPI MsiDoActionA ( MSIHANDLE  hInstall,
LPCSTR  szAction 
)

Definition at line 45 of file install.c.

46 {
47  LPWSTR szwAction;
48  UINT ret;
49 
50  TRACE("%s\n", debugstr_a(szAction));
51 
52  szwAction = strdupAtoW(szAction);
53  if (szAction && !szwAction)
54  return ERROR_FUNCTION_FAILED;
55 
56  ret = MsiDoActionW( hInstall, szwAction );
57  msi_free( szwAction );
58  return ret;
59 }
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
UINT WINAPI MsiDoActionW(MSIHANDLE hInstall, LPCWSTR szAction)
Definition: install.c:64
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
int ret
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67

Referenced by test_appsearch(), test_appsearch_complocator(), test_appsearch_drlocator(), test_appsearch_inilocator(), test_appsearch_reglocator(), test_ccpsearch(), test_complocator(), test_controlevent(), test_dbtopackage(), test_doaction(), test_externalui_message(), test_featureparents(), test_formatrecord_tables(), test_launchconditions(), test_MsiEnumComponentCosts(), test_MsiGetSourcePath(), test_MsiSetComponentState(), test_MsiSetFeatureAttributes(), test_property_table(), test_removefiles(), test_settargetpath(), test_shortlongsource(), test_sourcedir(), test_states(), and test_top_level_action().

◆ MsiDoActionW()

UINT WINAPI MsiDoActionW ( MSIHANDLE  hInstall,
LPCWSTR  szAction 
)

Definition at line 64 of file install.c.

65 {
66  MSIPACKAGE *package;
67  UINT ret;
68 
69  TRACE("%s\n",debugstr_w(szAction));
70 
71  if (!szAction)
73 
74  package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE );
75  if (!package)
76  {
77  HRESULT hr;
78  BSTR action;
79  IWineMsiRemotePackage *remote_package;
80 
81  remote_package = (IWineMsiRemotePackage *)msi_get_remote( hInstall );
82  if (!remote_package)
83  return ERROR_INVALID_HANDLE;
84 
85  action = SysAllocString( szAction );
86  if (!action)
87  {
88  IWineMsiRemotePackage_Release( remote_package );
89  return ERROR_OUTOFMEMORY;
90  }
91 
92  hr = IWineMsiRemotePackage_DoAction( remote_package, action );
93 
95  IWineMsiRemotePackage_Release( remote_package );
96 
97  if (FAILED(hr))
98  {
100  return HRESULT_CODE(hr);
101 
102  return ERROR_FUNCTION_FAILED;
103  }
104 
105  return ERROR_SUCCESS;
106  }
107 
108  ret = ACTION_PerformAction( package, szAction, SCRIPT_NONE );
109  msiobj_release( &package->hdr );
110 
111  return ret;
112 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
MSIOBJECTHDR hdr
Definition: msipriv.h:385
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
OLECHAR * BSTR
Definition: compat.h:1934
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define HRESULT_FACILITY(hr)
Definition: winerror.h:79
#define debugstr_w
Definition: kernel32.h:32
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, UINT script)
Definition: action.c:7913
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
int ret
#define FACILITY_WIN32
Definition: winerror.h:27
const WCHAR * action
Definition: action.c:7783
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
unsigned int UINT
Definition: ndis.h:50
#define HRESULT_CODE(hr)
Definition: winerror.h:76
IUnknown * msi_get_remote(MSIHANDLE handle)
Definition: handle.c:182
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by mrp_DoAction(), MsiDoActionA(), and session_invoke().

◆ MsiGetComponentStateA()

UINT WINAPI MsiGetComponentStateA ( MSIHANDLE  hInstall,
LPCSTR  szComponent,
INSTALLSTATE piInstalled,
INSTALLSTATE piAction 
)

Definition at line 1448 of file install.c.

1450 {
1451  LPWSTR szwComponent= NULL;
1452  UINT rc;
1453 
1454  szwComponent= strdupAtoW(szComponent);
1455 
1456  rc = MsiGetComponentStateW(hInstall,szwComponent,piInstalled, piAction);
1457 
1458  msi_free( szwComponent);
1459 
1460  return rc;
1461 }
UINT WINAPI MsiGetComponentStateW(MSIHANDLE hInstall, LPCWSTR szComponent, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
Definition: install.c:1563
smooth NULL
Definition: ftsmooth.c:416
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67

Referenced by test_component_states(), test_MsiSetComponentState(), and test_removefiles().

◆ MsiGetComponentStateW()

UINT WINAPI MsiGetComponentStateW ( MSIHANDLE  hInstall,
LPCWSTR  szComponent,
INSTALLSTATE piInstalled,
INSTALLSTATE piAction 
)

Definition at line 1563 of file install.c.

1565 {
1566  MSIPACKAGE* package;
1567  UINT ret;
1568 
1569  TRACE("%d %s %p %p\n", hInstall, debugstr_w(szComponent),
1570  piInstalled, piAction);
1571 
1572  package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
1573  if (!package)
1574  {
1575  HRESULT hr;
1576  BSTR component;
1577  IWineMsiRemotePackage *remote_package;
1578 
1579  remote_package = (IWineMsiRemotePackage *)msi_get_remote(hInstall);
1580  if (!remote_package)
1581  return ERROR_INVALID_HANDLE;
1582 
1583  component = SysAllocString(szComponent);
1584  if (!component)
1585  {
1586  IWineMsiRemotePackage_Release(remote_package);
1587  return ERROR_OUTOFMEMORY;
1588  }
1589 
1590  hr = IWineMsiRemotePackage_GetComponentState(remote_package, component,
1591  piInstalled, piAction);
1592 
1593  SysFreeString(component);
1594  IWineMsiRemotePackage_Release(remote_package);
1595 
1596  if (FAILED(hr))
1597  {
1599  return HRESULT_CODE(hr);
1600 
1601  return ERROR_FUNCTION_FAILED;
1602  }
1603 
1604  return ERROR_SUCCESS;
1605  }
1606 
1607  ret = MSI_GetComponentStateW( package, szComponent, piInstalled, piAction);
1608  msiobj_release( &package->hdr );
1609  return ret;
1610 }
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
MSIOBJECTHDR hdr
Definition: msipriv.h:385
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
OLECHAR * BSTR
Definition: compat.h:1934
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define HRESULT_FACILITY(hr)
Definition: winerror.h:79
#define debugstr_w
Definition: kernel32.h:32
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
int ret
#define FACILITY_WIN32
Definition: winerror.h:27
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
unsigned int UINT
Definition: ndis.h:50
#define HRESULT_CODE(hr)
Definition: winerror.h:76
IUnknown * msi_get_remote(MSIHANDLE handle)
Definition: handle.c:182
UINT MSI_GetComponentStateW(MSIPACKAGE *package, LPCWSTR szComponent, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
Definition: install.c:1480
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by mrp_GetComponentState(), and MsiGetComponentStateA().

◆ MsiGetFeatureCostA()

UINT WINAPI MsiGetFeatureCostA ( MSIHANDLE  hInstall,
LPCSTR  szFeature,
MSICOSTTREE  iCostTree,
INSTALLSTATE  iState,
LPINT  piCost 
)

Definition at line 1174 of file install.c.

1176 {
1177  LPWSTR szwFeature = NULL;
1178  UINT rc;
1179 
1180  szwFeature = strdupAtoW(szFeature);
1181 
1182  rc = MsiGetFeatureCostW(hInstall, szwFeature, iCostTree, iState, piCost);
1183 
1184  msi_free(szwFeature);
1185 
1186  return rc;
1187 }
smooth NULL
Definition: ftsmooth.c:416
UINT WINAPI MsiGetFeatureCostW(MSIHANDLE hInstall, LPCWSTR szFeature, MSICOSTTREE iCostTree, INSTALLSTATE iState, LPINT piCost)
Definition: install.c:1253
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67

◆ MsiGetFeatureCostW()

UINT WINAPI MsiGetFeatureCostW ( MSIHANDLE  hInstall,
LPCWSTR  szFeature,
MSICOSTTREE  iCostTree,
INSTALLSTATE  iState,
LPINT  piCost 
)

Definition at line 1253 of file install.c.

1255 {
1256  MSIPACKAGE *package;
1258  UINT ret;
1259 
1260  TRACE("(%d %s %i %i %p)\n", hInstall, debugstr_w(szFeature),
1261  iCostTree, iState, piCost);
1262 
1263  package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
1264  if (!package)
1265  {
1266  HRESULT hr;
1267  BSTR feature;
1268  IWineMsiRemotePackage *remote_package;
1269 
1270  remote_package = (IWineMsiRemotePackage *)msi_get_remote(hInstall);
1271  if (!remote_package)
1272  return ERROR_INVALID_HANDLE;
1273 
1274  feature = SysAllocString(szFeature);
1275  if (!feature)
1276  {
1277  IWineMsiRemotePackage_Release(remote_package);
1278  return ERROR_OUTOFMEMORY;
1279  }
1280 
1281  hr = IWineMsiRemotePackage_GetFeatureCost(remote_package, feature,
1282  iCostTree, iState, piCost);
1283 
1285  IWineMsiRemotePackage_Release(remote_package);
1286 
1287  if (FAILED(hr))
1288  {
1290  return HRESULT_CODE(hr);
1291 
1292  return ERROR_FUNCTION_FAILED;
1293  }
1294 
1295  return ERROR_SUCCESS;
1296  }
1297 
1298  feature = msi_get_loaded_feature(package, szFeature);
1299 
1300  if (feature)
1301  ret = MSI_GetFeatureCost(package, feature, iCostTree, iState, piCost);
1302  else
1304 
1305  msiobj_release( &package->hdr );
1306  return ret;
1307 }
INTERNETFEATURELIST feature
Definition: misc.c:1689
MSIFEATURE * msi_get_loaded_feature(MSIPACKAGE *package, const WCHAR *Feature)
Definition: action.c:663
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
MSIOBJECTHDR hdr
Definition: msipriv.h:385
UINT MSI_GetFeatureCost(MSIPACKAGE *package, MSIFEATURE *feature, MSICOSTTREE tree, INSTALLSTATE state, LPINT cost)
Definition: install.c:1201
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
OLECHAR * BSTR
Definition: compat.h:1934
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define HRESULT_FACILITY(hr)
Definition: winerror.h:79
#define debugstr_w
Definition: kernel32.h:32
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
#define TRACE(s)
Definition: solgame.cpp:4
#define ERROR_UNKNOWN_FEATURE
Definition: winerror.h:964
LONG HRESULT
Definition: typedefs.h:77
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
int ret
#define FACILITY_WIN32
Definition: winerror.h:27
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
unsigned int UINT
Definition: ndis.h:50
#define HRESULT_CODE(hr)
Definition: winerror.h:76
IUnknown * msi_get_remote(MSIHANDLE handle)
Definition: handle.c:182
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by mrp_GetFeatureCost(), and MsiGetFeatureCostA().

◆ MsiGetFeatureInfoA()

UINT WINAPI MsiGetFeatureInfoA ( MSIHANDLE  handle,
LPCSTR  feature,
LPDWORD  attrs,
LPSTR  title,
LPDWORD  title_len,
LPSTR  help,
LPDWORD  help_len 
)

Definition at line 1312 of file install.c.

1314 {
1315  UINT r;
1316  WCHAR *titleW = NULL, *helpW = NULL, *featureW = NULL;
1317 
1318  TRACE("%u, %s, %p, %p, %p, %p, %p\n", handle, debugstr_a(feature), attrs, title,
1319  title_len, help, help_len);
1320 
1321  if (feature && !(featureW = strdupAtoW( feature ))) return ERROR_OUTOFMEMORY;
1322 
1323  if (title && title_len && !(titleW = msi_alloc( *title_len * sizeof(WCHAR) )))
1324  {
1325  msi_free( featureW );
1326  return ERROR_OUTOFMEMORY;
1327  }
1328  if (help && help_len && !(helpW = msi_alloc( *help_len * sizeof(WCHAR) )))
1329  {
1330  msi_free( featureW );
1331  msi_free( titleW );
1332  return ERROR_OUTOFMEMORY;
1333  }
1334  r = MsiGetFeatureInfoW( handle, featureW, attrs, titleW, title_len, helpW, help_len );
1335  if (r == ERROR_SUCCESS)
1336  {
1337  if (titleW) WideCharToMultiByte( CP_ACP, 0, titleW, -1, title, *title_len + 1, NULL, NULL );
1338  if (helpW) WideCharToMultiByte( CP_ACP, 0, helpW, -1, help, *help_len + 1, NULL, NULL );
1339  }
1340  msi_free( titleW );
1341  msi_free( helpW );
1342  msi_free( featureW );
1343  return r;
1344 }
INTERNETFEATURELIST feature
Definition: misc.c:1689
#define ERROR_SUCCESS
Definition: deptool.c:10
#define WideCharToMultiByte
Definition: compat.h:101
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define CP_ACP
Definition: compat.h:99
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
static const WCHAR titleW[]
Definition: htmlelem.c:1067
static const WCHAR helpW[]
Definition: htmlevent.c:70
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
int help
Definition: sort.c:20
static char title[]
Definition: ps.c:92
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
UINT WINAPI MsiGetFeatureInfoW(MSIHANDLE handle, LPCWSTR feature, LPDWORD attrs, LPWSTR title, LPDWORD title_len, LPWSTR help, LPDWORD help_len)
Definition: install.c:1406

Referenced by test_MsiGetFeatureInfo(), and test_MsiSetFeatureAttributes().

◆ MsiGetFeatureInfoW()

UINT WINAPI MsiGetFeatureInfoW ( MSIHANDLE  handle,
LPCWSTR  feature,
LPDWORD  attrs,
LPWSTR  title,
LPDWORD  title_len,
LPWSTR  help,
LPDWORD  help_len 
)

Definition at line 1406 of file install.c.

1408 {
1409  UINT r;
1410  MSIPACKAGE *package;
1411 
1412  TRACE("%u, %s, %p, %p, %p, %p, %p\n", handle, debugstr_w(feature), attrs, title,
1413  title_len, help, help_len);
1414 
1415  if (!feature) return ERROR_INVALID_PARAMETER;
1416 
1417  if (!(package = msihandle2msiinfo( handle, MSIHANDLETYPE_PACKAGE )))
1418  return ERROR_INVALID_HANDLE;
1419 
1420  /* features may not have been loaded yet */
1421  msi_load_all_components( package );
1422  msi_load_all_features( package );
1423 
1424  r = MSI_GetFeatureInfo( package, feature, attrs, title, title_len, help, help_len );
1425  msiobj_release( &package->hdr );
1426  return r;
1427 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
INTERNETFEATURELIST feature
Definition: misc.c:1689
MSIOBJECTHDR hdr
Definition: msipriv.h:385
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
UINT msi_load_all_features(MSIPACKAGE *package)
Definition: action.c:1108
static UINT MSI_GetFeatureInfo(MSIPACKAGE *package, LPCWSTR name, LPDWORD attrs, LPWSTR title, LPDWORD title_len, LPWSTR help, LPDWORD help_len)
Definition: install.c:1359
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
UINT msi_load_all_components(MSIPACKAGE *package)
Definition: action.c:952
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
#define MSIHANDLETYPE_PACKAGE
Definition: msipriv.h:703
unsigned int UINT
Definition: ndis.h:50
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:157
int help
Definition: sort.c:20
static char title[]
Definition: ps.c:92

Referenced by MsiGetFeatureInfoA().

◆ MsiGetFeatureStateA()

UINT WINAPI MsiGetFeatureStateA ( MSIHANDLE  hInstall,
LPCSTR  szFeature,
INSTALLSTATE piInstalled,
INSTALLSTATE piAction 
)

Definition at line 1087 of file install.c.

1089 {
1090  LPWSTR szwFeature = NULL;
1091  UINT rc;
1092 
1093  if (szFeature && !(szwFeature = strdupAtoW(szFeature))) return ERROR_OUTOFMEMORY;
1094 
1095  rc = MsiGetFeatureStateW(hInstall, szwFeature, piInstalled, piAction);
1096  msi_free( szwFeature);
1097  return rc;
1098 }
smooth NULL
Definition: ftsmooth.c:416
UINT WINAPI MsiGetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
Definition: install.c:1123
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by test_feature_states().

◆ MsiGetFeatureStateW()

UINT WINAPI MsiGetFeatureStateW ( MSIHANDLE  hInstall,
LPCWSTR  szFeature,
INSTALLSTATE piInstalled,
INSTALLSTATE piAction 
)

Definition at line 1123 of file install.c.

1125 {
1126  MSIPACKAGE* package;
1127  UINT ret;
1128 
1129  TRACE("%d %s %p %p\n", hInstall, debugstr_w(szFeature), piInstalled, piAction);
1130 
1131  package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
1132  if (!package)
1133  {
1134  HRESULT hr;
1135  BSTR feature;
1136  IWineMsiRemotePackage *remote_package;
1137 
1138  remote_package = (IWineMsiRemotePackage *)msi_get_remote(hInstall);
1139  if (!remote_package)
1140  return ERROR_INVALID_HANDLE;
1141 
1142  feature = SysAllocString(szFeature);
1143  if (!feature)
1144  {
1145  IWineMsiRemotePackage_Release(remote_package);
1146  return ERROR_OUTOFMEMORY;
1147  }
1148 
1149  hr = IWineMsiRemotePackage_GetFeatureState(remote_package, feature,
1150  piInstalled, piAction);
1151 
1153  IWineMsiRemotePackage_Release(remote_package);
1154 
1155  if (FAILED(hr))
1156  {
1158  return HRESULT_CODE(hr);
1159 
1160  return ERROR_FUNCTION_FAILED;
1161  }
1162 
1163  return ERROR_SUCCESS;
1164  }
1165 
1166  ret = MSI_GetFeatureStateW(package, szFeature, piInstalled, piAction);
1167  msiobj_release( &package->hdr );
1168  return ret;
1169 }
INTERNETFEATURELIST feature
Definition: misc.c:1689
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
MSIOBJECTHDR hdr
Definition: msipriv.h:385
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
OLECHAR * BSTR
Definition: compat.h:1934
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define HRESULT_FACILITY(hr)
Definition: winerror.h:79
#define debugstr_w
Definition: kernel32.h:32
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
int ret
#define FACILITY_WIN32
Definition: winerror.h:27
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
unsigned int UINT
Definition: ndis.h:50
#define HRESULT_CODE(hr)
Definition: winerror.h:76
IUnknown * msi_get_remote(MSIHANDLE handle)
Definition: handle.c:182
UINT MSI_GetFeatureStateW(MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE *piInstalled, INSTALLSTATE *piAction)
Definition: install.c:1100
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by mrp_GetFeatureState(), MsiGetFeatureStateA(), and session_invoke().

◆ MsiGetFeatureValidStatesA()

UINT WINAPI MsiGetFeatureValidStatesA ( MSIHANDLE  hInstall,
LPCSTR  szFeature,
LPDWORD  pInstallState 
)

Definition at line 1725 of file install.c.

1727 {
1728  UINT ret;
1729  LPWSTR szwFeature = strdupAtoW(szFeature);
1730 
1731  ret = MsiGetFeatureValidStatesW(hInstall, szwFeature, pInstallState);
1732 
1733  msi_free(szwFeature);
1734 
1735  return ret;
1736 }
UINT WINAPI MsiGetFeatureValidStatesW(MSIHANDLE hInstall, LPCWSTR szFeature, LPDWORD pInstallState)
Definition: install.c:1712
int ret
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67

◆ MsiGetFeatureValidStatesW()

UINT WINAPI MsiGetFeatureValidStatesW ( MSIHANDLE  hInstall,
LPCWSTR  szFeature,
LPDWORD  pInstallState 
)

Definition at line 1712 of file install.c.

1714 {
1715  if(pInstallState) *pInstallState = 1<<INSTALLSTATE_LOCAL;
1716  FIXME("%d %s %p stub returning %d\n",
1717  hInstall, debugstr_w(szFeature), pInstallState, pInstallState ? *pInstallState : 0);
1718 
1719  return ERROR_SUCCESS;
1720 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110

Referenced by MsiGetFeatureValidStatesA().

◆ MsiGetLanguage()

LANGID WINAPI MsiGetLanguage ( MSIHANDLE  hInstall)

Definition at line 1615 of file install.c.

1616 {
1617  MSIPACKAGE* package;
1618  LANGID langid;
1619 
1620  package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
1621  if (!package)
1622  {
1623  HRESULT hr;
1624  LANGID lang;
1625  IWineMsiRemotePackage *remote_package;
1626 
1627  remote_package = (IWineMsiRemotePackage *)msi_get_remote(hInstall);
1628  if (!remote_package)
1629  return ERROR_INVALID_HANDLE;
1630 
1631  hr = IWineMsiRemotePackage_GetLanguage(remote_package, &lang);
1632 
1633  if (SUCCEEDED(hr))
1634  return lang;
1635 
1636  return 0;
1637  }
1638 
1639  langid = msi_get_property_int( package->db, szProductLanguage, 0 );
1640  msiobj_release( &package->hdr );
1641  return langid;
1642 }
HRESULT hr
Definition: shlfolder.c:183
MSIOBJECTHDR hdr
Definition: msipriv.h:385
int msi_get_property_int(MSIDATABASE *package, LPCWSTR prop, int def) DECLSPEC_HIDDEN
Definition: package.c:2392
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
WORD LANGID
Definition: typedefs.h:79
static const WCHAR szProductLanguage[]
Definition: msipriv.h:1185
LANGID langid
Definition: msctf.idl:605
static const WCHAR lang[]
Definition: wbemdisp.c:287
LONG HRESULT
Definition: typedefs.h:77
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
IUnknown * msi_get_remote(MSIHANDLE handle)
Definition: handle.c:182
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by da_deferred(), mrp_GetLanguage(), and session_invoke().

◆ MsiGetMode()

BOOL WINAPI MsiGetMode ( MSIHANDLE  hInstall,
MSIRUNMODE  iRunMode 
)

Definition at line 690 of file install.c.

691 {
692  MSIPACKAGE *package;
693  BOOL r = FALSE;
694 
695  TRACE("%d %d\n", hInstall, iRunMode);
696 
697  package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
698  if (!package)
699  {
700  BOOL ret;
701  HRESULT hr;
702  IWineMsiRemotePackage *remote_package;
703 
704  remote_package = (IWineMsiRemotePackage *)msi_get_remote(hInstall);
705  if (!remote_package)
706  return FALSE;
707 
708  hr = IWineMsiRemotePackage_GetMode(remote_package, iRunMode, &ret);
709  IWineMsiRemotePackage_Release(remote_package);
710 
711  if (hr == S_OK)
712  return ret;
713 
714  return FALSE;
715  }
716 
717  switch (iRunMode)
718  {
719  case MSIRUNMODE_ADMIN:
720  FIXME("no support for administrative installs\n");
721  break;
722 
724  FIXME("no support for advertised installs\n");
725  break;
726 
728  if (GetVersion() & 0x80000000)
729  r = TRUE;
730  break;
731 
736  break;
737 
739  r = package->scheduled_action_running;
740  break;
741 
742  case MSIRUNMODE_ROLLBACK:
743  r = package->rollback_action_running;
744  break;
745 
746  case MSIRUNMODE_COMMIT:
747  r = package->commit_action_running;
748  break;
749 
751  r = msi_get_property_int( package->db, szInstalled, 0 ) != 0;
752  break;
753 
755  r = msi_get_property_int( package->db, szRollbackDisabled, 0 ) == 0;
756  break;
757 
759  r = package->need_reboot_at_end;
760  break;
761 
763  r = package->need_reboot_now;
764  break;
765 
767  r = (package->log_file != INVALID_HANDLE_VALUE);
768  break;
769 
770  default:
771  FIXME("unimplemented run mode: %d\n", iRunMode);
772  r = TRUE;
773  }
774 
775  msiobj_release( &package->hdr );
776  return r;
777 }
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
static const WCHAR szRollbackDisabled[]
Definition: msipriv.h:1193
MSIOBJECTHDR hdr
Definition: msipriv.h:385
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
int msi_get_property_int(MSIDATABASE *package, LPCWSTR prop, int def) DECLSPEC_HIDDEN
Definition: package.c:2392
HANDLE log_file
Definition: msipriv.h:405
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetVersion(VOID)
Definition: version.c:22
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FIXME(fmt,...)
Definition: debug.h:110
unsigned char rollback_action_running
Definition: msipriv.h:446
unsigned char commit_action_running
Definition: msipriv.h:445
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
unsigned char need_reboot_now
Definition: msipriv.h:448
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
int ret
unsigned char scheduled_action_running
Definition: msipriv.h:444
#define S_OK
Definition: intsafe.h:59
IUnknown * msi_get_remote(MSIHANDLE handle)
Definition: handle.c:182
static const WCHAR szInstalled[]
Definition: msipriv.h:1122
unsigned char need_reboot_at_end
Definition: msipriv.h:447

Referenced by da_deferred(), da_immediate(), mrp_GetMode(), and session_invoke().

◆ MsiGetSourcePathA()

UINT WINAPI MsiGetSourcePathA ( MSIHANDLE  hInstall,
LPCSTR  szFolder,
LPSTR  szPathBuf,
LPDWORD  pcchPathBuf 
)

Definition at line 484 of file install.c.

486 {
487  LPWSTR folder;
488  awstring str;
489  UINT r;
490 
491  TRACE("%s %p %p\n", debugstr_a(szFolder), szPathBuf, pcchPathBuf);
492 
493  str.unicode = FALSE;
494  str.str.a = szPathBuf;
495 
496  folder = strdupAtoW( szFolder );
497  r = MSI_GetSourcePath( hInstall, folder, &str, pcchPathBuf );
498  msi_free( folder );
499 
500  return r;
501 }
Definition: fci.c:115
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static UINT MSI_GetSourcePath(MSIHANDLE hInstall, LPCWSTR szFolder, awstring *szPathBuf, LPDWORD pcchPathBuf)
Definition: install.c:396
const WCHAR * str
struct CFFOLDER folder
Definition: fdi.c:110
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67

Referenced by test_MsiGetSourcePath(), test_shortlongsource(), and test_sourcedir().

◆ MsiGetSourcePathW()

UINT WINAPI MsiGetSourcePathW ( MSIHANDLE  hInstall,
LPCWSTR  szFolder,
LPWSTR  szPathBuf,
LPDWORD  pcchPathBuf 
)

Definition at line 506 of file install.c.

508 {
509  awstring str;
510 
511  TRACE("%s %p %p\n", debugstr_w(szFolder), szPathBuf, pcchPathBuf );
512 
513  str.unicode = TRUE;
514  str.str.w = szPathBuf;
515 
516  return MSI_GetSourcePath( hInstall, szFolder, &str, pcchPathBuf );
517 }
#define TRUE
Definition: types.h:120
static UINT MSI_GetSourcePath(MSIHANDLE hInstall, LPCWSTR szFolder, awstring *szPathBuf, LPDWORD pcchPathBuf)
Definition: install.c:396
#define debugstr_w
Definition: kernel32.h:32
const WCHAR * str
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by mrp_GetSourcePath().

◆ MsiGetTargetPathA()

UINT WINAPI MsiGetTargetPathA ( MSIHANDLE  hInstall,
LPCSTR  szFolder,
LPSTR  szPathBuf,
LPDWORD  pcchPathBuf 
)

Definition at line 306 of file install.c.

308 {
309  LPWSTR szwFolder;
310  awstring path;
311  UINT r;
312 
313  TRACE("%s %p %p\n", debugstr_a(szFolder), szPathBuf, pcchPathBuf);
314 
315  szwFolder = strdupAtoW(szFolder);
316  if (szFolder && !szwFolder)
317  return ERROR_FUNCTION_FAILED;
318 
319  path.unicode = FALSE;
320  path.str.a = szPathBuf;
321 
322  r = MSI_GetTargetPath( hInstall, szwFolder, &path, pcchPathBuf );
323 
324  msi_free( szwFolder );
325 
326  return r;
327 }
GLsizei const GLchar ** path
Definition: glext.h:7234
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static UINT MSI_GetTargetPath(MSIHANDLE hInstall, LPCWSTR szFolder, awstring *szPathBuf, LPDWORD pcchPathBuf)
Definition: install.c:229
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
Definition: services.c:325
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67

Referenced by test_gettargetpath_bad(), and test_settargetpath().

◆ MsiGetTargetPathW()

UINT WINAPI MsiGetTargetPathW ( MSIHANDLE  hInstall,
LPCWSTR  szFolder,
LPWSTR  szPathBuf,
LPDWORD  pcchPathBuf 
)

Definition at line 332 of file install.c.

334 {
335  awstring path;
336 
337  TRACE("%s %p %p\n", debugstr_w(szFolder), szPathBuf, pcchPathBuf);
338 
339  path.unicode = TRUE;
340  path.str.w = szPathBuf;
341 
342  return MSI_GetTargetPath( hInstall, szFolder, &path, pcchPathBuf );
343 }
#define TRUE
Definition: types.h:120
GLsizei const GLchar ** path
Definition: glext.h:7234
static UINT MSI_GetTargetPath(MSIHANDLE hInstall, LPCWSTR szFolder, awstring *szPathBuf, LPDWORD pcchPathBuf)
Definition: install.c:229
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
Definition: services.c:325

Referenced by mrp_GetTargetPath(), and test_gettargetpath_bad().

◆ MsiSequenceA()

UINT WINAPI MsiSequenceA ( MSIHANDLE  hInstall,
LPCSTR  szTable,
INT  iSequenceMode 
)

Definition at line 117 of file install.c.

118 {
119  LPWSTR szwTable;
120  UINT ret;
121 
122  TRACE("%s, %d\n", debugstr_a(szTable), iSequenceMode);
123 
124  szwTable = strdupAtoW(szTable);
125  if (szTable && !szwTable)
126  return ERROR_FUNCTION_FAILED;
127 
128  ret = MsiSequenceW( hInstall, szwTable, iSequenceMode );
129  msi_free( szwTable );
130  return ret;
131 }
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
int ret
UINT WINAPI MsiSequenceW(MSIHANDLE hInstall, LPCWSTR szTable, INT iSequenceMode)
Definition: install.c:136
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67
static const WCHAR szTable[]
Definition: table.c:78

◆ MsiSequenceW()

UINT WINAPI MsiSequenceW ( MSIHANDLE  hInstall,
LPCWSTR  szTable,
INT  iSequenceMode 
)

Definition at line 136 of file install.c.

137 {
138  MSIPACKAGE *package;
139  UINT ret;
140 
141  TRACE("%s, %d\n", debugstr_w(szTable), iSequenceMode);
142 
143  package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE );
144  if (!package)
145  {
146  HRESULT hr;
147  BSTR table;
148  IWineMsiRemotePackage *remote_package;
149 
150  remote_package = (IWineMsiRemotePackage *)msi_get_remote( hInstall );
151  if (!remote_package)
152  return ERROR_INVALID_HANDLE;
153 
155  if (!table)
156  {
157  IWineMsiRemotePackage_Release( remote_package );
158  return ERROR_OUTOFMEMORY;
159  }
160 
161  hr = IWineMsiRemotePackage_Sequence( remote_package, table, iSequenceMode );
162 
163  SysFreeString( table );
164  IWineMsiRemotePackage_Release( remote_package );
165 
166  if (FAILED(hr))
167  {
169  return HRESULT_CODE(hr);
170 
171  return ERROR_FUNCTION_FAILED;
172  }
173 
174  return ERROR_SUCCESS;
175  }
176  ret = MSI_Sequence( package, szTable );
177  msiobj_release( &package->hdr );
178  return ret;
179 }
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
MSIOBJECTHDR hdr
Definition: msipriv.h:385
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
UINT MSI_Sequence(MSIPACKAGE *package, LPCWSTR table)
Definition: action.c:539
OLECHAR * BSTR
Definition: compat.h:1934
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define HRESULT_FACILITY(hr)
Definition: winerror.h:79
#define debugstr_w
Definition: kernel32.h:32
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
int ret
#define FACILITY_WIN32
Definition: winerror.h:27
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
unsigned int UINT
Definition: ndis.h:50
#define HRESULT_CODE(hr)
Definition: winerror.h:76
IUnknown * msi_get_remote(MSIHANDLE handle)
Definition: handle.c:182
static const WCHAR szTable[]
Definition: table.c:78
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by mrp_Sequence(), and MsiSequenceA().

◆ MsiSetComponentStateA()

UINT WINAPI MsiSetComponentStateA ( MSIHANDLE  hInstall,
LPCSTR  szComponent,
INSTALLSTATE  iState 
)

Definition at line 1432 of file install.c.

1434 {
1435  UINT rc;
1436  LPWSTR szwComponent = strdupAtoW(szComponent);
1437 
1438  rc = MsiSetComponentStateW(hInstall, szwComponent, iState);
1439 
1440  msi_free(szwComponent);
1441 
1442  return rc;
1443 }
UINT WINAPI MsiSetComponentStateW(MSIHANDLE hInstall, LPCWSTR szComponent, INSTALLSTATE iState)
Definition: install.c:1515
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67

Referenced by test_formatrecord_tables(), test_MsiSetComponentState(), and test_removefiles().

◆ MsiSetComponentStateW()

UINT WINAPI MsiSetComponentStateW ( MSIHANDLE  hInstall,
LPCWSTR  szComponent,
INSTALLSTATE  iState 
)

Definition at line 1515 of file install.c.

1517 {
1518  MSIPACKAGE* package;
1519  UINT ret;
1520 
1521  package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
1522  if (!package)
1523  {
1524  HRESULT hr;
1525  BSTR component;
1526  IWineMsiRemotePackage *remote_package;
1527 
1528  remote_package = (IWineMsiRemotePackage *)msi_get_remote(hInstall);
1529  if (!remote_package)
1530  return ERROR_INVALID_HANDLE;
1531 
1532  component = SysAllocString(szComponent);
1533  if (!component)
1534  {
1535  IWineMsiRemotePackage_Release(remote_package);
1536  return ERROR_OUTOFMEMORY;
1537  }
1538 
1539  hr = IWineMsiRemotePackage_SetComponentState(remote_package, component, iState);
1540 
1541  SysFreeString(component);
1542  IWineMsiRemotePackage_Release(remote_package);
1543 
1544  if (FAILED(hr))
1545  {
1547  return HRESULT_CODE(hr);
1548 
1549  return ERROR_FUNCTION_FAILED;
1550  }
1551 
1552  return ERROR_SUCCESS;
1553  }
1554 
1555  ret = MSI_SetComponentStateW(package, szComponent, iState);
1556  msiobj_release(&package->hdr);
1557  return ret;
1558 }
static UINT MSI_SetComponentStateW(MSIPACKAGE *package, LPCWSTR szComponent, INSTALLSTATE iState)
Definition: install.c:1463
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
MSIOBJECTHDR hdr
Definition: msipriv.h:385
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
OLECHAR * BSTR
Definition: compat.h:1934
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define HRESULT_FACILITY(hr)
Definition: winerror.h:79
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
LONG HRESULT
Definition: typedefs.h:77
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
int ret
#define FACILITY_WIN32
Definition: winerror.h:27
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
unsigned int UINT
Definition: ndis.h:50
#define HRESULT_CODE(hr)
Definition: winerror.h:76
IUnknown * msi_get_remote(MSIHANDLE handle)
Definition: handle.c:182
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by mrp_SetComponentState(), and MsiSetComponentStateA().

◆ MsiSetFeatureAttributesA()

UINT WINAPI MsiSetFeatureAttributesA ( MSIHANDLE  handle,
LPCSTR  feature,
DWORD  attrs 
)

Definition at line 1023 of file install.c.

1024 {
1025  UINT r;
1026  WCHAR *featureW = NULL;
1027 
1028  TRACE("%u, %s, 0x%08x\n", handle, debugstr_a(feature), attrs);
1029 
1030  if (feature && !(featureW = strdupAtoW( feature ))) return ERROR_OUTOFMEMORY;
1031 
1032  r = MsiSetFeatureAttributesW( handle, featureW, attrs );
1033  msi_free( featureW );
1034  return r;
1035 }
INTERNETFEATURELIST feature
Definition: misc.c:1689
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT WINAPI MsiSetFeatureAttributesW(MSIHANDLE handle, LPCWSTR name, DWORD attrs)
Definition: install.c:1053
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define debugstr_a
Definition: kernel32.h:31
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by test_MsiSetFeatureAttributes().

◆ MsiSetFeatureAttributesW()

UINT WINAPI MsiSetFeatureAttributesW ( MSIHANDLE  handle,
LPCWSTR  name,
DWORD  attrs 
)

Definition at line 1053 of file install.c.

1054 {
1055  MSIPACKAGE *package;
1057  WCHAR *costing;
1058 
1059  TRACE("%u, %s, 0x%08x\n", handle, debugstr_w(name), attrs);
1060 
1061  if (!name || !name[0]) return ERROR_UNKNOWN_FEATURE;
1062 
1063  if (!(package = msihandle2msiinfo( handle, MSIHANDLETYPE_PACKAGE )))
1064  return ERROR_INVALID_HANDLE;
1065 
1066  costing = msi_dup_property( package->db, szCostingComplete );
1067  if (!costing || !strcmpW( costing, szOne ))
1068  {
1069  msi_free( costing );
1070  msiobj_release( &package->hdr );
1071  return ERROR_FUNCTION_FAILED;
1072  }
1073  msi_free( costing );
1074  if (!(feature = msi_get_loaded_feature( package, name )))
1075  {
1076  msiobj_release( &package->hdr );
1077  return ERROR_UNKNOWN_FEATURE;
1078  }
1079  feature->Attributes = unmap_feature_attributes( attrs );
1080  msiobj_release( &package->hdr );
1081  return ERROR_SUCCESS;
1082 }
static DWORD unmap_feature_attributes(DWORD attrs)
Definition: install.c:1037
INTERNETFEATURELIST feature
Definition: misc.c:1689
MSIFEATURE * msi_get_loaded_feature(MSIPACKAGE *package, const WCHAR *Feature)
Definition: action.c:663
#define ERROR_SUCCESS
Definition: deptool.c:10
MSIOBJECTHDR hdr
Definition: msipriv.h:385
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
#define ERROR_UNKNOWN_FEATURE
Definition: winerror.h:964
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR szCostingComplete[]
Definition: msipriv.h:1181
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
#define MSIHANDLETYPE_PACKAGE
Definition: msipriv.h:703
static const WCHAR szOne[]
Definition: msipriv.h:1108
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
Definition: name.c:36
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229
void * msihandle2msiinfo(MSIHANDLE handle, UINT type)
Definition: handle.c:157
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop) DECLSPEC_HIDDEN
Definition: package.c:2370

Referenced by MsiSetFeatureAttributesA().

◆ MsiSetFeatureStateA()

UINT WINAPI MsiSetFeatureStateA ( MSIHANDLE  hInstall,
LPCSTR  szFeature,
INSTALLSTATE  iState 
)

Definition at line 839 of file install.c.

841 {
842  LPWSTR szwFeature = NULL;
843  UINT rc;
844 
845  szwFeature = strdupAtoW(szFeature);
846 
847  if (!szwFeature)
848  return ERROR_FUNCTION_FAILED;
849 
850  rc = MsiSetFeatureStateW(hInstall,szwFeature, iState);
851 
852  msi_free(szwFeature);
853 
854  return rc;
855 }
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
smooth NULL
Definition: ftsmooth.c:416
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
UINT WINAPI MsiSetFeatureStateW(MSIHANDLE hInstall, LPCWSTR szFeature, INSTALLSTATE iState)
Definition: install.c:972
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67

Referenced by test_featureparents().

◆ MsiSetFeatureStateW()

UINT WINAPI MsiSetFeatureStateW ( MSIHANDLE  hInstall,
LPCWSTR  szFeature,
INSTALLSTATE  iState 
)

Definition at line 972 of file install.c.

974 {
975  MSIPACKAGE* package;
976  UINT rc = ERROR_SUCCESS;
977 
978  TRACE("%s %i\n",debugstr_w(szFeature), iState);
979 
980  package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
981  if (!package)
982  {
983  HRESULT hr;
984  BSTR feature;
985  IWineMsiRemotePackage *remote_package;
986 
987  remote_package = (IWineMsiRemotePackage *)msi_get_remote(hInstall);
988  if (!remote_package)
989  return ERROR_INVALID_HANDLE;
990 
991  feature = SysAllocString(szFeature);
992  if (!feature)
993  {
994  IWineMsiRemotePackage_Release(remote_package);
995  return ERROR_OUTOFMEMORY;
996  }
997 
998  hr = IWineMsiRemotePackage_SetFeatureState(remote_package, feature, iState);
999 
1001  IWineMsiRemotePackage_Release(remote_package);
1002 
1003  if (FAILED(hr))
1004  {
1006  return HRESULT_CODE(hr);
1007 
1008  return ERROR_FUNCTION_FAILED;
1009  }
1010 
1011  return ERROR_SUCCESS;
1012  }
1013 
1014  rc = MSI_SetFeatureStateW(package,szFeature,iState);
1015 
1016  msiobj_release( &package->hdr );
1017  return rc;
1018 }
INTERNETFEATURELIST feature
Definition: misc.c:1689
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
MSIOBJECTHDR hdr
Definition: msipriv.h:385
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
OLECHAR * BSTR
Definition: compat.h:1934
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define HRESULT_FACILITY(hr)
Definition: winerror.h:79
#define debugstr_w
Definition: kernel32.h:32
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
UINT MSI_SetFeatureStateW(MSIPACKAGE *package, LPCWSTR szFeature, INSTALLSTATE iState)
Definition: install.c:940
#define FACILITY_WIN32
Definition: winerror.h:27
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
unsigned int UINT
Definition: ndis.h:50
#define HRESULT_CODE(hr)
Definition: winerror.h:76
IUnknown * msi_get_remote(MSIHANDLE handle)
Definition: handle.c:182
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by mrp_SetFeatureState(), MsiSetFeatureStateA(), and session_invoke().

◆ MsiSetInstallLevel()

UINT WINAPI MsiSetInstallLevel ( MSIHANDLE  hInstall,
int  iInstallLevel 
)

Definition at line 1670 of file install.c.

1671 {
1672  MSIPACKAGE* package;
1673  UINT r;
1674 
1675  TRACE("%d %i\n", hInstall, iInstallLevel);
1676 
1677  package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
1678  if (!package)
1679  {
1680  HRESULT hr;
1681  IWineMsiRemotePackage *remote_package;
1682 
1683  remote_package = (IWineMsiRemotePackage *)msi_get_remote(hInstall);
1684  if (!remote_package)
1685  return ERROR_INVALID_HANDLE;
1686 
1687  hr = IWineMsiRemotePackage_SetInstallLevel(remote_package, iInstallLevel);
1688 
1689  IWineMsiRemotePackage_Release(remote_package);
1690 
1691  if (FAILED(hr))
1692  {
1694  return HRESULT_CODE(hr);
1695 
1696  return ERROR_FUNCTION_FAILED;
1697  }
1698 
1699  return ERROR_SUCCESS;
1700  }
1701 
1702  r = MSI_SetInstallLevel( package, iInstallLevel );
1703 
1704  msiobj_release( &package->hdr );
1705 
1706  return r;
1707 }
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
MSIOBJECTHDR hdr
Definition: msipriv.h:385
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
UINT MSI_SetInstallLevel(MSIPACKAGE *package, int iInstallLevel)
Definition: install.c:1644
#define HRESULT_FACILITY(hr)
Definition: winerror.h:79
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
#define FACILITY_WIN32
Definition: winerror.h:27
unsigned int UINT
Definition: ndis.h:50
#define HRESULT_CODE(hr)
Definition: winerror.h:76
IUnknown * msi_get_remote(MSIHANDLE handle)
Definition: handle.c:182

Referenced by mrp_SetInstallLevel(), and session_invoke().

◆ MsiSetMode()

UINT WINAPI MsiSetMode ( MSIHANDLE  hInstall,
MSIRUNMODE  iRunMode,
BOOL  fState 
)

Definition at line 782 of file install.c.

783 {
784  MSIPACKAGE *package;
785  UINT r;
786 
787  TRACE("%d %d %d\n", hInstall, iRunMode, fState);
788 
789  package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE );
790  if (!package)
791  {
792  HRESULT hr;
793  IWineMsiRemotePackage *remote_package;
794 
795  remote_package = (IWineMsiRemotePackage *)msi_get_remote( hInstall );
796  if (!remote_package)
797  return FALSE;
798 
799  hr = IWineMsiRemotePackage_SetMode( remote_package, iRunMode, fState );
800  IWineMsiRemotePackage_Release( remote_package );
801 
802  if (FAILED(hr))
803  {
805  return HRESULT_CODE(hr);
806 
807  return ERROR_FUNCTION_FAILED;
808  }
809 
810  return ERROR_SUCCESS;
811  }
812 
813  switch (iRunMode)
814  {
816  package->need_reboot_at_end = (fState != 0);
817  r = ERROR_SUCCESS;
818  break;
819 
821  package->need_reboot_now = (fState != 0);
822  r = ERROR_SUCCESS;
823  break;
824 
825  default:
827  }
828 
829  msiobj_release( &package->hdr );
830  return r;
831 }
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
MSIOBJECTHDR hdr
Definition: msipriv.h:385
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define ERROR_ACCESS_DENIED
Definition: compat.h:87
#define HRESULT_FACILITY(hr)
Definition: winerror.h:79
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
unsigned char need_reboot_now
Definition: msipriv.h:448
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
#define FACILITY_WIN32
Definition: winerror.h:27
unsigned int UINT
Definition: ndis.h:50
#define HRESULT_CODE(hr)
Definition: winerror.h:76
IUnknown * msi_get_remote(MSIHANDLE handle)
Definition: handle.c:182
unsigned char need_reboot_at_end
Definition: msipriv.h:447

Referenced by mrp_SetMode(), and session_invoke().

◆ MsiSetTargetPathA()

UINT WINAPI MsiSetTargetPathA ( MSIHANDLE  hInstall,
LPCSTR  szFolder,
LPCSTR  szFolderPath 
)

Definition at line 522 of file install.c.

524 {
525  LPWSTR szwFolder = NULL, szwFolderPath = NULL;
526  UINT rc = ERROR_OUTOFMEMORY;
527 
528  if ( !szFolder || !szFolderPath )
530 
531  szwFolder = strdupAtoW(szFolder);
532  szwFolderPath = strdupAtoW(szFolderPath);
533  if (!szwFolder || !szwFolderPath)
534  goto end;
535 
536  rc = MsiSetTargetPathW( hInstall, szwFolder, szwFolderPath );
537 
538 end:
539  msi_free(szwFolder);
540  msi_free(szwFolderPath);
541 
542  return rc;
543 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
GLuint GLuint end
Definition: gl.h:1545
UINT WINAPI MsiSetTargetPathW(MSIHANDLE hInstall, LPCWSTR szFolder, LPCWSTR szFolderPath)
Definition: install.c:603
smooth NULL
Definition: ftsmooth.c:416
unsigned int UINT
Definition: ndis.h:50
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * strdupAtoW(const char *str)
Definition: main.c:67
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by test_settargetpath().

◆ MsiSetTargetPathW()

UINT WINAPI MsiSetTargetPathW ( MSIHANDLE  hInstall,
LPCWSTR  szFolder,
LPCWSTR  szFolderPath 
)

Definition at line 603 of file install.c.

605 {
606  MSIPACKAGE *package;
607  UINT ret;
608 
609  TRACE("%s %s\n",debugstr_w(szFolder),debugstr_w(szFolderPath));
610 
611  if ( !szFolder || !szFolderPath )
613 
614  package = msihandle2msiinfo(hInstall, MSIHANDLETYPE_PACKAGE);
615  if (!package)
616  {
617  HRESULT hr;
618  BSTR folder, path;
619  IWineMsiRemotePackage *remote_package;
620 
621  remote_package = (IWineMsiRemotePackage *)msi_get_remote( hInstall );
622  if (!remote_package)
623  return ERROR_INVALID_HANDLE;
624 
625  folder = SysAllocString( szFolder );
626  path = SysAllocString( szFolderPath );
627  if (!folder || !path)
628  {
631  IWineMsiRemotePackage_Release( remote_package );
632  return ERROR_OUTOFMEMORY;
633  }
634 
635  hr = IWineMsiRemotePackage_SetTargetPath( remote_package, folder, path );
636 
639  IWineMsiRemotePackage_Release( remote_package );
640 
641  if (FAILED(hr))
642  {
644  return HRESULT_CODE(hr);
645 
646  return ERROR_FUNCTION_FAILED;
647  }
648 
649  return ERROR_SUCCESS;
650  }
651 
652  ret = MSI_SetTargetPathW( package, szFolder, szFolderPath );
653  msiobj_release( &package->hdr );
654  return ret;
655 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
Definition: fci.c:115
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
MSIOBJECTHDR hdr
Definition: msipriv.h:385
GLsizei const GLchar ** path
Definition: glext.h:7234
#define ERROR_INVALID_HANDLE
Definition: compat.h:88
OLECHAR * BSTR
Definition: compat.h:1934
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define HRESULT_FACILITY(hr)
Definition: winerror.h:79
#define debugstr_w
Definition: kernel32.h:32
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
struct CFFOLDER folder
Definition: fdi.c:110
#define TRACE(s)
Definition: solgame.cpp:4
UINT MSI_SetTargetPathW(MSIPACKAGE *package, LPCWSTR szFolder, LPCWSTR szFolderPath)
Definition: install.c:567
LONG HRESULT
Definition: typedefs.h:77
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
int ret
#define FACILITY_WIN32
Definition: winerror.h:27
Definition: services.c:325
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
unsigned int UINT
Definition: ndis.h:50
#define HRESULT_CODE(hr)
Definition: winerror.h:76
IUnknown * msi_get_remote(MSIHANDLE handle)
Definition: handle.c:182
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

Referenced by mrp_SetTargetPath(), and MsiSetTargetPathA().

◆ set_target_path()

static void set_target_path ( MSIPACKAGE package,
MSIFOLDER folder,
const WCHAR path 
)
static

Definition at line 545 of file install.c.

546 {
547  FolderList *fl;
548  MSIFOLDER *child;
549  WCHAR *target_path;
550 
551  if (!(target_path = msi_normalize_path( path ))) return;
552  if (strcmpW( target_path, folder->ResolvedTarget ))
553  {
554  msi_free( folder->ResolvedTarget );
555  folder->ResolvedTarget = target_path;
556  msi_set_property( package->db, folder->Directory, folder->ResolvedTarget, -1 );
557 
558  LIST_FOR_EACH_ENTRY( fl, &folder->children, FolderList, entry )
559  {
560  child = fl->folder;
561  msi_resolve_target_folder( package, child->Directory, FALSE );
562  }
563  }
564  else msi_free( target_path );
565 }
WCHAR * msi_normalize_path(const WCHAR *in)
Definition: action.c:2273
Definition: fci.c:115
uint8_t entry
Definition: isohybrid.c:63
static HWND child
Definition: cursoricon.c:298
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
_In_ FLONG fl
Definition: winddi.h:1279
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
void msi_resolve_target_folder(MSIPACKAGE *package, const WCHAR *name, BOOL load_prop)
Definition: action.c:2333
Definition: services.c:325
UINT msi_set_property(MSIDATABASE *, const WCHAR *, const WCHAR *, int) DECLSPEC_HIDDEN
Definition: package.c:2149
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229

Referenced by MSI_SetTargetPathW().

◆ unmap_feature_attributes()

static DWORD unmap_feature_attributes ( DWORD  attrs)
static

Definition at line 1037 of file install.c.

1038 {
1039  DWORD ret = 0;
1040 
1047  return ret;
1048 }
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret

Referenced by MsiSetFeatureAttributesW().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msi  )