ReactOS 0.4.16-dev-2-g02a6913
action.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "winreg.h"
#include "winsvc.h"
#include "odbcinst.h"
#include "wine/debug.h"
#include "msidefs.h"
#include "winuser.h"
#include "shlobj.h"
#include "objbase.h"
#include "mscoree.h"
#include "shlwapi.h"
#include "imagehlp.h"
#include "winver.h"
#include "msipriv.h"
#include "resource.h"
Include dependency graph for action.c:

Go to the source code of this file.

Classes

struct  dummy_thread
 
struct  _ilfs
 
struct  typelib_struct
 

Macros

#define COBJMACROS
 
#define REG_PROGRESS_VALUE   13200
 
#define COMPONENT_PROGRESS_VALUE   24000
 
#define ENV_ACT_SETALWAYS   0x1
 
#define ENV_ACT_SETABSENT   0x2
 
#define ENV_ACT_REMOVE   0x4
 
#define ENV_ACT_REMOVEMATCH   0x8
 
#define ENV_MOD_MACHINE   0x20000000
 
#define ENV_MOD_APPEND   0x40000000
 
#define ENV_MOD_PREFIX   0x80000000
 
#define ENV_MOD_MASK   0xC0000000
 
#define check_flag_combo(x, y)   ((x) & ~(y)) == (y)
 

Enumerations

enum  parse_state {
  STATE_NONE , STATE_OK , STATE_MULTILINE , STATE_DONE ,
  STATE_ROOT , STATE_CONFIGURATION , STATE_STARTUP , STATE_UNKNOWN ,
  state_whitespace , state_token , state_quote
}
 
enum  join_op { JOIN_OP_APPEND , JOIN_OP_PREPEND , JOIN_OP_REPLACE }
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msi)
 
static INT ui_actionstart (MSIPACKAGE *package, LPCWSTR action, LPCWSTR description, LPCWSTR template)
 
static void ui_actioninfo (MSIPACKAGE *package, LPCWSTR action, BOOL start, INT rc)
 
static int parse_prop (const WCHAR *str, WCHAR *value, int *quotes)
 
static void remove_quotes (WCHAR *str)
 
UINT msi_parse_command_line (MSIPACKAGE *package, LPCWSTR szCommandLine, BOOL preserve_case)
 
const WCHARmsi_get_command_line_option (const WCHAR *cmd, const WCHAR *option, UINT *len)
 
WCHAR ** msi_split_string (const WCHAR *str, WCHAR sep)
 
static BOOL ui_sequence_exists (MSIPACKAGE *package)
 
UINT msi_set_sourcedir_props (MSIPACKAGE *package, BOOL replace)
 
static BOOL needs_ui_sequence (MSIPACKAGE *package)
 
UINT msi_set_context (MSIPACKAGE *package)
 
static UINT ITERATE_Actions (MSIRECORD *row, LPVOID param)
 
UINT MSI_Sequence (MSIPACKAGE *package, LPCWSTR table)
 
static UINT ACTION_ProcessExecSequence (MSIPACKAGE *package)
 
static UINT ACTION_ProcessUISequence (MSIPACKAGE *package)
 
static UINT ACTION_HandleCustomAction (MSIPACKAGE *package, LPCWSTR action)
 
MSICOMPONENTmsi_get_loaded_component (MSIPACKAGE *package, const WCHAR *Component)
 
MSIFEATUREmsi_get_loaded_feature (MSIPACKAGE *package, const WCHAR *Feature)
 
MSIFILEmsi_get_loaded_file (MSIPACKAGE *package, const WCHAR *key)
 
MSIFOLDERmsi_get_loaded_folder (MSIPACKAGE *package, const WCHAR *dir)
 
void msi_ui_progress (MSIPACKAGE *package, int a, int b, int c, int d)
 
INSTALLSTATE msi_get_component_action (MSIPACKAGE *package, MSICOMPONENT *comp)
 
INSTALLSTATE msi_get_feature_action (MSIPACKAGE *package, MSIFEATURE *feature)
 
static UINT ITERATE_CreateFolders (MSIRECORD *row, LPVOID param)
 
static UINT ACTION_CreateFolders (MSIPACKAGE *package)
 
static void remove_persistent_folder (MSIFOLDER *folder)
 
static UINT ITERATE_RemoveFolders (MSIRECORD *row, LPVOID param)
 
static UINT ACTION_RemoveFolders (MSIPACKAGE *package)
 
static UINT load_component (MSIRECORD *row, LPVOID param)
 
UINT msi_load_all_components (MSIPACKAGE *package)
 
static UINT add_feature_component (MSIFEATURE *feature, MSICOMPONENT *comp)
 
static UINT add_feature_child (MSIFEATURE *parent, MSIFEATURE *child)
 
static UINT iterate_load_featurecomponents (MSIRECORD *row, LPVOID param)
 
static UINT load_feature (MSIRECORD *row, LPVOID param)
 
static UINT find_feature_children (MSIRECORD *row, LPVOID param)
 
UINT msi_load_all_features (MSIPACKAGE *package)
 
static LPWSTR folder_split_path (LPWSTR p, WCHAR ch)
 
static UINT load_file_hash (MSIPACKAGE *package, MSIFILE *file)
 
static UINT load_file_disk_id (MSIPACKAGE *package, MSIFILE *file)
 
static UINT load_file (MSIRECORD *row, LPVOID param)
 
static UINT load_all_files (MSIPACKAGE *package)
 
static UINT load_media (MSIRECORD *row, LPVOID param)
 
static UINT load_all_media (MSIPACKAGE *package)
 
static UINT load_patch_disk_id (MSIPACKAGE *package, MSIFILEPATCH *patch)
 
static UINT load_patch (MSIRECORD *row, LPVOID param)
 
static UINT load_all_patches (MSIPACKAGE *package)
 
static UINT iterate_patched_component (MSIRECORD *row, LPVOID param)
 
static void mark_patched_components (MSIPACKAGE *package)
 
static UINT load_folder_persistence (MSIPACKAGE *package, MSIFOLDER *folder)
 
static UINT load_folder (MSIRECORD *row, LPVOID param)
 
static UINT add_folder_child (MSIFOLDER *parent, MSIFOLDER *child)
 
static UINT find_folder_children (MSIRECORD *row, LPVOID param)
 
static UINT load_all_folders (MSIPACKAGE *package)
 
static UINT ACTION_CostInitialize (MSIPACKAGE *package)
 
static UINT execute_script (MSIPACKAGE *package, UINT script)
 
static UINT ACTION_FileCost (MSIPACKAGE *package)
 
static void get_client_counts (MSIPACKAGE *package)
 
static void ACTION_GetComponentInstallStates (MSIPACKAGE *package)
 
static void ACTION_GetFeatureInstallStates (MSIPACKAGE *package)
 
static BOOL is_feature_selected (MSIFEATURE *feature, INT level)
 
static BOOL process_state_property (MSIPACKAGE *package, int level, LPCWSTR property, INSTALLSTATE state)
 
static BOOL process_overrides (MSIPACKAGE *package, int level)
 
static void disable_children (MSIFEATURE *feature, int level)
 
static void follow_parent (MSIFEATURE *feature)
 
UINT MSI_SetFeatureStates (MSIPACKAGE *package)
 
static UINT ITERATE_CostFinalizeConditions (MSIRECORD *row, LPVOID param)
 
int msi_compare_file_versions (VS_FIXEDFILEINFO *fi, const WCHAR *version)
 
int msi_compare_font_versions (const WCHAR *ver1, const WCHAR *ver2)
 
static WCHARcreate_temp_dir (MSIDATABASE *db)
 
WCHAR *WINAPIV msi_build_directory_name (DWORD count,...)
 
BOOL msi_is_global_assembly (MSICOMPONENT *comp)
 
static void set_target_path (MSIPACKAGE *package, MSIFILE *file)
 
static UINT calculate_file_cost (MSIPACKAGE *package)
 
WCHARmsi_normalize_path (const WCHAR *in)
 
static WCHARget_install_location (MSIPACKAGE *package)
 
void msi_resolve_target_folder (MSIPACKAGE *package, const WCHAR *name, BOOL load_prop)
 
static ULONGLONG get_volume_space_required (MSIPACKAGE *package)
 
static UINT ACTION_CostFinalize (MSIPACKAGE *package)
 
static BYTEparse_value (MSIPACKAGE *package, const WCHAR *value, DWORD len, DWORD *type, DWORD *size)
 
static const WCHARget_root_key (MSIPACKAGE *package, INT root, HKEY *root_key)
 
static REGSAM get_registry_view (const MSICOMPONENT *comp)
 
static HKEY open_key (const MSICOMPONENT *comp, HKEY root, const WCHAR *path, BOOL create, REGSAM access)
 
static BOOL is_special_entry (const WCHAR *name)
 
static WCHAR ** split_multi_string_values (const WCHAR *str, DWORD len, DWORD *count)
 
static WCHARflatten_multi_string_values (WCHAR **left, DWORD left_count, WCHAR **right, DWORD right_count, DWORD *size)
 
static DWORD remove_duplicate_values (WCHAR **old, DWORD old_count, WCHAR **new, DWORD new_count)
 
static WCHARjoin_multi_string_values (enum join_op op, WCHAR **old, DWORD old_count, WCHAR **new, DWORD new_count, DWORD *size)
 
static BYTEbuild_multi_string_value (BYTE *old_value, DWORD old_size, BYTE *new_value, DWORD new_size, DWORD *size)
 
static BYTEreg_get_value (HKEY hkey, const WCHAR *name, DWORD *type, DWORD *size)
 
static UINT ITERATE_WriteRegistryValues (MSIRECORD *row, LPVOID param)
 
static UINT ACTION_WriteRegistryValues (MSIPACKAGE *package)
 
static int is_key_empty (const MSICOMPONENT *comp, HKEY root, const WCHAR *path)
 
static void delete_key (const MSICOMPONENT *comp, HKEY root, const WCHAR *path)
 
static void delete_value (const MSICOMPONENT *comp, HKEY root, const WCHAR *path, const WCHAR *value)
 
static void delete_tree (const MSICOMPONENT *comp, HKEY root, const WCHAR *path)
 
static UINT ITERATE_RemoveRegistryValuesOnUninstall (MSIRECORD *row, LPVOID param)
 
static UINT ITERATE_RemoveRegistryValuesOnInstall (MSIRECORD *row, LPVOID param)
 
static UINT ACTION_RemoveRegistryValues (MSIPACKAGE *package)
 
static UINT ACTION_InstallInitialize (MSIPACKAGE *package)
 
static UINT ACTION_InstallValidate (MSIPACKAGE *package)
 
static UINT ITERATE_LaunchConditions (MSIRECORD *row, LPVOID param)
 
static UINT ACTION_LaunchConditions (MSIPACKAGE *package)
 
static LPWSTR resolve_keypath (MSIPACKAGE *package, MSICOMPONENT *cmp)
 
static HKEY open_shared_dlls_key (MSICOMPONENT *comp, BOOL create, REGSAM access)
 
static UINT get_shared_dlls_count (MSICOMPONENT *comp)
 
static void write_shared_dlls_count (MSICOMPONENT *comp, const WCHAR *path, INT count)
 
static void refcount_component (MSIPACKAGE *package, MSICOMPONENT *comp)
 
static WCHARbuild_full_keypath (MSIPACKAGE *package, MSICOMPONENT *comp)
 
static UINT ACTION_ProcessComponents (MSIPACKAGE *package)
 
static BOOL CALLBACK Typelib_EnumResNameProc (HMODULE hModule, LPCWSTR lpszType, LPWSTR lpszName, LONG_PTR lParam)
 
static HMODULE msi_load_library (MSIPACKAGE *package, const WCHAR *filename, DWORD flags)
 
static HRESULT msi_load_typelib (MSIPACKAGE *package, const WCHAR *filename, REGKIND kind, ITypeLib **lib)
 
static UINT ITERATE_RegisterTypeLibraries (MSIRECORD *row, LPVOID param)
 
static UINT ACTION_RegisterTypeLibraries (MSIPACKAGE *package)
 
static UINT ITERATE_UnregisterTypeLibraries (MSIRECORD *row, LPVOID param)
 
static UINT ACTION_UnregisterTypeLibraries (MSIPACKAGE *package)
 
static WCHARget_link_file (MSIPACKAGE *package, MSIRECORD *row)
 
WCHARmsi_build_icon_path (MSIPACKAGE *package, const WCHAR *icon_name)
 
static UINT ITERATE_CreateShortcuts (MSIRECORD *row, LPVOID param)
 
static UINT ACTION_CreateShortcuts (MSIPACKAGE *package)
 
static UINT ITERATE_RemoveShortcuts (MSIRECORD *row, LPVOID param)
 
static UINT ACTION_RemoveShortcuts (MSIPACKAGE *package)
 
static UINT ITERATE_PublishIcon (MSIRECORD *row, LPVOID param)
 
static UINT msi_publish_icons (MSIPACKAGE *package)
 
static UINT msi_publish_sourcelist (MSIPACKAGE *package, HKEY hkey)
 
static UINT msi_publish_product_properties (MSIPACKAGE *package, HKEY hkey)
 
static UINT msi_publish_upgrade_code (MSIPACKAGE *package)
 
static BOOL msi_check_publish (MSIPACKAGE *package)
 
static BOOL msi_check_unpublish (MSIPACKAGE *package)
 
static UINT msi_publish_patches (MSIPACKAGE *package)
 
static UINT ACTION_PublishProduct (MSIPACKAGE *package)
 
static WCHARget_ini_file_name (MSIPACKAGE *package, MSIRECORD *row)
 
static UINT ITERATE_WriteIniValues (MSIRECORD *row, LPVOID param)
 
static UINT ACTION_WriteIniValues (MSIPACKAGE *package)
 
static UINT ITERATE_RemoveIniValuesOnUninstall (MSIRECORD *row, LPVOID param)
 
static UINT ITERATE_RemoveIniValuesOnInstall (MSIRECORD *row, LPVOID param)
 
static UINT ACTION_RemoveIniValues (MSIPACKAGE *package)
 
static void register_dll (const WCHAR *dll, BOOL unregister)
 
static UINT ITERATE_SelfRegModules (MSIRECORD *row, LPVOID param)
 
static UINT ACTION_SelfRegModules (MSIPACKAGE *package)
 
static UINT ITERATE_SelfUnregModules (MSIRECORD *row, LPVOID param)
 
static UINT ACTION_SelfUnregModules (MSIPACKAGE *package)
 
static UINT ACTION_PublishFeatures (MSIPACKAGE *package)
 
static UINT msi_unpublish_feature (MSIPACKAGE *package, MSIFEATURE *feature)
 
static UINT ACTION_UnpublishFeatures (MSIPACKAGE *package)
 
static UINT msi_publish_install_properties (MSIPACKAGE *package, HKEY hkey)
 
static UINT ACTION_RegisterProduct (MSIPACKAGE *package)
 
static UINT ACTION_InstallExecute (MSIPACKAGE *package)
 
static UINT ITERATE_UnpublishIcon (MSIRECORD *row, LPVOID param)
 
static UINT msi_unpublish_icons (MSIPACKAGE *package)
 
static void remove_product_upgrade_code (MSIPACKAGE *package)
 
static UINT ACTION_UnpublishProduct (MSIPACKAGE *package)
 
static BOOL is_full_uninstall (MSIPACKAGE *package)
 
static UINT ACTION_InstallFinalize (MSIPACKAGE *package)
 
UINT ACTION_ForceReboot (MSIPACKAGE *package)
 
static UINT ACTION_ResolveSource (MSIPACKAGE *package)
 
static UINT ACTION_RegisterUser (MSIPACKAGE *package)
 
static UINT iterate_properties (MSIRECORD *record, void *param)
 
static UINT ACTION_ExecuteAction (MSIPACKAGE *package)
 
static UINT ACTION_INSTALL (MSIPACKAGE *package)
 
WCHARmsi_create_component_advertise_string (MSIPACKAGE *package, MSICOMPONENT *component, const WCHAR *feature)
 
static UINT ITERATE_PublishComponent (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_PublishComponents (MSIPACKAGE *package)
 
static UINT ITERATE_UnpublishComponent (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_UnpublishComponents (MSIPACKAGE *package)
 
static UINT ITERATE_InstallService (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_InstallServices (MSIPACKAGE *package)
 
static LPCWSTRmsi_service_args_to_vector (LPWSTR args, DWORD *numargs)
 
static UINT ITERATE_StartService (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_StartServices (MSIPACKAGE *package)
 
static BOOL stop_service_dependents (SC_HANDLE scm, SC_HANDLE service)
 
static UINT stop_service (LPCWSTR name)
 
static UINT ITERATE_StopService (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_StopServices (MSIPACKAGE *package)
 
static UINT ITERATE_DeleteService (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_DeleteServices (MSIPACKAGE *package)
 
static UINT ITERATE_InstallODBCDriver (MSIRECORD *rec, LPVOID param)
 
static UINT ITERATE_InstallODBCTranslator (MSIRECORD *rec, LPVOID param)
 
static UINT ITERATE_InstallODBCDataSource (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_InstallODBC (MSIPACKAGE *package)
 
static UINT ITERATE_RemoveODBCDriver (MSIRECORD *rec, LPVOID param)
 
static UINT ITERATE_RemoveODBCTranslator (MSIRECORD *rec, LPVOID param)
 
static UINT ITERATE_RemoveODBCDataSource (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_RemoveODBC (MSIPACKAGE *package)
 
static UINT env_parse_flags (LPCWSTR *name, LPCWSTR *value, DWORD *flags)
 
static UINT open_env_key (DWORD flags, HKEY *key)
 
static UINT ITERATE_WriteEnvironmentString (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_WriteEnvironmentStrings (MSIPACKAGE *package)
 
static UINT ITERATE_RemoveEnvironmentString (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_RemoveEnvironmentStrings (MSIPACKAGE *package)
 
UINT msi_validate_product_id (MSIPACKAGE *package)
 
static UINT ACTION_ValidateProductID (MSIPACKAGE *package)
 
static UINT ACTION_ScheduleReboot (MSIPACKAGE *package)
 
static UINT ACTION_AllocateRegistrySpace (MSIPACKAGE *package)
 
static UINT ACTION_DisableRollback (MSIPACKAGE *package)
 
static UINT ACTION_InstallAdminPackage (MSIPACKAGE *package)
 
static UINT ACTION_SetODBCFolders (MSIPACKAGE *package)
 
static UINT ITERATE_RemoveExistingProducts (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_RemoveExistingProducts (MSIPACKAGE *package)
 
static UINT ITERATE_MigrateFeatureStates (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_MigrateFeatureStates (MSIPACKAGE *package)
 
static BOOL msi_bind_image (MSIPACKAGE *package, const char *filename, const char *path)
 
static void bind_image (MSIPACKAGE *package, const char *filename, const char *path)
 
static UINT ITERATE_BindImage (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_BindImage (MSIPACKAGE *package)
 
static UINT msi_unimplemented_action_stub (MSIPACKAGE *package, LPCSTR action, LPCWSTR table)
 
static UINT ACTION_IsolateComponents (MSIPACKAGE *package)
 
static UINT ACTION_RMCCPSearch (MSIPACKAGE *package)
 
static UINT ACTION_RegisterComPlus (MSIPACKAGE *package)
 
static UINT ACTION_UnregisterComPlus (MSIPACKAGE *package)
 
static UINT ACTION_InstallSFPCatalogFile (MSIPACKAGE *package)
 
static UINT ACTION_HandleStandardAction (MSIPACKAGE *package, LPCWSTR action)
 
UINT ACTION_PerformAction (MSIPACKAGE *package, const WCHAR *action)
 
static UINT ACTION_PerformActionSequence (MSIPACKAGE *package, UINT seq)
 
DWORD WINAPI dummy_thread_proc (void *arg)
 
static void start_dummy_thread (struct dummy_thread *info)
 
static void stop_dummy_thread (struct dummy_thread *info)
 
UINT MSI_InstallPackage (MSIPACKAGE *package, LPCWSTR szPackagePath, LPCWSTR szCommandLine)
 

Variables

struct {
   const WCHAR *   action
 
   const UINT   description
 
   const UINT   template
 
   UINT(*   handler )(MSIPACKAGE *)
 
   const WCHAR *   action_rollback
 
StandardActions []
 

Macro Definition Documentation

◆ check_flag_combo

#define check_flag_combo (   x,
  y 
)    ((x) & ~(y)) == (y)

Definition at line 6678 of file action.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 23 of file action.c.

◆ COMPONENT_PROGRESS_VALUE

#define COMPONENT_PROGRESS_VALUE   24000

Definition at line 45 of file action.c.

◆ ENV_ACT_REMOVE

#define ENV_ACT_REMOVE   0x4

Definition at line 6670 of file action.c.

◆ ENV_ACT_REMOVEMATCH

#define ENV_ACT_REMOVEMATCH   0x8

Definition at line 6671 of file action.c.

◆ ENV_ACT_SETABSENT

#define ENV_ACT_SETABSENT   0x2

Definition at line 6669 of file action.c.

◆ ENV_ACT_SETALWAYS

#define ENV_ACT_SETALWAYS   0x1

Definition at line 6668 of file action.c.

◆ ENV_MOD_APPEND

#define ENV_MOD_APPEND   0x40000000

Definition at line 6674 of file action.c.

◆ ENV_MOD_MACHINE

#define ENV_MOD_MACHINE   0x20000000

Definition at line 6673 of file action.c.

◆ ENV_MOD_MASK

#define ENV_MOD_MASK   0xC0000000

Definition at line 6676 of file action.c.

◆ ENV_MOD_PREFIX

#define ENV_MOD_PREFIX   0x80000000

Definition at line 6675 of file action.c.

◆ REG_PROGRESS_VALUE

#define REG_PROGRESS_VALUE   13200

Definition at line 44 of file action.c.

Enumeration Type Documentation

◆ join_op

Enumerator
JOIN_OP_APPEND 
JOIN_OP_PREPEND 
JOIN_OP_REPLACE 

Definition at line 2607 of file action.c.

2608{
2612};
@ JOIN_OP_PREPEND
Definition: action.c:2610
@ JOIN_OP_APPEND
Definition: action.c:2609
@ JOIN_OP_REPLACE
Definition: action.c:2611

◆ parse_state

Enumerator
STATE_NONE 
STATE_OK 
STATE_MULTILINE 
STATE_DONE 
STATE_ROOT 
STATE_CONFIGURATION 
STATE_STARTUP 
STATE_UNKNOWN 
state_whitespace 
state_token 
state_quote 

Definition at line 102 of file action.c.

103{
107};
@ state_token
Definition: action.c:105
@ state_whitespace
Definition: action.c:104
@ state_quote
Definition: action.c:106

Function Documentation

◆ ACTION_AllocateRegistrySpace()

static UINT ACTION_AllocateRegistrySpace ( MSIPACKAGE package)
static

Definition at line 7187 of file action.c.

7188{
7189 MSIRECORD *uirow;
7190 int space = msi_get_property_int( package->db, L"AVAILABLEFREEREG", 0 );
7191
7192 TRACE("%p %d kilobytes\n", package, space);
7193
7194 uirow = MSI_CreateRecord( 1 );
7195 MSI_RecordSetInteger( uirow, 1, space );
7197 msiobj_release( &uirow->hdr );
7198
7199 return ERROR_SUCCESS;
7200}
#define ERROR_SUCCESS
Definition: deptool.c:10
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:241
@ INSTALLMESSAGE_ACTIONDATA
Definition: msi.h:103
UINT MSI_RecordSetInteger(MSIRECORD *, UINT, int) DECLSPEC_HIDDEN
Definition: record.c:280
INT MSI_ProcessMessage(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *) DECLSPEC_HIDDEN
Definition: package.c:1914
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
Definition: record.c:76
int msi_get_property_int(MSIDATABASE *package, LPCWSTR prop, int def) DECLSPEC_HIDDEN
Definition: package.c:2305
#define L(x)
Definition: ntvdm.h:50
#define TRACE(s)
Definition: solgame.cpp:4
MSIDATABASE * db
Definition: msipriv.h:394
MSIOBJECTHDR hdr
Definition: msipriv.h:151

◆ ACTION_BindImage()

static UINT ACTION_BindImage ( MSIPACKAGE package)
static

Definition at line 7420 of file action.c.

7421{
7422 MSIQUERY *view;
7423 UINT r;
7424
7425 r = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `BindImage`", &view );
7426 if (r == ERROR_SUCCESS)
7427 {
7429 msiobj_release( &view->hdr );
7430 }
7431 return ERROR_SUCCESS;
7432}
#define NULL
Definition: types.h:112
static UINT ITERATE_BindImage(MSIRECORD *rec, LPVOID param)
Definition: action.c:7382
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:163
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
unsigned int UINT
Definition: ndis.h:50

◆ ACTION_CostFinalize()

static UINT ACTION_CostFinalize ( MSIPACKAGE package)
static

Definition at line 2234 of file action.c.

2235{
2236 MSICOMPONENT *comp;
2237 MSIQUERY *view;
2238 WCHAR *level, *primary_key, *primary_folder;
2239 UINT rc;
2240
2241 TRACE("Building directory properties\n");
2242 msi_resolve_target_folder( package, L"TARGETDIR", TRUE );
2243
2244 TRACE("Evaluating component conditions\n");
2246 {
2247 if (MSI_EvaluateConditionW( package, comp->Condition ) == MSICONDITION_FALSE)
2248 {
2249 TRACE("Disabling component %s\n", debugstr_w(comp->Component));
2250 comp->Enabled = FALSE;
2251 }
2252 else
2253 comp->Enabled = TRUE;
2254 }
2255 get_client_counts( package );
2256
2257 /* read components states from the registry */
2260
2261 if (!process_overrides( package, msi_get_property_int( package->db, L"INSTALLLEVEL", 1 ) ))
2262 {
2263 TRACE("Evaluating feature conditions\n");
2264
2265 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Condition`", &view );
2266 if (rc == ERROR_SUCCESS)
2267 {
2269 msiobj_release( &view->hdr );
2270 if (rc != ERROR_SUCCESS)
2271 return rc;
2272 }
2273 }
2274
2275 TRACE("Calculating file cost\n");
2276 calculate_file_cost( package );
2277
2278 msi_set_property( package->db, L"CostingComplete", L"1", -1 );
2279 /* set default run level if not set */
2280 level = msi_dup_property( package->db, L"INSTALLLEVEL" );
2281 if (!level) msi_set_property( package->db, L"INSTALLLEVEL", L"1", -1 );
2282 msi_free(level);
2283
2284 if ((rc = MSI_SetFeatureStates( package ))) return rc;
2285
2286 if ((primary_key = msi_dup_property( package->db, L"PRIMARYFOLDER" )))
2287 {
2288 if ((primary_folder = msi_dup_property( package->db, primary_key )))
2289 {
2290 if (((primary_folder[0] >= 'A' && primary_folder[0] <= 'Z') ||
2291 (primary_folder[0] >= 'a' && primary_folder[0] <= 'z')) && primary_folder[1] == ':')
2292 {
2294 ULONGLONG required;
2295 WCHAR buf[21];
2296
2297 primary_folder[2] = 0;
2298 if (GetDiskFreeSpaceExW( primary_folder, &free, NULL, NULL ))
2299 {
2300#ifdef __REACTOS__
2301 swprintf(buf, ARRAY_SIZE(buf), L"%I64u", free.QuadPart / 512);
2302#else
2303 swprintf( buf, ARRAY_SIZE(buf), L"%lu", free.QuadPart / 512 );
2304#endif
2305 msi_set_property( package->db, L"PrimaryVolumeSpaceAvailable", buf, -1 );
2306 }
2307 required = get_volume_space_required( package );
2308#ifdef __REACTOS__
2309 swprintf( buf, ARRAY_SIZE(buf), L"%I64u", required / 512 );
2310#else
2311 swprintf( buf, ARRAY_SIZE(buf), L"%lu", required / 512 );
2312#endif
2313 msi_set_property( package->db, L"PrimaryVolumeSpaceRequired", buf, -1 );
2314
2315#ifdef __REACTOS__
2316 swprintf( buf, ARRAY_SIZE(buf), L"%I64u", (free.QuadPart - required) / 512 );
2317#else
2318 swprintf( buf, ARRAY_SIZE(buf), L"%lu", (free.QuadPart - required) / 512 );
2319#endif
2320 msi_set_property( package->db, L"PrimaryVolumeSpaceRemaining", buf, -1 );
2321 msi_set_property( package->db, L"PrimaryVolumePath", primary_folder, 2 );
2322 }
2323 msi_free( primary_folder );
2324 }
2325 msi_free( primary_key );
2326 }
2327
2328 /* FIXME: check volume disk space */
2329 msi_set_property( package->db, L"OutOfDiskSpace", L"0", -1 );
2330 msi_set_property( package->db, L"OutOfNoRbDiskSpace", L"0", -1 );
2331
2332 return ERROR_SUCCESS;
2333}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define free
Definition: debug_ros.c:5
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL WINAPI GetDiskFreeSpaceExW(IN LPCWSTR lpDirectoryName OPTIONAL, OUT PULARGE_INTEGER lpFreeBytesAvailableToCaller, OUT PULARGE_INTEGER lpTotalNumberOfBytes, OUT PULARGE_INTEGER lpTotalNumberOfFreeBytes)
Definition: disk.c:342
static void ACTION_GetComponentInstallStates(MSIPACKAGE *package)
Definition: action.c:1464
static UINT ITERATE_CostFinalizeConditions(MSIRECORD *row, LPVOID param)
Definition: action.c:1904
UINT MSI_SetFeatureStates(MSIPACKAGE *package)
Definition: action.c:1640
static void ACTION_GetFeatureInstallStates(MSIPACKAGE *package)
Definition: action.c:1492
static BOOL process_overrides(MSIPACKAGE *package, int level)
Definition: action.c:1569
static UINT calculate_file_cost(MSIPACKAGE *package)
Definition: action.c:2061
void msi_resolve_target_folder(MSIPACKAGE *package, const WCHAR *name, BOOL load_prop)
Definition: action.c:2178
static void get_client_counts(MSIPACKAGE *package)
Definition: action.c:1443
static ULONGLONG get_volume_space_required(MSIPACKAGE *package)
Definition: action.c:2222
#define swprintf
Definition: precomp.h:40
GLint level
Definition: gl.h:1546
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
uint32_t entry
Definition: isohybrid.c:63
#define debugstr_w
Definition: kernel32.h:32
UINT msi_set_property(MSIDATABASE *, const WCHAR *, const WCHAR *, int) DECLSPEC_HIDDEN
Definition: package.c:2100
static void msi_free(void *mem)
Definition: msipriv.h:1159
MSICONDITION MSI_EvaluateConditionW(MSIPACKAGE *, LPCWSTR) DECLSPEC_HIDDEN
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop) DECLSPEC_HIDDEN
Definition: package.c:2283
@ MSICONDITION_FALSE
Definition: msiquery.h:26
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
LPWSTR Component
Definition: msipriv.h:525
LPWSTR Condition
Definition: msipriv.h:529
struct list components
Definition: msipriv.h:401
uint64_t ULONGLONG
Definition: typedefs.h:67
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ ACTION_CostInitialize()

static UINT ACTION_CostInitialize ( MSIPACKAGE package)
static

Definition at line 1381 of file action.c.

1382{
1383 msi_set_property( package->db, L"CostingComplete", L"0", -1 );
1384 msi_set_property( package->db, L"ROOTDRIVE", L"C:\\", -1 );
1385
1386 load_all_folders( package );
1387 msi_load_all_components( package );
1388 msi_load_all_features( package );
1389 load_all_files( package );
1390 load_all_patches( package );
1391 mark_patched_components( package );
1392 load_all_media( package );
1393
1394 return ERROR_SUCCESS;
1395}
static void mark_patched_components(MSIPACKAGE *package)
Definition: action.c:1228
UINT msi_load_all_components(MSIPACKAGE *package)
Definition: action.c:809
static UINT load_all_files(MSIPACKAGE *package)
Definition: action.c:1097
static UINT load_all_media(MSIPACKAGE *package)
Definition: action.c:1127
UINT msi_load_all_features(MSIPACKAGE *package)
Definition: action.c:951
static UINT load_all_patches(MSIPACKAGE *package)
Definition: action.c:1193
static UINT load_all_folders(MSIPACKAGE *package)
Definition: action.c:1358

◆ ACTION_CreateFolders()

static UINT ACTION_CreateFolders ( MSIPACKAGE package)
static

Definition at line 683 of file action.c.

684{
685 MSIQUERY *view;
686 UINT rc;
687
688 if (package->script == SCRIPT_NONE)
689 return msi_schedule_action(package, SCRIPT_INSTALL, L"CreateFolders");
690
691 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `CreateFolder`", &view );
692 if (rc != ERROR_SUCCESS)
693 return ERROR_SUCCESS;
694
696 msiobj_release(&view->hdr);
697 return rc;
698}
static UINT ITERATE_CreateFolders(MSIRECORD *row, LPVOID param)
Definition: action.c:633
UINT msi_schedule_action(MSIPACKAGE *package, UINT script, const WCHAR *action)
Definition: custom.c:90
@ SCRIPT_INSTALL
Definition: msipriv.h:385
@ SCRIPT_NONE
Definition: msipriv.h:384
enum script script
Definition: msipriv.h:432

◆ ACTION_CreateShortcuts()

static UINT ACTION_CreateShortcuts ( MSIPACKAGE package)
static

Definition at line 3847 of file action.c.

3848{
3849 MSIQUERY *view;
3850 HRESULT res;
3851 UINT rc;
3852
3853 if (package->script == SCRIPT_NONE)
3854 return msi_schedule_action(package, SCRIPT_INSTALL, L"CreateShortcuts");
3855
3856 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `Shortcut`", &view);
3857 if (rc != ERROR_SUCCESS)
3858 return ERROR_SUCCESS;
3859
3860 res = CoInitialize( NULL );
3861
3863 msiobj_release(&view->hdr);
3864
3866 return rc;
3867}
static UINT ITERATE_CreateShortcuts(MSIRECORD *row, LPVOID param)
Definition: action.c:3731
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1964
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
GLuint res
Definition: glext.h:9613
#define SUCCEEDED(hr)
Definition: intsafe.h:50

◆ ACTION_DeleteServices()

static UINT ACTION_DeleteServices ( MSIPACKAGE package)
static

Definition at line 6218 of file action.c.

6219{
6220 MSIQUERY *view;
6221 UINT rc;
6222
6223 if (package->script == SCRIPT_NONE)
6224 return msi_schedule_action(package, SCRIPT_INSTALL, L"DeleteServices");
6225
6226 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `ServiceControl`", &view );
6227 if (rc != ERROR_SUCCESS)
6228 return ERROR_SUCCESS;
6229
6231 msiobj_release( &view->hdr );
6232 return rc;
6233}
static UINT ITERATE_DeleteService(MSIRECORD *rec, LPVOID param)
Definition: action.c:6152

◆ ACTION_DisableRollback()

static UINT ACTION_DisableRollback ( MSIPACKAGE package)
static

Definition at line 7202 of file action.c.

7203{
7204 TRACE("%p\n", package);
7205
7206 msi_set_property( package->db, L"RollbackDisabled", L"1", -1 );
7207 return ERROR_SUCCESS;
7208}

◆ ACTION_ExecuteAction()

static UINT ACTION_ExecuteAction ( MSIPACKAGE package)
static

Definition at line 5335 of file action.c.

5336{
5337 WCHAR *productname;
5338 WCHAR *action;
5339 WCHAR *info_template;
5340 MSIQUERY *view;
5341 MSIRECORD *uirow, *uirow_info;
5342 UINT rc;
5343
5344 /* Send COMMONDATA and INFO messages. */
5345 /* FIXME: when should these messages be sent? [see also MsiOpenPackage()] */
5346 uirow = MSI_CreateRecord(3);
5347 if (!uirow) return ERROR_OUTOFMEMORY;
5348 MSI_RecordSetStringW(uirow, 0, NULL);
5349 MSI_RecordSetInteger(uirow, 1, 0);
5350 MSI_RecordSetInteger(uirow, 2, package->num_langids ? package->langids[0] : 0);
5353 /* FIXME: send INSTALLMESSAGE_PROGRESS */
5355
5356 if (!(needs_ui_sequence(package) && ui_sequence_exists(package)))
5357 {
5358 uirow_info = MSI_CreateRecord(0);
5359 if (!uirow_info)
5360 {
5361 msiobj_release(&uirow->hdr);
5362 return ERROR_OUTOFMEMORY;
5363 }
5364 info_template = msi_get_error_message(package->db, MSIERR_INFO_LOGGINGSTART);
5365 MSI_RecordSetStringW(uirow_info, 0, info_template);
5366 msi_free(info_template);
5368 msiobj_release(&uirow_info->hdr);
5369 }
5370
5372
5373 productname = msi_dup_property(package->db, INSTALLPROPERTY_PRODUCTNAMEW);
5374 MSI_RecordSetInteger(uirow, 1, 1);
5375 MSI_RecordSetStringW(uirow, 2, productname);
5376 MSI_RecordSetStringW(uirow, 3, NULL);
5378 msiobj_release(&uirow->hdr);
5379
5381
5382 action = msi_dup_property(package->db, L"EXECUTEACTION");
5383 if (!action) action = msi_strdupW(L"INSTALL", ARRAY_SIZE(L"INSTALL") - 1);
5384
5385 /* Perform the action. Top-level actions trigger a sequence. */
5386 if (!wcscmp(action, L"INSTALL"))
5387 {
5388 /* Send ACTIONSTART/INFO and INSTALLSTART. */
5389 ui_actionstart(package, L"INSTALL", NULL, NULL);
5390 ui_actioninfo(package, L"INSTALL", TRUE, 0);
5391 uirow = MSI_CreateRecord(2);
5392 if (!uirow)
5393 {
5394 rc = ERROR_OUTOFMEMORY;
5395 goto end;
5396 }
5397 MSI_RecordSetStringW(uirow, 0, NULL);
5398 MSI_RecordSetStringW(uirow, 1, productname);
5399 MSI_RecordSetStringW(uirow, 2, package->ProductCode);
5401 msiobj_release(&uirow->hdr);
5402
5403 /* Perform the installation. Always use the ExecuteSequence. */
5404 package->InWhatSequence |= SEQUENCE_EXEC;
5405 rc = ACTION_ProcessExecSequence(package);
5406
5407 /* Send return value and INSTALLEND. */
5408 ui_actioninfo(package, L"INSTALL", FALSE, !rc);
5409 uirow = MSI_CreateRecord(3);
5410 if (!uirow)
5411 {
5412 rc = ERROR_OUTOFMEMORY;
5413 goto end;
5414 }
5415 MSI_RecordSetStringW(uirow, 0, NULL);
5416 MSI_RecordSetStringW(uirow, 1, productname);
5417 MSI_RecordSetStringW(uirow, 2, package->ProductCode);
5418 MSI_RecordSetInteger(uirow, 3, !rc);
5420 msiobj_release(&uirow->hdr);
5421 }
5422 else
5423 rc = ACTION_PerformAction(package, action);
5424
5425 /* Send all set properties. */
5426 if (!MSI_OpenQuery(package->db, &view, L"SELECT * FROM `_Property`"))
5427 {
5429 msiobj_release(&view->hdr);
5430 }
5431
5432 /* And finally, toggle the cancel off and on. */
5433 uirow = MSI_CreateRecord(2);
5434 if (!uirow)
5435 {
5436 rc = ERROR_OUTOFMEMORY;
5437 goto end;
5438 }
5439 MSI_RecordSetStringW(uirow, 0, NULL);
5440 MSI_RecordSetInteger(uirow, 1, 2);
5441 MSI_RecordSetInteger(uirow, 2, 0);
5443 MSI_RecordSetInteger(uirow, 2, 1);
5445 msiobj_release(&uirow->hdr);
5446
5447end:
5448 msi_free(productname);
5450 return rc;
5451}
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
const WCHAR * action
Definition: action.c:7479
static UINT ACTION_ProcessExecSequence(MSIPACKAGE *package)
Definition: action.c:468
static BOOL needs_ui_sequence(MSIPACKAGE *package)
Definition: action.c:391
static void ui_actioninfo(MSIPACKAGE *package, LPCWSTR action, BOOL start, INT rc)
Definition: action.c:79
static BOOL ui_sequence_exists(MSIPACKAGE *package)
Definition: action.c:341
UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action)
Definition: action.c:7610
static UINT iterate_properties(MSIRECORD *record, void *param)
Definition: action.c:5321
static INT ui_actionstart(MSIPACKAGE *package, LPCWSTR action, LPCWSTR description, LPCWSTR template)
Definition: action.c:56
#define MSIERR_INFO_LOGGINGSTART
Definition: resource.h:24
GLuint GLuint end
Definition: gl.h:1545
static const WCHAR INSTALLPROPERTY_PRODUCTNAMEW[]
Definition: msi.h:277
@ INSTALLMESSAGE_COMMONDATA
Definition: msi.h:105
@ INSTALLMESSAGE_INFO
Definition: msi.h:98
@ INSTALLMESSAGE_INSTALLSTART
Definition: msi.h:110
@ INSTALLMESSAGE_INSTALLEND
Definition: msi.h:111
WCHAR * msi_strdupW(const WCHAR *value, int len) DECLSPEC_HIDDEN
Definition: record.c:155
UINT msi_get_string_table_codepage(const string_table *st) DECLSPEC_HIDDEN
Definition: string.c:671
INT MSI_ProcessMessageVerbatim(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *) DECLSPEC_HIDDEN
Definition: package.c:1848
UINT WINAPIV MSI_OpenQuery(MSIDATABASE *, MSIQUERY **, LPCWSTR,...) DECLSPEC_HIDDEN
Definition: msiquery.c:138
#define SEQUENCE_EXEC
Definition: msipriv.h:719
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
Definition: record.c:597
WCHAR * msi_get_error_message(MSIDATABASE *, int) DECLSPEC_HIDDEN
Definition: package.c:1823
#define MSI_NULL_INTEGER
Definition: msiquery.h:32
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
string_table * strings
Definition: msipriv.h:110
UINT InWhatSequence
Definition: msipriv.h:438
UINT num_langids
Definition: msipriv.h:397
LPWSTR ProductCode
Definition: msipriv.h:448
LANGID * langids
Definition: msipriv.h:398
UINT LastActionResult
Definition: msipriv.h:412
#define MB_ICONHAND
Definition: winuser.h:791

Referenced by ACTION_INSTALL().

◆ ACTION_FileCost()

static UINT ACTION_FileCost ( MSIPACKAGE package)
static

Definition at line 1438 of file action.c.

1439{
1440 return ERROR_SUCCESS;
1441}

◆ ACTION_ForceReboot()

UINT ACTION_ForceReboot ( MSIPACKAGE package)

Definition at line 5183 of file action.c.

5184{
5185 WCHAR buffer[256], sysdir[MAX_PATH], squashed_pc[SQUASHED_GUID_SIZE];
5186 HKEY hkey;
5187
5188 squash_guid( package->ProductCode, squashed_pc );
5189
5190 GetSystemDirectoryW(sysdir, ARRAY_SIZE(sysdir));
5191 RegCreateKeyW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce", &hkey);
5192 swprintf(buffer, ARRAY_SIZE(buffer), L"%s\\MsiExec.exe /@ \"%s\"", sysdir, squashed_pc);
5193
5194 msi_reg_set_val_str( hkey, squashed_pc, buffer );
5195 RegCloseKey(hkey);
5196
5197 TRACE("Reboot command %s\n",debugstr_w(buffer));
5198
5199 RegCreateKeyW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\RunOnceEntries",
5200 &hkey);
5201 swprintf( buffer, ARRAY_SIZE(buffer), L"/I \"%s\" AFTERREBOOT=1 RUNONCEENTRY=\"%s\"", package->ProductCode,
5202 squashed_pc );
5203
5204 msi_reg_set_val_str( hkey, squashed_pc, buffer );
5205 RegCloseKey(hkey);
5206
5207 return ERROR_INSTALL_SUSPEND;
5208}
#define RegCloseKey(hKey)
Definition: registry.h:49
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1201
#define MAX_PATH
Definition: compat.h:34
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2313
GLuint buffer
Definition: glext.h:5915
BOOL squash_guid(LPCWSTR in, LPWSTR out) DECLSPEC_HIDDEN
Definition: registry.c:74
LONG msi_reg_set_val_str(HKEY hkey, LPCWSTR name, LPCWSTR value) DECLSPEC_HIDDEN
Definition: registry.c:209
#define SQUASHED_GUID_SIZE
Definition: msipriv.h:734
#define ERROR_INSTALL_SUSPEND
Definition: winerror.h:962
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by custom_get_thread_return(), and ITERATE_Actions().

◆ ACTION_GetComponentInstallStates()

static void ACTION_GetComponentInstallStates ( MSIPACKAGE package)
static

Definition at line 1464 of file action.c.

1465{
1466 MSICOMPONENT *comp;
1467 UINT r;
1468
1470 {
1471 if (!comp->ComponentId) continue;
1472
1475 &comp->Installed );
1476 if (r == ERROR_SUCCESS) continue;
1477
1480 &comp->Installed );
1481 if (r == ERROR_SUCCESS) continue;
1482
1485 &comp->Installed );
1486 if (r == ERROR_SUCCESS) continue;
1487
1489 }
1490}
UINT WINAPI MsiQueryComponentStateW(LPCWSTR szProductCode, LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, LPCWSTR szComponent, INSTALLSTATE *pdwState)
Definition: msi.c:2143
@ INSTALLSTATE_ABSENT
Definition: msi.h:45
@ MSIINSTALLCONTEXT_MACHINE
Definition: msi.h:200
@ MSIINSTALLCONTEXT_USERUNMANAGED
Definition: msi.h:199
@ MSIINSTALLCONTEXT_USERMANAGED
Definition: msi.h:198
LPWSTR ComponentId
Definition: msipriv.h:526
INSTALLSTATE Installed
Definition: msipriv.h:531

Referenced by ACTION_CostFinalize().

◆ ACTION_GetFeatureInstallStates()

static void ACTION_GetFeatureInstallStates ( MSIPACKAGE package)
static

Definition at line 1492 of file action.c.

1493{
1495
1497 {
1499
1501 feature->Installed = INSTALLSTATE_ABSENT;
1502 else
1503 feature->Installed = state;
1504 }
1505}
static int state
Definition: maze.c:121
INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
Definition: msi.c:3068
INTERNETFEATURELIST feature
Definition: misc.c:1719
@ INSTALLSTATE_UNKNOWN
Definition: msi.h:42
@ INSTALLSTATE_INVALIDARG
Definition: msi.h:41
struct list features
Definition: msipriv.h:402
int INSTALLSTATE
Definition: winemsi.idl:31

Referenced by ACTION_CostFinalize().

◆ ACTION_HandleCustomAction()

static UINT ACTION_HandleCustomAction ( MSIPACKAGE package,
LPCWSTR  action 
)
static

Definition at line 514 of file action.c.

515{
516 UINT arc;
517 INT uirc;
518
519 uirc = ui_actionstart(package, action, NULL, NULL);
520 if (uirc == IDCANCEL)
522 ui_actioninfo(package, action, TRUE, 0);
523 arc = ACTION_CustomAction(package, action);
524 uirc = !arc;
525
526 if (arc == ERROR_FUNCTION_NOT_CALLED && needs_ui_sequence(package))
527 {
528 uirc = ACTION_ShowDialog(package, action);
529 switch (uirc)
530 {
531 case -1:
532 return ERROR_SUCCESS; /* stop immediately */
533 case 0: arc = ERROR_FUNCTION_NOT_CALLED; break;
534 case 1: arc = ERROR_SUCCESS; break;
535 case 2: arc = ERROR_INSTALL_USEREXIT; break;
536 case 3: arc = ERROR_INSTALL_FAILURE; break;
537 case 4: arc = ERROR_INSTALL_SUSPEND; break;
538 case 5: arc = ERROR_MORE_DATA; break;
539 case 6: arc = ERROR_INVALID_HANDLE_STATE; break;
540 case 7: arc = ERROR_INVALID_DATA; break;
541 case 8: arc = ERROR_INSTALL_ALREADY_RUNNING; break;
542 case 9: arc = ERROR_INSTALL_PACKAGE_REJECTED; break;
543 default: arc = ERROR_FUNCTION_FAILED; break;
544 }
545 }
546
547 ui_actioninfo(package, action, FALSE, uirc);
548
549 return arc;
550}
#define ERROR_MORE_DATA
Definition: dderror.h:13
UINT ACTION_CustomAction(MSIPACKAGE *package, const WCHAR *action)
Definition: custom.c:1482
INT ACTION_ShowDialog(MSIPACKAGE *package, const WCHAR *dialog)
Definition: dialog.c:4540
int32_t INT
Definition: typedefs.h:58
#define ERROR_INSTALL_FAILURE
Definition: winerror.h:961
#define ERROR_INSTALL_USEREXIT
Definition: winerror.h:960
#define ERROR_INVALID_HANDLE_STATE
Definition: winerror.h:967
#define ERROR_INSTALL_PACKAGE_REJECTED
Definition: winerror.h:983
#define ERROR_INSTALL_ALREADY_RUNNING
Definition: winerror.h:976
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
#define ERROR_FUNCTION_NOT_CALLED
Definition: winerror.h:984
#define ERROR_INVALID_DATA
Definition: winerror.h:116
#define IDCANCEL
Definition: winuser.h:834

Referenced by ACTION_PerformAction().

◆ ACTION_HandleStandardAction()

static UINT ACTION_HandleStandardAction ( MSIPACKAGE package,
LPCWSTR  action 
)
static

Definition at line 7567 of file action.c.

7568{
7570 UINT i;
7571
7572 i = 0;
7573 while (StandardActions[i].action != NULL)
7574 {
7576 {
7577 WCHAR description[100] = {0}, template[100] = {0};
7578
7579 if (StandardActions[i].description != 0)
7581 if (StandardActions[i].template != 0)
7582 LoadStringW(msi_hInstance, StandardActions[i].template, (LPWSTR)&template, 100);
7583
7584 ui_actionstart(package, action, description, template);
7586 {
7587 ui_actioninfo( package, action, TRUE, 0 );
7588 rc = StandardActions[i].handler( package );
7589 ui_actioninfo( package, action, FALSE, !rc );
7590
7592 {
7593 TRACE("scheduling rollback action\n");
7595 }
7596 }
7597 else
7598 {
7599 FIXME("unhandled standard action %s\n", debugstr_w(action));
7600 rc = ERROR_SUCCESS;
7601 }
7602 break;
7603 }
7604 i++;
7605 }
7606
7607 return rc;
7608}
#define FIXME(fmt,...)
Definition: precomp.h:53
const UINT description
Definition: action.c:7480
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7482
static const struct @498 StandardActions[]
const WCHAR * action_rollback
Definition: action.c:7483
HINSTANCE msi_hInstance
Definition: msi_main.c:51
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
@ SCRIPT_ROLLBACK
Definition: msipriv.h:387
unsigned char need_rollback
Definition: msipriv.h:471
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by ACTION_PerformAction().

◆ ACTION_INSTALL()

static UINT ACTION_INSTALL ( MSIPACKAGE package)
static

Definition at line 5453 of file action.c.

5454{
5455 msi_set_property(package->db, L"EXECUTEACTION", L"INSTALL", -1);
5456 if (needs_ui_sequence(package) && ui_sequence_exists(package))
5457 {
5458 package->InWhatSequence |= SEQUENCE_UI;
5459 return ACTION_ProcessUISequence(package);
5460 }
5461 else
5462 return ACTION_ExecuteAction(package);
5463}
static UINT ACTION_ProcessUISequence(MSIPACKAGE *package)
Definition: action.c:494
static UINT ACTION_ExecuteAction(MSIPACKAGE *package)
Definition: action.c:5335
#define SEQUENCE_UI
Definition: msipriv.h:718

◆ ACTION_InstallAdminPackage()

static UINT ACTION_InstallAdminPackage ( MSIPACKAGE package)
static

Definition at line 7210 of file action.c.

7211{
7212 FIXME("%p\n", package);
7213 return ERROR_SUCCESS;
7214}

◆ ACTION_InstallExecute()

static UINT ACTION_InstallExecute ( MSIPACKAGE package)
static

Definition at line 5037 of file action.c.

5038{
5039 return execute_script(package, SCRIPT_INSTALL);
5040}
static UINT execute_script(MSIPACKAGE *package, UINT script)
Definition: action.c:1397

◆ ACTION_InstallFinalize()

static UINT ACTION_InstallFinalize ( MSIPACKAGE package)
static

Definition at line 5163 of file action.c.

5164{
5165 UINT rc;
5166
5167 /* first do the same as an InstallExecute */
5168 rc = execute_script(package, SCRIPT_INSTALL);
5169 if (rc != ERROR_SUCCESS)
5170 return rc;
5171
5172 /* then handle commit actions */
5173 rc = execute_script(package, SCRIPT_COMMIT);
5174 if (rc != ERROR_SUCCESS)
5175 return rc;
5176
5177 if (is_full_uninstall(package))
5178 rc = ACTION_UnpublishProduct(package);
5179
5180 return rc;
5181}
static BOOL is_full_uninstall(MSIPACKAGE *package)
Definition: action.c:5149
static UINT ACTION_UnpublishProduct(MSIPACKAGE *package)
Definition: action.c:5117
@ SCRIPT_COMMIT
Definition: msipriv.h:386

◆ ACTION_InstallInitialize()

static UINT ACTION_InstallInitialize ( MSIPACKAGE package)
static

Definition at line 3062 of file action.c.

3063{
3064 return ERROR_SUCCESS;
3065}

◆ ACTION_InstallODBC()

static UINT ACTION_InstallODBC ( MSIPACKAGE package)
static

Definition at line 6464 of file action.c.

6465{
6466 MSIQUERY *view;
6467 UINT rc;
6468
6469 if (package->script == SCRIPT_NONE)
6470 return msi_schedule_action(package, SCRIPT_INSTALL, L"InstallODBC");
6471
6472 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `ODBCDriver`", &view);
6473 if (rc == ERROR_SUCCESS)
6474 {
6476 msiobj_release(&view->hdr);
6477 if (rc != ERROR_SUCCESS)
6478 return rc;
6479 }
6480 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `ODBCTranslator`", &view);
6481 if (rc == ERROR_SUCCESS)
6482 {
6484 msiobj_release(&view->hdr);
6485 if (rc != ERROR_SUCCESS)
6486 return rc;
6487 }
6488 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `ODBCDataSource`", &view);
6489 if (rc == ERROR_SUCCESS)
6490 {
6492 msiobj_release(&view->hdr);
6493 if (rc != ERROR_SUCCESS)
6494 return rc;
6495 }
6496 return ERROR_SUCCESS;
6497}
static UINT ITERATE_InstallODBCTranslator(MSIRECORD *rec, LPVOID param)
Definition: action.c:6327
static UINT ITERATE_InstallODBCDriver(MSIRECORD *rec, LPVOID param)
Definition: action.c:6235
static UINT ITERATE_InstallODBCDataSource(MSIRECORD *rec, LPVOID param)
Definition: action.c:6410

◆ ACTION_InstallServices()

static UINT ACTION_InstallServices ( MSIPACKAGE package)
static

Definition at line 5807 of file action.c.

5808{
5809 MSIQUERY *view;
5810 UINT rc;
5811
5812 if (package->script == SCRIPT_NONE)
5813 return msi_schedule_action(package, SCRIPT_INSTALL, L"InstallServices");
5814
5815 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `ServiceInstall`", &view);
5816 if (rc != ERROR_SUCCESS)
5817 return ERROR_SUCCESS;
5818
5820 msiobj_release(&view->hdr);
5821 return rc;
5822}
static UINT ITERATE_InstallService(MSIRECORD *rec, LPVOID param)
Definition: action.c:5680

◆ ACTION_InstallSFPCatalogFile()

static UINT ACTION_InstallSFPCatalogFile ( MSIPACKAGE package)
static

Definition at line 7472 of file action.c.

7473{
7474 return msi_unimplemented_action_stub( package, "InstallSFPCatalogFile", L"SFPCatalog" );
7475}
static UINT msi_unimplemented_action_stub(MSIPACKAGE *package, LPCSTR action, LPCWSTR table)
Definition: action.c:7434

◆ ACTION_InstallValidate()

static UINT ACTION_InstallValidate ( MSIPACKAGE package)
static

Definition at line 3068 of file action.c.

3069{
3070 MSICOMPONENT *comp;
3071 DWORD total = 0, count = 0;
3072 MSIQUERY *view;
3074 MSIFILE *file;
3075 UINT rc;
3076
3077 TRACE("InstallValidate\n");
3078
3079 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Registry`", &view );
3080 if (rc == ERROR_SUCCESS)
3081 {
3082 rc = MSI_IterateRecords( view, &count, NULL, package );
3083 msiobj_release( &view->hdr );
3084 if (rc != ERROR_SUCCESS)
3085 return rc;
3087 }
3090
3092 total += file->FileSize;
3093
3094 msi_ui_progress( package, 0, total, 0, 0 );
3095
3097 {
3098 TRACE("Feature: %s Installed %d Request %d Action %d\n",
3099 debugstr_w(feature->Feature), feature->Installed,
3100 feature->ActionRequest, feature->Action);
3101 }
3102 return ERROR_SUCCESS;
3103}
#define REG_PROGRESS_VALUE
Definition: action.c:44
void msi_ui_progress(MSIPACKAGE *package, int a, int b, int c, int d)
Definition: action.c:596
#define COMPONENT_PROGRESS_VALUE
Definition: action.c:45
unsigned long DWORD
Definition: ntddk_ex.h:95
size_t total
GLuint GLuint GLsizei count
Definition: gl.h:1545
Definition: fci.c:127
struct list files
Definition: msipriv.h:403

◆ ACTION_IsolateComponents()

static UINT ACTION_IsolateComponents ( MSIPACKAGE package)
static

Definition at line 7452 of file action.c.

7453{
7454 return msi_unimplemented_action_stub( package, "IsolateComponents", L"IsolateComponent" );
7455}

◆ ACTION_LaunchConditions()

static UINT ACTION_LaunchConditions ( MSIPACKAGE package)
static

Definition at line 3130 of file action.c.

3131{
3132 MSIQUERY *view;
3133 UINT rc;
3134
3135 TRACE("Checking launch conditions\n");
3136
3137 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `LaunchCondition`", &view);
3138 if (rc != ERROR_SUCCESS)
3139 return ERROR_SUCCESS;
3140
3142 msiobj_release(&view->hdr);
3143 return rc;
3144}
static UINT ITERATE_LaunchConditions(MSIRECORD *row, LPVOID param)
Definition: action.c:3105

◆ ACTION_MigrateFeatureStates()

static UINT ACTION_MigrateFeatureStates ( MSIPACKAGE package)
static

Definition at line 7339 of file action.c.

7340{
7341 MSIQUERY *view;
7342 UINT r;
7343
7344 if (msi_get_property_int( package->db, L"Installed", 0 ))
7345 {
7346 TRACE("product is installed, skipping action\n");
7347 return ERROR_SUCCESS;
7348 }
7349 if (msi_get_property_int( package->db, L"Preselected", 0 ))
7350 {
7351 TRACE("Preselected property is set, not migrating feature states\n");
7352 return ERROR_SUCCESS;
7353 }
7354 r = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Upgrade`", &view );
7355 if (r == ERROR_SUCCESS)
7356 {
7358 msiobj_release( &view->hdr );
7359 if (r != ERROR_SUCCESS)
7360 return r;
7361 }
7362 return ERROR_SUCCESS;
7363}
static UINT ITERATE_MigrateFeatureStates(MSIRECORD *rec, LPVOID param)
Definition: action.c:7304

◆ ACTION_PerformAction()

UINT ACTION_PerformAction ( MSIPACKAGE package,
const WCHAR action 
)

Definition at line 7610 of file action.c.

7611{
7612 UINT rc;
7613
7614 TRACE("Performing action (%s)\n", debugstr_w(action));
7615
7616 package->action_progress_increment = 0;
7617 rc = ACTION_HandleStandardAction(package, action);
7618
7619 if (rc == ERROR_FUNCTION_NOT_CALLED)
7620 rc = ACTION_HandleCustomAction(package, action);
7621
7622 if (rc == ERROR_FUNCTION_NOT_CALLED)
7623 WARN("unhandled msi action %s\n", debugstr_w(action));
7624
7625 return rc;
7626}
#define WARN(fmt,...)
Definition: precomp.h:61
static UINT ACTION_HandleStandardAction(MSIPACKAGE *package, LPCWSTR action)
Definition: action.c:7567
static UINT ACTION_HandleCustomAction(MSIPACKAGE *package, LPCWSTR action)
Definition: action.c:514
UINT action_progress_increment
Definition: msipriv.h:413

Referenced by ACTION_ExecuteAction(), ACTION_PerformActionSequence(), event_do_action(), execute_script(), ITERATE_Actions(), MSI_InstallPackage(), MsiCollectUserInfoA(), MsiCollectUserInfoW(), MsiConfigureFeatureW(), and MsiDoActionW().

◆ ACTION_PerformActionSequence()

static UINT ACTION_PerformActionSequence ( MSIPACKAGE package,
UINT  seq 
)
static

Definition at line 7628 of file action.c.

7629{
7630 UINT rc = ERROR_SUCCESS;
7631 MSIRECORD *row;
7632
7633 if (needs_ui_sequence(package))
7634 row = MSI_QueryGetRecord(package->db, L"SELECT * FROM `InstallUISequence` WHERE `Sequence` = %d", seq);
7635 else
7636 row = MSI_QueryGetRecord(package->db, L"SELECT * FROM `InstallExecuteSequence` WHERE `Sequence` = %d", seq);
7637
7638 if (row)
7639 {
7640 LPCWSTR action, cond;
7641
7642 TRACE("Running the actions\n");
7643
7644 /* check conditions */
7645 cond = MSI_RecordGetString(row, 2);
7646
7647 /* this is a hack to skip errors in the condition code */
7648 if (MSI_EvaluateConditionW(package, cond) == MSICONDITION_FALSE)
7649 {
7650 msiobj_release(&row->hdr);
7651 return ERROR_SUCCESS;
7652 }
7653
7655 if (!action)
7656 {
7657 ERR("failed to fetch action\n");
7658 msiobj_release(&row->hdr);
7659 return ERROR_FUNCTION_FAILED;
7660 }
7661
7662 rc = ACTION_PerformAction(package, action);
7663
7664 msiobj_release(&row->hdr);
7665 }
7666
7667 return rc;
7668}
#define ERR(fmt,...)
Definition: precomp.h:57
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78
MSIRECORD *WINAPIV MSI_QueryGetRecord(MSIDATABASE *db, LPCWSTR query,...) DECLSPEC_HIDDEN
Definition: msiquery.c:201
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:433
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by MSI_InstallPackage().

◆ ACTION_ProcessComponents()

static UINT ACTION_ProcessComponents ( MSIPACKAGE package)
static

Definition at line 3313 of file action.c.

3314{
3315 WCHAR squashed_pc[SQUASHED_GUID_SIZE], squashed_cc[SQUASHED_GUID_SIZE];
3316 UINT rc;
3317 MSICOMPONENT *comp;
3318 HKEY hkey;
3319
3320 TRACE("\n");
3321
3323
3324 if (package->script == SCRIPT_NONE)
3325 return msi_schedule_action(package, SCRIPT_INSTALL, L"ProcessComponents");
3326
3327 squash_guid( package->ProductCode, squashed_pc );
3328
3330 {
3331 MSIRECORD *uirow;
3333
3334 msi_ui_progress( package, 2, COMPONENT_PROGRESS_VALUE, 0, 0 );
3335 if (!comp->ComponentId)
3336 continue;
3337
3338 squash_guid( comp->ComponentId, squashed_cc );
3339 msi_free( comp->FullKeypath );
3340 comp->FullKeypath = build_full_keypath( package, comp );
3341
3342 refcount_component( package, comp );
3343
3344 if (package->need_rollback) action = comp->Installed;
3345 else action = comp->ActionRequest;
3346
3347 TRACE("Component %s (%s) Keypath=%s RefCount=%u Clients=%u Action=%u\n",
3348 debugstr_w(comp->Component), debugstr_w(squashed_cc),
3349 debugstr_w(comp->FullKeypath), comp->RefCount, comp->num_clients, action);
3350
3352 {
3353 if (package->Context == MSIINSTALLCONTEXT_MACHINE)
3354 rc = MSIREG_OpenUserDataComponentKey(comp->ComponentId, L"S-1-5-18", &hkey, TRUE);
3355 else
3357
3358 if (rc != ERROR_SUCCESS)
3359 continue;
3360
3362 {
3363 msi_reg_set_val_str(hkey, L"00000000000000000000000000000000", comp->FullKeypath);
3364 }
3366 msi_reg_set_val_str( hkey, squashed_pc, comp->FullKeypath );
3367 else
3368 {
3369 MSIFILE *file;
3370 MSIRECORD *row;
3371 LPWSTR ptr, ptr2;
3374 LPWSTR sourcepath;
3375
3376 if (!comp->KeyPath || !(file = msi_get_loaded_file(package, comp->KeyPath)))
3377 continue;
3378
3379 if (!(row = MSI_QueryGetRecord(package->db, L"SELECT * FROM `Media` WHERE `LastSequence` >= %d "
3380 L"ORDER BY `DiskId`", file->Sequence)))
3381 return ERROR_FUNCTION_FAILED;
3382
3384 ptr2 = wcsrchr(source, '\\') + 1;
3385 msiobj_release(&row->hdr);
3386
3387 lstrcpyW(base, package->PackagePath);
3388 ptr = wcsrchr(base, '\\');
3389 *(ptr + 1) = '\0';
3390
3391 sourcepath = msi_resolve_file_source(package, file);
3392 ptr = sourcepath + lstrlenW(base);
3393 lstrcpyW(ptr2, ptr);
3394 msi_free(sourcepath);
3395
3396 msi_reg_set_val_str( hkey, squashed_pc, source );
3397 }
3398 RegCloseKey(hkey);
3399 }
3400 else if (action == INSTALLSTATE_ABSENT)
3401 {
3402 if (comp->num_clients <= 0)
3403 {
3404 if (package->Context == MSIINSTALLCONTEXT_MACHINE)
3405 rc = MSIREG_DeleteUserDataComponentKey( comp->ComponentId, L"S-1-5-18" );
3406 else
3408
3409 if (rc != ERROR_SUCCESS) WARN( "failed to delete component key %u\n", rc );
3410 }
3411 else
3412 {
3413 LONG res;
3414
3415 if (package->Context == MSIINSTALLCONTEXT_MACHINE)
3416 rc = MSIREG_OpenUserDataComponentKey( comp->ComponentId, L"S-1-5-18", &hkey, FALSE );
3417 else
3419
3420 if (rc != ERROR_SUCCESS)
3421 {
3422 WARN( "failed to open component key %u\n", rc );
3423 continue;
3424 }
3425 res = RegDeleteValueW( hkey, squashed_pc );
3426 RegCloseKey(hkey);
3427 if (res) WARN( "failed to delete component value %ld\n", res );
3428 }
3429 }
3430
3431 /* UI stuff */
3432 uirow = MSI_CreateRecord(3);
3433 MSI_RecordSetStringW(uirow,1,package->ProductCode);
3434 MSI_RecordSetStringW(uirow,2,comp->ComponentId);
3435 MSI_RecordSetStringW(uirow,3,comp->FullKeypath);
3437 msiobj_release( &uirow->hdr );
3438 }
3439 return ERROR_SUCCESS;
3440}
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
Definition: reg.c:2330
#define wcsrchr
Definition: compat.h:16
#define lstrcpyW
Definition: compat.h:749
#define lstrlenW
Definition: compat.h:750
static void refcount_component(MSIPACKAGE *package, MSICOMPONENT *comp)
Definition: action.c:3226
UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace)
Definition: action.c:354
static WCHAR * build_full_keypath(MSIPACKAGE *package, MSICOMPONENT *comp)
Definition: action.c:3296
MSIFILE * msi_get_loaded_file(MSIPACKAGE *package, const WCHAR *key)
Definition: action.c:574
WCHAR * msi_resolve_file_source(MSIPACKAGE *package, MSIFILE *file)
Definition: files.c:528
static PVOID ptr
Definition: dispmode.c:27
@ INSTALLSTATE_LOCAL
Definition: msi.h:46
@ INSTALLSTATE_SOURCE
Definition: msi.h:47
@ msidbComponentAttributesPermanent
Definition: msidefs.h:164
UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:526
int MSI_RecordGetInteger(MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:213
UINT MSIREG_DeleteUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid) DECLSPEC_HIDDEN
Definition: registry.c:552
long LONG
Definition: pedump.c:60
INSTALLSTATE ActionRequest
Definition: msipriv.h:532
LPWSTR KeyPath
Definition: msipriv.h:530
LPWSTR FullKeypath
Definition: msipriv.h:538
LPWSTR PackagePath
Definition: msipriv.h:447
UINT Context
Definition: msipriv.h:459

◆ ACTION_ProcessExecSequence()

static UINT ACTION_ProcessExecSequence ( MSIPACKAGE package)
static

Definition at line 468 of file action.c.

469{
470 MSIQUERY *view;
471 UINT rc;
472
473 if (package->ExecuteSequenceRun)
474 {
475 TRACE("Execute Sequence already Run\n");
476 return ERROR_SUCCESS;
477 }
478
479 package->ExecuteSequenceRun = TRUE;
480
481 rc = MSI_OpenQuery(package->db, &view,
482 L"SELECT * FROM `InstallExecuteSequence` WHERE `Sequence` > 0 ORDER BY `Sequence`");
483 if (rc == ERROR_SUCCESS)
484 {
485 TRACE("Running the actions\n");
486
487 msi_set_property( package->db, L"SourceDir", NULL, -1 );
489 msiobj_release(&view->hdr);
490 }
491 return rc;
492}
static UINT ITERATE_Actions(MSIRECORD *row, LPVOID param)
Definition: action.c:410
BOOL ExecuteSequenceRun
Definition: msipriv.h:437

Referenced by ACTION_ExecuteAction().

◆ ACTION_ProcessUISequence()

static UINT ACTION_ProcessUISequence ( MSIPACKAGE package)
static

Definition at line 494 of file action.c.

495{
496 MSIQUERY *view;
497 UINT rc;
498
499 rc = MSI_DatabaseOpenViewW(package->db,
500 L"SELECT * FROM `InstallUISequence` WHERE `Sequence` > 0 ORDER BY `Sequence`",
501 &view);
502 if (rc == ERROR_SUCCESS)
503 {
504 TRACE("Running the actions\n");
506 msiobj_release(&view->hdr);
507 }
508 return rc;
509}

Referenced by ACTION_INSTALL().

◆ ACTION_PublishComponents()

static UINT ACTION_PublishComponents ( MSIPACKAGE package)
static

Definition at line 5597 of file action.c.

5598{
5599 MSIQUERY *view;
5600 UINT rc;
5601
5602 if (package->script == SCRIPT_NONE)
5603 return msi_schedule_action(package, SCRIPT_INSTALL, L"PublishComponents");
5604
5605 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `PublishComponent`", &view);
5606 if (rc != ERROR_SUCCESS)
5607 return ERROR_SUCCESS;
5608
5610 msiobj_release(&view->hdr);
5611 return rc;
5612}
static UINT ITERATE_PublishComponent(MSIRECORD *rec, LPVOID param)
Definition: action.c:5493

◆ ACTION_PublishFeatures()

static UINT ACTION_PublishFeatures ( MSIPACKAGE package)
static

Definition at line 4731 of file action.c.

4732{
4734 UINT rc;
4735 HKEY hkey = NULL, userdata = NULL;
4736
4737 if (package->script == SCRIPT_NONE)
4738 return msi_schedule_action(package, SCRIPT_INSTALL, L"PublishFeatures");
4739
4740 if (!msi_check_publish(package))
4741 return ERROR_SUCCESS;
4742
4743 rc = MSIREG_OpenFeaturesKey(package->ProductCode, NULL, package->Context,
4744 &hkey, TRUE);
4745 if (rc != ERROR_SUCCESS)
4746 goto end;
4747
4748 rc = MSIREG_OpenUserDataFeaturesKey(package->ProductCode, NULL, package->Context,
4749 &userdata, TRUE);
4750 if (rc != ERROR_SUCCESS)
4751 goto end;
4752
4753 /* here the guids are base 85 encoded */
4755 {
4756 ComponentList *cl;
4757 LPWSTR data = NULL;
4758 GUID clsid;
4759 INT size;
4760 BOOL absent = FALSE;
4761 MSIRECORD *uirow;
4762
4763 if (feature->Level <= 0) continue;
4764 if (feature->Action == INSTALLSTATE_UNKNOWN &&
4765 feature->Installed != INSTALLSTATE_ABSENT) continue;
4766
4767 if (feature->Action != INSTALLSTATE_LOCAL &&
4768 feature->Action != INSTALLSTATE_SOURCE &&
4769 feature->Action != INSTALLSTATE_ADVERTISED) absent = TRUE;
4770
4771 size = 1;
4772 LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry )
4773 {
4774 size += 21;
4775 }
4776 if (feature->Feature_Parent)
4777 size += lstrlenW( feature->Feature_Parent )+2;
4778
4779 data = msi_alloc(size * sizeof(WCHAR));
4780
4781 data[0] = 0;
4782 LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry )
4783 {
4784 MSICOMPONENT* component = cl->component;
4785 WCHAR buf[21];
4786
4787 buf[0] = 0;
4788 if (component->ComponentId)
4789 {
4790 TRACE("From %s\n",debugstr_w(component->ComponentId));
4791 CLSIDFromString(component->ComponentId, &clsid);
4793 TRACE("to %s\n",debugstr_w(buf));
4794 lstrcatW(data,buf);
4795 }
4796 }
4797
4798 if (feature->Feature_Parent)
4799 {
4800 lstrcatW(data, L"\2");
4801 lstrcatW(data, feature->Feature_Parent);
4802 }
4803
4804 msi_reg_set_val_str( userdata, feature->Feature, data );
4805 msi_free(data);
4806
4807 size = 0;
4808 if (feature->Feature_Parent)
4809 size = lstrlenW(feature->Feature_Parent)*sizeof(WCHAR);
4810 if (!absent)
4811 {
4812 size += sizeof(WCHAR);
4813 RegSetValueExW(hkey, feature->Feature, 0 ,REG_SZ,
4814 (const BYTE*)(feature->Feature_Parent ? feature->Feature_Parent : L""), size);
4815 }
4816 else
4817 {
4818 size += 2*sizeof(WCHAR);
4819 data = msi_alloc(size);
4820 data[0] = 0x6;
4821 data[1] = 0;
4822 if (feature->Feature_Parent)
4823 lstrcpyW( &data[1], feature->Feature_Parent );
4824 RegSetValueExW(hkey,feature->Feature,0,REG_SZ,
4825 (LPBYTE)data,size);
4826 msi_free(data);
4827 }
4828
4829 /* the UI chunk */
4830 uirow = MSI_CreateRecord( 1 );
4831 MSI_RecordSetStringW( uirow, 1, feature->Feature );
4833 msiobj_release( &uirow->hdr );
4834 /* FIXME: call msi_ui_progress? */
4835 }
4836
4837end:
4838 RegCloseKey(hkey);
4839 RegCloseKey(userdata);
4840 return rc;
4841}
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
static BOOL msi_check_publish(MSIPACKAGE *package)
Definition: action.c:4107
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2338
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
#define REG_SZ
Definition: layer.c:22
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:274
REFCLSID clsid
Definition: msctf.c:82
@ INSTALLSTATE_ADVERTISED
Definition: msi.h:44
UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:472
UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:404
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1142
BOOL encode_base85_guid(GUID *, LPWSTR) DECLSPEC_HIDDEN
Definition: registry.c:165
MSICOMPONENT * component
Definition: msipriv.h:554
unsigned char * LPBYTE
Definition: typedefs.h:53
unsigned char BYTE
Definition: xxhash.c:193

◆ ACTION_PublishProduct()

static UINT ACTION_PublishProduct ( MSIPACKAGE package)
static

Definition at line 4237 of file action.c.

4238{
4239 UINT rc;
4240 HKEY hukey = NULL, hudkey = NULL;
4241 MSIRECORD *uirow;
4242 BOOL republish = FALSE;
4243
4244 if (package->script == SCRIPT_NONE)
4245 return msi_schedule_action(package, SCRIPT_INSTALL, L"PublishProduct");
4246
4247 if (!list_empty(&package->patches))
4248 {
4249 rc = msi_publish_patches(package);
4250 if (rc != ERROR_SUCCESS)
4251 goto end;
4252 }
4253
4254 rc = MSIREG_OpenProductKey(package->ProductCode, NULL, package->Context,
4255 &hukey, FALSE);
4256 if (rc == ERROR_SUCCESS)
4257 {
4258 WCHAR *package_code;
4259
4261 if (package_code)
4262 {
4263 WCHAR *guid;
4264
4265 guid = msi_get_package_code(package->db);
4266 if (guid)
4267 {
4269
4271 msi_free(guid);
4272 if (!wcscmp(packed, package_code))
4273 {
4274 TRACE("re-publishing product - new package\n");
4275 republish = TRUE;
4276 }
4277 }
4278 msi_free(package_code);
4279 }
4280 }
4281
4282 /* FIXME: also need to publish if the product is in advertise mode */
4283 if (!republish && !msi_check_publish(package))
4284 {
4285 if (hukey)
4286 RegCloseKey(hukey);
4287 return ERROR_SUCCESS;
4288 }
4289
4290 if (!hukey)
4291 {
4292 rc = MSIREG_OpenProductKey(package->ProductCode, NULL, package->Context,
4293 &hukey, TRUE);
4294 if (rc != ERROR_SUCCESS)
4295 goto end;
4296 }
4297
4298 rc = MSIREG_OpenUserDataProductKey(package->ProductCode, package->Context,
4299 NULL, &hudkey, TRUE);
4300 if (rc != ERROR_SUCCESS)
4301 goto end;
4302
4303 rc = msi_publish_upgrade_code(package);
4304 if (rc != ERROR_SUCCESS)
4305 goto end;
4306
4307 rc = msi_publish_product_properties(package, hukey);
4308 if (rc != ERROR_SUCCESS)
4309 goto end;
4310
4311 rc = msi_publish_sourcelist(package, hukey);
4312 if (rc != ERROR_SUCCESS)
4313 goto end;
4314
4315 rc = msi_publish_icons(package);
4316
4317end:
4318 uirow = MSI_CreateRecord( 1 );
4319 MSI_RecordSetStringW( uirow, 1, package->ProductCode );
4321 msiobj_release( &uirow->hdr );
4322
4323 RegCloseKey(hukey);
4324 RegCloseKey(hudkey);
4325 return rc;
4326}
static int list_empty(struct list_entry *head)
Definition: list.h:58
static UINT msi_publish_upgrade_code(MSIPACKAGE *package)
Definition: action.c:4079
static UINT msi_publish_product_properties(MSIPACKAGE *package, HKEY hkey)
Definition: action.c:4033
static UINT msi_publish_sourcelist(MSIPACKAGE *package, HKEY hkey)
Definition: action.c:3979
static UINT msi_publish_patches(MSIPACKAGE *package)
Definition: action.c:4135
static UINT msi_publish_icons(MSIPACKAGE *package)
Definition: action.c:3963
GLuint GLenum GLsizei GLsizei GLint GLint GLboolean packed
Definition: glext.h:9271
const GUID * guid
static const WCHAR INSTALLPROPERTY_PACKAGECODEW[]
Definition: msi.h:285
UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:338
WCHAR * msi_get_package_code(MSIDATABASE *db) DECLSPEC_HIDDEN
Definition: package.c:1278
LPWSTR msi_reg_get_val_str(HKEY hkey, LPCWSTR name) DECLSPEC_HIDDEN
Definition: registry.c:243
UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:582
struct list patches
Definition: msipriv.h:400

◆ ACTION_RegisterComPlus()

static UINT ACTION_RegisterComPlus ( MSIPACKAGE package)
static

Definition at line 7462 of file action.c.

7463{
7464 return msi_unimplemented_action_stub( package, "RegisterComPlus", L"Complus" );
7465}

◆ ACTION_RegisterProduct()

static UINT ACTION_RegisterProduct ( MSIPACKAGE package)
static

Definition at line 4981 of file action.c.

4982{
4983 WCHAR *upgrade_code, squashed_pc[SQUASHED_GUID_SIZE];
4984 MSIRECORD *uirow;
4985 HKEY hkey, props, upgrade_key;
4986 UINT rc;
4987
4988 if (package->script == SCRIPT_NONE)
4989 return msi_schedule_action(package, SCRIPT_INSTALL, L"RegisterProduct");
4990
4991 /* FIXME: also need to publish if the product is in advertise mode */
4992 if (!msi_get_property_int( package->db, L"ProductToBeRegistered", 0 )
4993 && !msi_check_publish(package))
4994 return ERROR_SUCCESS;
4995
4996 rc = MSIREG_OpenUninstallKey(package->ProductCode, package->platform, &hkey, TRUE);
4997 if (rc != ERROR_SUCCESS)
4998 return rc;
4999
5000 rc = MSIREG_OpenInstallProps(package->ProductCode, package->Context, NULL, &props, TRUE);
5001 if (rc != ERROR_SUCCESS)
5002 goto done;
5003
5004 rc = msi_publish_install_properties(package, hkey);
5005 if (rc != ERROR_SUCCESS)
5006 goto done;
5007
5009 if (rc != ERROR_SUCCESS)
5010 goto done;
5011
5012 upgrade_code = msi_dup_property(package->db, L"UpgradeCode");
5013 if (upgrade_code)
5014 {
5015 rc = MSIREG_OpenUpgradeCodesKey( upgrade_code, &upgrade_key, TRUE );
5016 if (rc == ERROR_SUCCESS)
5017 {
5018 squash_guid( package->ProductCode, squashed_pc );
5019 msi_reg_set_val_str( upgrade_key, squashed_pc, NULL );
5020 RegCloseKey( upgrade_key );
5021 }
5022 msi_free( upgrade_code );
5023 }
5025 package->delete_on_close = FALSE;
5026
5027done:
5028 uirow = MSI_CreateRecord( 1 );
5029 MSI_RecordSetStringW( uirow, 1, package->ProductCode );
5031 msiobj_release( &uirow->hdr );
5032
5033 RegCloseKey(hkey);
5034 return ERROR_SUCCESS;
5035}
static UINT msi_publish_install_properties(MSIPACKAGE *package, HKEY hkey)
Definition: action.c:4893
static const WCHAR INSTALLPROPERTY_LOCALPACKAGEW[]
Definition: msi.h:343
UINT MSIREG_OpenUninstallKey(const WCHAR *, enum platform, HKEY *, BOOL) DECLSPEC_HIDDEN
UINT MSIREG_OpenUpgradeCodesKey(LPCWSTR szProduct, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:783
UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:692
BOOL delete_on_close
Definition: msipriv.h:450
enum platform platform
Definition: msipriv.h:396
LPWSTR localfile
Definition: msipriv.h:449
static const WCHAR props[]
Definition: wbemdisp.c:288

◆ ACTION_RegisterTypeLibraries()

static UINT ACTION_RegisterTypeLibraries ( MSIPACKAGE package)
static

Definition at line 3602 of file action.c.

3603{
3604 MSIQUERY *view;
3605 UINT rc;
3606
3607 if (package->script == SCRIPT_NONE)
3608 return msi_schedule_action(package, SCRIPT_INSTALL, L"RegisterTypeLibraries");
3609
3610 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `TypeLib`", &view);
3611 if (rc != ERROR_SUCCESS)
3612 return ERROR_SUCCESS;
3613
3615 msiobj_release(&view->hdr);
3616 return rc;
3617}
static UINT ITERATE_RegisterTypeLibraries(MSIRECORD *row, LPVOID param)
Definition: action.c:3522

◆ ACTION_RegisterUser()

static UINT ACTION_RegisterUser ( MSIPACKAGE package)
static

Definition at line 5264 of file action.c.

5265{
5266 static const WCHAR szPropKeys[][80] =
5267 {
5268 L"ProductID",
5269 L"USERNAME",
5270 L"COMPANYNAME",
5271 L"",
5272 };
5273 static const WCHAR szRegKeys[][80] =
5274 {
5275 L"ProductID",
5276 L"RegOwner",
5277 L"RegCompany",
5278 L"",
5279 };
5280 HKEY hkey = 0;
5281 LPWSTR buffer, productid = NULL;
5282 UINT i, rc = ERROR_SUCCESS;
5283 MSIRECORD *uirow;
5284
5285 if (package->script == SCRIPT_NONE)
5286 return msi_schedule_action(package, SCRIPT_INSTALL, L"RegisterUser");
5287
5288 if (msi_check_unpublish(package))
5289 {
5291 goto end;
5292 }
5293
5294 productid = msi_dup_property( package->db, INSTALLPROPERTY_PRODUCTIDW );
5295 if (!productid)
5296 goto end;
5297
5298 rc = MSIREG_OpenInstallProps(package->ProductCode, package->Context,
5299 NULL, &hkey, TRUE);
5300 if (rc != ERROR_SUCCESS)
5301 goto end;
5302
5303 for( i = 0; szPropKeys[i][0]; i++ )
5304 {
5305 buffer = msi_dup_property( package->db, szPropKeys[i] );
5306 msi_reg_set_val_str( hkey, szRegKeys[i], buffer );
5307 msi_free( buffer );
5308 }
5309
5310end:
5311 uirow = MSI_CreateRecord( 1 );
5312 MSI_RecordSetStringW( uirow, 1, productid );
5314 msiobj_release( &uirow->hdr );
5315
5316 msi_free(productid);
5317 RegCloseKey(hkey);
5318 return rc;
5319}
static BOOL msi_check_unpublish(MSIPACKAGE *package)
Definition: action.c:4121
static const WCHAR INSTALLPROPERTY_PRODUCTIDW[]
Definition: msi.h:363
UINT MSIREG_DeleteUserDataProductKey(LPCWSTR, MSIINSTALLCONTEXT) DECLSPEC_HIDDEN
Definition: registry.c:720

◆ ACTION_RemoveEnvironmentStrings()

static UINT ACTION_RemoveEnvironmentStrings ( MSIPACKAGE package)
static

Definition at line 7131 of file action.c.

7132{
7133 MSIQUERY *view;
7134 UINT rc;
7135
7136 if (package->script == SCRIPT_NONE)
7137 return msi_schedule_action(package, SCRIPT_INSTALL, L"RemoveEnvironmentStrings");
7138
7139 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Environment`", &view );
7140 if (rc != ERROR_SUCCESS)
7141 return ERROR_SUCCESS;
7142
7144 msiobj_release( &view->hdr );
7145 return rc;
7146}
static UINT ITERATE_RemoveEnvironmentString(MSIRECORD *rec, LPVOID param)
Definition: action.c:6994

◆ ACTION_RemoveExistingProducts()

static UINT ACTION_RemoveExistingProducts ( MSIPACKAGE package)
static

Definition at line 7288 of file action.c.

7289{
7290 MSIQUERY *view;
7291 UINT r;
7292
7293 r = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Upgrade`", &view );
7294 if (r == ERROR_SUCCESS)
7295 {
7297 msiobj_release( &view->hdr );
7298 if (r != ERROR_SUCCESS)
7299 return r;
7300 }
7301 return ERROR_SUCCESS;
7302}
static UINT ITERATE_RemoveExistingProducts(MSIRECORD *rec, LPVOID param)
Definition: action.c:7245

◆ ACTION_RemoveFolders()

static UINT ACTION_RemoveFolders ( MSIPACKAGE package)
static

Definition at line 762 of file action.c.

763{
764 MSIQUERY *view;
765 UINT rc;
766
767 if (package->script == SCRIPT_NONE)
768 return msi_schedule_action(package, SCRIPT_INSTALL, L"RemoveFolders");
769
770 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `CreateFolder`", &view );
771 if (rc != ERROR_SUCCESS)
772 return ERROR_SUCCESS;
773
775 msiobj_release( &view->hdr );
776 return rc;
777}
static UINT ITERATE_RemoveFolders(MSIRECORD *row, LPVOID param)
Definition: action.c:714

◆ ACTION_RemoveIniValues()

static UINT ACTION_RemoveIniValues ( MSIPACKAGE package)
static

Definition at line 4576 of file action.c.

4577{
4578 MSIQUERY *view;
4579 UINT rc;
4580
4581 if (package->script == SCRIPT_NONE)
4582 return msi_schedule_action(package, SCRIPT_INSTALL, L"RemoveIniValues");
4583
4584 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `IniFile`", &view );
4585 if (rc == ERROR_SUCCESS)
4586 {
4588 msiobj_release( &view->hdr );
4589 if (rc != ERROR_SUCCESS)
4590 return rc;
4591 }
4592 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `RemoveIniFile`", &view );
4593 if (rc == ERROR_SUCCESS)
4594 {
4596 msiobj_release( &view->hdr );
4597 if (rc != ERROR_SUCCESS)
4598 return rc;
4599 }
4600 return ERROR_SUCCESS;
4601}
static UINT ITERATE_RemoveIniValuesOnInstall(MSIRECORD *row, LPVOID param)
Definition: action.c:4515
static UINT ITERATE_RemoveIniValuesOnUninstall(MSIRECORD *row, LPVOID param)
Definition: action.c:4453

◆ ACTION_RemoveODBC()

static UINT ACTION_RemoveODBC ( MSIPACKAGE package)
static

Definition at line 6633 of file action.c.

6634{
6635 MSIQUERY *view;
6636 UINT rc;
6637
6638 if (package->script == SCRIPT_NONE)
6639 return msi_schedule_action(package, SCRIPT_INSTALL, L"RemoveODBC");
6640
6641 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `ODBCDriver`", &view );
6642 if (rc == ERROR_SUCCESS)
6643 {
6645 msiobj_release( &view->hdr );
6646 if (rc != ERROR_SUCCESS)
6647 return rc;
6648 }
6649 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `ODBCTranslator`", &view );
6650 if (rc == ERROR_SUCCESS)
6651 {
6653 msiobj_release( &view->hdr );
6654 if (rc != ERROR_SUCCESS)
6655 return rc;
6656 }
6657 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `ODBCDataSource`", &view );
6658 if (rc == ERROR_SUCCESS)
6659 {
6661 msiobj_release( &view->hdr );
6662 if (rc != ERROR_SUCCESS)
6663 return rc;
6664 }
6665 return ERROR_SUCCESS;
6666}
static UINT ITERATE_RemoveODBCDataSource(MSIRECORD *rec, LPVOID param)
Definition: action.c:6577
static UINT ITERATE_RemoveODBCDriver(MSIRECORD *rec, LPVOID param)
Definition: action.c:6499
static UINT ITERATE_RemoveODBCTranslator(MSIRECORD *rec, LPVOID param)
Definition: action.c:6538

◆ ACTION_RemoveRegistryValues()

static UINT ACTION_RemoveRegistryValues ( MSIPACKAGE package)
static

Definition at line 3035 of file action.c.

3036{
3037 MSIQUERY *view;
3038 UINT rc;
3039
3040 if (package->script == SCRIPT_NONE)
3041 return msi_schedule_action(package, SCRIPT_INSTALL, L"RemoveRegistryValues");
3042
3043 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Registry`", &view );
3044 if (rc == ERROR_SUCCESS)
3045 {
3047 msiobj_release( &view->hdr );
3048 if (rc != ERROR_SUCCESS)
3049 return rc;
3050 }
3051 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `RemoveRegistry`", &view );
3052 if (rc == ERROR_SUCCESS)
3053 {
3055 msiobj_release( &view->hdr );
3056 if (rc != ERROR_SUCCESS)
3057 return rc;
3058 }
3059 return ERROR_SUCCESS;
3060}
static UINT ITERATE_RemoveRegistryValuesOnUninstall(MSIRECORD *row, LPVOID param)
Definition: action.c:2904
static UINT ITERATE_RemoveRegistryValuesOnInstall(MSIRECORD *row, LPVOID param)
Definition: action.c:2972

◆ ACTION_RemoveShortcuts()

static UINT ACTION_RemoveShortcuts ( MSIPACKAGE package)
static

Definition at line 3897 of file action.c.

3898{
3899 MSIQUERY *view;
3900 UINT rc;
3901
3902 if (package->script == SCRIPT_NONE)
3903 return msi_schedule_action(package, SCRIPT_INSTALL, L"RemoveShortcuts");
3904
3905 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Shortcut`", &view );
3906 if (rc != ERROR_SUCCESS)
3907 return ERROR_SUCCESS;
3908
3910 msiobj_release( &view->hdr );
3911 return rc;
3912}
static UINT ITERATE_RemoveShortcuts(MSIRECORD *row, LPVOID param)
Definition: action.c:3869

◆ ACTION_ResolveSource()

static UINT ACTION_ResolveSource ( MSIPACKAGE package)
static

Definition at line 5210 of file action.c.

5211{
5212 DWORD attrib;
5213 UINT rc;
5214
5215 /*
5216 * We are currently doing what should be done here in the top level Install
5217 * however for Administrative and uninstalls this step will be needed
5218 */
5219 if (!package->PackagePath)
5220 return ERROR_SUCCESS;
5221
5222 msi_set_sourcedir_props(package, TRUE);
5223
5224 attrib = GetFileAttributesW(package->db->path);
5225 if (attrib == INVALID_FILE_ATTRIBUTES)
5226 {
5228 LPWSTR prompt;
5229 DWORD size = 0;
5230
5231 rc = MsiSourceListGetInfoW(package->ProductCode, NULL,
5232 package->Context, MSICODE_PRODUCT,
5234 if (rc == ERROR_MORE_DATA)
5235 {
5236 prompt = msi_alloc(size * sizeof(WCHAR));
5238 package->Context, MSICODE_PRODUCT,
5240 }
5241 else
5242 prompt = strdupW(package->db->path);
5243
5246 MSI_RecordSetStringW(record, 2, prompt);
5247 msi_free(prompt);
5248 while(attrib == INVALID_FILE_ATTRIBUTES)
5249 {
5252 if (rc == IDCANCEL)
5254 attrib = GetFileAttributesW(package->db->path);
5255 }
5256 rc = ERROR_SUCCESS;
5257 }
5258 else
5259 return ERROR_SUCCESS;
5260
5261 return rc;
5262}
static WCHAR * strdupW(const WCHAR *src)
Definition: main.c:92
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:652
#define MSIERR_INSERTDISK
Definition: resource.h:30
UINT WINAPI MsiSourceListGetInfoW(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, DWORD dwOptions, LPCWSTR szProperty, LPWSTR szValue, LPDWORD pcchValue)
Definition: source.c:523
@ MSICODE_PRODUCT
Definition: msi.h:215
static const WCHAR INSTALLPROPERTY_DISKPROMPTW[]
Definition: msi.h:417
@ INSTALLMESSAGE_ERROR
Definition: msi.h:95
LPWSTR path
Definition: msipriv.h:112
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23

◆ ACTION_RMCCPSearch()

static UINT ACTION_RMCCPSearch ( MSIPACKAGE package)
static

Definition at line 7457 of file action.c.

7458{
7459 return msi_unimplemented_action_stub( package, "RMCCPSearch", L"CCPSearch" );
7460}

◆ ACTION_ScheduleReboot()

static UINT ACTION_ScheduleReboot ( MSIPACKAGE package)
static

Definition at line 7180 of file action.c.

7181{
7182 TRACE("\n");
7183 package->need_reboot_at_end = 1;
7184 return ERROR_SUCCESS;
7185}
unsigned char need_reboot_at_end
Definition: msipriv.h:469

◆ ACTION_SelfRegModules()

static UINT ACTION_SelfRegModules ( MSIPACKAGE package)
static

Definition at line 4664 of file action.c.

4665{
4666 MSIQUERY *view;
4667 UINT rc;
4668
4669 if (package->script == SCRIPT_NONE)
4670 return msi_schedule_action(package, SCRIPT_INSTALL, L"SelfRegModules");
4671
4672 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `SelfReg`", &view);
4673 if (rc != ERROR_SUCCESS)
4674 return ERROR_SUCCESS;
4675
4677 msiobj_release(&view->hdr);
4678 return rc;
4679}
static UINT ITERATE_SelfRegModules(MSIRECORD *row, LPVOID param)
Definition: action.c:4631

◆ ACTION_SelfUnregModules()

static UINT ACTION_SelfUnregModules ( MSIPACKAGE package)
static

Definition at line 4714 of file action.c.

4715{
4716 MSIQUERY *view;
4717 UINT rc;
4718
4719 if (package->script == SCRIPT_NONE)
4720 return msi_schedule_action(package, SCRIPT_INSTALL, L"SelfUnregModules");
4721
4722 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `SelfReg`", &view );
4723 if (rc != ERROR_SUCCESS)
4724 return ERROR_SUCCESS;
4725
4727 msiobj_release( &view->hdr );
4728 return rc;
4729}
static UINT ITERATE_SelfUnregModules(MSIRECORD *row, LPVOID param)
Definition: action.c:4681

◆ ACTION_SetODBCFolders()

static UINT ACTION_SetODBCFolders ( MSIPACKAGE package)
static

Definition at line 7216 of file action.c.

7217{
7218 MSIQUERY *view;
7219 UINT r;
7220 DWORD count;
7221
7222 r = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `ODBCDriver`", &view );
7223 if (r == ERROR_SUCCESS)
7224 {
7225 count = 0;
7226 r = MSI_IterateRecords( view, &count, NULL, package );
7227 msiobj_release( &view->hdr );
7228 if (r != ERROR_SUCCESS)
7229 return r;
7230 if (count) FIXME( "ignored %lu rows in ODBCDriver table\n", count );
7231 }
7232 r = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `ODBCTranslator`", &view );
7233 if (r == ERROR_SUCCESS)
7234 {
7235 count = 0;
7236 r = MSI_IterateRecords( view, &count, NULL, package );
7237 msiobj_release( &view->hdr );
7238 if (r != ERROR_SUCCESS)
7239 return r;
7240 if (count) FIXME( "ignored %lu rows in ODBCTranslator table\n", count );
7241 }
7242 return ERROR_SUCCESS;
7243}

◆ ACTION_StartServices()

static UINT ACTION_StartServices ( MSIPACKAGE package)
static

Definition at line 5976 of file action.c.

5977{
5978 MSIQUERY *view;
5979 UINT rc;
5980
5981 if (package->script == SCRIPT_NONE)
5982 return msi_schedule_action(package, SCRIPT_INSTALL, L"StartServices");
5983
5984 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `ServiceControl`", &view);
5985 if (rc != ERROR_SUCCESS)
5986 return ERROR_SUCCESS;
5987
5989 msiobj_release(&view->hdr);
5990 return rc;
5991}
static UINT ITERATE_StartService(MSIRECORD *rec, LPVOID param)
Definition: action.c:5866

◆ ACTION_StopServices()

static UINT ACTION_StopServices ( MSIPACKAGE package)
static

Definition at line 6135 of file action.c.

6136{
6137 MSIQUERY *view;
6138 UINT rc;
6139
6140 if (package->script == SCRIPT_NONE)
6141 return msi_schedule_action(package, SCRIPT_INSTALL, L"StopServices");
6142
6143 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `ServiceControl`", &view);
6144 if (rc != ERROR_SUCCESS)
6145 return ERROR_SUCCESS;
6146
6148 msiobj_release(&view->hdr);
6149 return rc;
6150}
static UINT ITERATE_StopService(MSIRECORD *rec, LPVOID param)
Definition: action.c:6078

◆ ACTION_UnpublishComponents()

static UINT ACTION_UnpublishComponents ( MSIPACKAGE package)
static

Definition at line 5663 of file action.c.

5664{
5665 MSIQUERY *view;
5666 UINT rc;
5667
5668 if (package->script == SCRIPT_NONE)
5669 return msi_schedule_action(package, SCRIPT_INSTALL, L"UnpublishComponents");
5670
5671 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `PublishComponent`", &view );
5672 if (rc != ERROR_SUCCESS)
5673 return ERROR_SUCCESS;
5674
5676 msiobj_release( &view->hdr );
5677 return rc;
5678}
static UINT ITERATE_UnpublishComponent(MSIRECORD *rec, LPVOID param)
Definition: action.c:5614

◆ ACTION_UnpublishFeatures()

static UINT ACTION_UnpublishFeatures ( MSIPACKAGE package)
static

Definition at line 4875 of file action.c.

4876{
4878
4879 if (package->script == SCRIPT_NONE)
4880 return msi_schedule_action(package, SCRIPT_INSTALL, L"UnpublishFeatures");
4881
4882 if (!msi_check_unpublish(package))
4883 return ERROR_SUCCESS;
4884
4886 {
4888 }
4889
4890 return ERROR_SUCCESS;
4891}
static UINT msi_unpublish_feature(MSIPACKAGE *package, MSIFEATURE *feature)
Definition: action.c:4843

◆ ACTION_UnpublishProduct()

static UINT ACTION_UnpublishProduct ( MSIPACKAGE package)
static

Definition at line 5117 of file action.c.

5118{
5119 MSIPATCHINFO *patch;
5120
5124
5129
5130 remove_product_upgrade_code( package );
5131
5132 LIST_FOR_EACH_ENTRY(patch, &package->patches, MSIPATCHINFO, entry)
5133 {
5135 if (!wcscmp( package->ProductCode, patch->products ))
5136 {
5137 TRACE("removing local patch package %s\n", debugstr_w(patch->localfile));
5138 patch->delete_on_close = TRUE;
5139 }
5140 /* FIXME: remove local patch package if this is the last product */
5141 }
5142 TRACE("removing local package %s\n", debugstr_w(package->localfile));
5143 package->delete_on_close = TRUE;
5144
5145 msi_unpublish_icons( package );
5146 return ERROR_SUCCESS;
5147}
static void remove_product_upgrade_code(MSIPACKAGE *package)
Definition: action.c:5079
static UINT msi_unpublish_icons(MSIPACKAGE *package)
Definition: action.c:5063
UINT MSIREG_DeleteUserDataPatchKey(LPCWSTR patch, MSIINSTALLCONTEXT context) DECLSPEC_HIDDEN
Definition: registry.c:636
UINT MSIREG_DeleteUserProductKey(LPCWSTR szProduct) DECLSPEC_HIDDEN
Definition: registry.c:378
UINT MSIREG_DeleteProductKey(LPCWSTR szProduct) DECLSPEC_HIDDEN
Definition: registry.c:751
UINT MSIREG_DeleteUserFeaturesKey(LPCWSTR szProduct) DECLSPEC_HIDDEN
Definition: registry.c:445
UINT MSIREG_DeleteUninstallKey(const WCHAR *, enum platform) DECLSPEC_HIDDEN
UINT MSIREG_DeleteLocalClassesProductKey(LPCWSTR szProductCode) DECLSPEC_HIDDEN
Definition: registry.c:841
UINT MSIREG_DeleteLocalClassesFeaturesKey(LPCWSTR szProductCode) DECLSPEC_HIDDEN
Definition: registry.c:858
LPWSTR patchcode
Definition: msipriv.h:201
LPWSTR localfile
Definition: msipriv.h:205
LPWSTR products
Definition: msipriv.h:202
BOOL delete_on_close
Definition: msipriv.h:208

Referenced by ACTION_InstallFinalize().

◆ ACTION_UnregisterComPlus()

static UINT ACTION_UnregisterComPlus ( MSIPACKAGE package)
static

Definition at line 7467 of file action.c.

7468{
7469 return msi_unimplemented_action_stub( package, "UnregisterComPlus", L"Complus" );
7470}

◆ ACTION_UnregisterTypeLibraries()

static UINT ACTION_UnregisterTypeLibraries ( MSIPACKAGE package)
static

Definition at line 3663 of file action.c.

3664{
3665 MSIQUERY *view;
3666 UINT rc;
3667
3668 if (package->script == SCRIPT_NONE)
3669 return msi_schedule_action(package, SCRIPT_INSTALL, L"UnregisterTypeLibraries");
3670
3671 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `TypeLib`", &view );
3672 if (rc != ERROR_SUCCESS)
3673 return ERROR_SUCCESS;
3674
3676 msiobj_release( &view->hdr );
3677 return rc;
3678}
static UINT ITERATE_UnregisterTypeLibraries(MSIRECORD *row, LPVOID param)
Definition: action.c:3619

◆ ACTION_ValidateProductID()

static UINT ACTION_ValidateProductID ( MSIPACKAGE package)
static

Definition at line 7175 of file action.c.

7176{
7177 return msi_validate_product_id( package );
7178}
UINT msi_validate_product_id(MSIPACKAGE *package)
Definition: action.c:7148

◆ ACTION_WriteEnvironmentStrings()

static UINT ACTION_WriteEnvironmentStrings ( MSIPACKAGE package)
static

Definition at line 6977 of file action.c.

6978{
6979 MSIQUERY *view;
6980 UINT rc;
6981
6982 if (package->script == SCRIPT_NONE)
6983 return msi_schedule_action(package, SCRIPT_INSTALL, L"WriteEnvironmentStrings");
6984
6985 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `Environment`", &view);
6986 if (rc != ERROR_SUCCESS)
6987 return ERROR_SUCCESS;
6988
6990 msiobj_release(&view->hdr);
6991 return rc;
6992}
static UINT ITERATE_WriteEnvironmentString(MSIRECORD *rec, LPVOID param)
Definition: action.c:6785

◆ ACTION_WriteIniValues()

static UINT ACTION_WriteIniValues ( MSIPACKAGE package)
static

Definition at line 4436 of file action.c.

4437{
4438 MSIQUERY *view;
4439 UINT rc;
4440
4441 if (package->script == SCRIPT_NONE)
4442 return msi_schedule_action(package, SCRIPT_INSTALL, L"WriteIniValues");
4443
4444 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `IniFile`", &view);
4445 if (rc != ERROR_SUCCESS)
4446 return ERROR_SUCCESS;
4447
4449 msiobj_release(&view->hdr);
4450 return rc;
4451}
static UINT ITERATE_WriteIniValues(MSIRECORD *row, LPVOID param)
Definition: action.c:4362

◆ ACTION_WriteRegistryValues()

static UINT ACTION_WriteRegistryValues ( MSIPACKAGE package)
static

Definition at line 2806 of file action.c.

2807{
2808 MSIQUERY *view;
2809 UINT rc;
2810
2811 if (package->script == SCRIPT_NONE)
2812 return msi_schedule_action(package, SCRIPT_INSTALL, L"WriteRegistryValues");
2813
2814 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `Registry`", &view);
2815 if (rc != ERROR_SUCCESS)
2816 return ERROR_SUCCESS;
2817
2819 msiobj_release(&view->hdr);
2820 return rc;
2821}
static UINT ITERATE_WriteRegistryValues(MSIRECORD *row, LPVOID param)
Definition: action.c:2692

◆ add_feature_child()

static UINT add_feature_child ( MSIFEATURE parent,
MSIFEATURE child 
)
static

Definition at line 844 of file action.c.

845{
847
848 fl = msi_alloc( sizeof(*fl) );
849 if ( !fl )
851 fl->feature = child;
852 list_add_tail( &parent->Children, &fl->entry );
853
854 return ERROR_SUCCESS;
855}
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
r parent
Definition: btrfs.c:3010
static HWND child
Definition: cursoricon.c:298
_In_ FLONG fl
Definition: winddi.h:1279

Referenced by find_feature_children().

◆ add_feature_component()

static UINT add_feature_component ( MSIFEATURE feature,
MSICOMPONENT comp 
)
static

Definition at line 831 of file action.c.

832{
833 ComponentList *cl;
834
835 cl = msi_alloc( sizeof (*cl) );
836 if ( !cl )
838 cl->component = comp;
839 list_add_tail( &feature->Components, &cl->entry );
840
841 return ERROR_SUCCESS;
842}
struct list entry
Definition: msipriv.h:553

Referenced by iterate_load_featurecomponents().

◆ add_folder_child()

static UINT add_folder_child ( MSIFOLDER parent,
MSIFOLDER child 
)
static

Definition at line 1332 of file action.c.

1333{
1334 FolderList *fl;
1335
1336 if (!(fl = msi_alloc( sizeof(*fl) ))) return ERROR_NOT_ENOUGH_MEMORY;
1337 fl->folder = child;
1338 list_add_tail( &parent->children, &fl->entry );
1339 return ERROR_SUCCESS;
1340}

Referenced by find_folder_children().

◆ bind_image()

static void bind_image ( MSIPACKAGE package,
const char filename,
const char path 
)
static

Definition at line 7374 of file action.c.

7375{
7376 if (!msi_bind_image( package, filename, path ))
7377 {
7378 WARN( "failed to bind image %lu\n", GetLastError() );
7379 }
7380}
static BOOL msi_bind_image(MSIPACKAGE *package, const char *filename, const char *path)
Definition: action.c:7365
const char * filename
Definition: ioapi.h:137
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by ITERATE_BindImage().

◆ build_full_keypath()

static WCHAR * build_full_keypath ( MSIPACKAGE package,
MSICOMPONENT comp 
)
static

Definition at line 3296 of file action.c.

3297{
3298 if (comp->assembly)
3299 {
3300 DWORD len = lstrlenW( L"<\\" ) + lstrlenW( comp->assembly->display_name );
3301 WCHAR *keypath = msi_alloc( (len + 1) * sizeof(WCHAR) );
3302
3303 if (keypath)
3304 {
3305 lstrcpyW( keypath, L"<\\" );
3306 lstrcatW( keypath, comp->assembly->display_name );
3307 }
3308 return keypath;
3309 }
3310 return resolve_keypath( package, comp );
3311}
static LPWSTR resolve_keypath(MSIPACKAGE *package, MSICOMPONENT *cmp)
Definition: action.c:3146
GLenum GLsizei len
Definition: glext.h:6722
LPWSTR display_name
Definition: msipriv.h:516
MSIASSEMBLY * assembly
Definition: msipriv.h:540

Referenced by ACTION_ProcessComponents().

◆ build_multi_string_value()

static BYTE * build_multi_string_value ( BYTE old_value,
DWORD  old_size,
BYTE new_value,
DWORD  new_size,
DWORD size 
)
static

Definition at line 2636 of file action.c.

2638{
2639 DWORD i, old_len = 0, new_len = 0, old_count = 0, new_count = 0;
2640 const WCHAR *new_ptr = NULL, *old_ptr = NULL;
2641 enum join_op op = JOIN_OP_REPLACE;
2642 WCHAR **old = NULL, **new = NULL;
2643 BYTE *ret;
2644
2645 if (new_size / sizeof(WCHAR) - 1 > 1)
2646 {
2647 new_ptr = (const WCHAR *)new_value;
2648 new_len = new_size / sizeof(WCHAR) - 1;
2649
2650 if (!new_ptr[0] && new_ptr[new_len - 1])
2651 {
2653 new_len--;
2654 new_ptr++;
2655 }
2656 else if (new_ptr[0] && !new_ptr[new_len - 1])
2657 {
2659 new_len--;
2660 }
2661 else if (new_len > 2 && !new_ptr[0] && !new_ptr[new_len - 1])
2662 {
2664 new_len -= 2;
2665 new_ptr++;
2666 }
2667 new = split_multi_string_values( new_ptr, new_len, &new_count );
2668 }
2669 if (old_size / sizeof(WCHAR) - 1 > 1)
2670 {
2671 old_ptr = (const WCHAR *)old_value;
2672 old_len = old_size / sizeof(WCHAR) - 1;
2673 old = split_multi_string_values( old_ptr, old_len, &old_count );
2674 }
2675 ret = (BYTE *)join_multi_string_values( op, old, old_count, new, new_count, size );
2676 for (i = 0; i < old_count; i++) msi_free( old[i] );
2677 for (i = 0; i < new_count; i++) msi_free( new[i] );
2678 msi_free( old );
2679 msi_free( new );
2680 return ret;
2681}
UINT op
Definition: effect.c:236
join_op
Definition: action.c:2608
static WCHAR ** split_multi_string_values(const WCHAR *str, DWORD len, DWORD *count)
Definition: action.c:2530
static WCHAR * join_multi_string_values(enum join_op op, WCHAR **old, DWORD old_count, WCHAR **new, DWORD new_count, DWORD *size)
Definition: action.c:2614
static ULONG * old_value
Definition: directory.c:54
int ret

Referenced by ITERATE_WriteRegistryValues().

◆ calculate_file_cost()

static UINT calculate_file_cost ( MSIPACKAGE package)
static

Definition at line 2061 of file action.c.

2062{
2063 VS_FIXEDFILEINFO *file_version;
2064 WCHAR *font_version;
2065 MSIFILE *file;
2066
2068 {
2069 MSICOMPONENT *comp = file->Component;
2071
2072 if (!comp->Enabled) continue;
2073
2074 if (file->IsCompressed)
2075 comp->ForceLocalState = TRUE;
2076
2077 set_target_path( package, file );
2078
2079 if ((comp->assembly && !comp->assembly->installed) ||
2080 msi_get_file_attributes( package, file->TargetPath ) == INVALID_FILE_ATTRIBUTES)
2081 {
2082 comp->Cost += file->FileSize;
2083 continue;
2084 }
2085 file_size = msi_get_disk_file_size( package, file->TargetPath );
2086 TRACE("%s (size %lu)\n", debugstr_w(file->TargetPath), file_size);
2087
2088 if (file->Version)
2089 {
2090 if ((file_version = msi_get_disk_file_version( package, file->TargetPath )))
2091 {
2092 if (msi_compare_file_versions( file_version, file->Version ) < 0)
2093 {
2094 comp->Cost += file->FileSize - file_size;
2095 }
2096 msi_free( file_version );
2097 continue;
2098 }
2099 else if ((font_version = msi_get_font_file_version( package, file->TargetPath )))
2100 {
2101 if (msi_compare_font_versions( font_version, file->Version ) < 0)
2102 {
2103 comp->Cost += file->FileSize - file_size;
2104 }
2105 msi_free( font_version );
2106 continue;
2107 }
2108 }
2109 if (file_size != file->FileSize)
2110 {
2111 comp->Cost += file->FileSize - file_size;
2112 }
2113 }
2114
2115 return ERROR_SUCCESS;
2116}
int msi_compare_file_versions(VS_FIXEDFILEINFO *fi, const WCHAR *version)
Definition: action.c:1930
int msi_compare_font_versions(const WCHAR *ver1, const WCHAR *ver2)
Definition: action.c:1943
static void set_target_path(MSIPACKAGE *package, MSIFILE *file)
Definition: action.c:2042
VS_FIXEDFILEINFO * msi_get_disk_file_version(MSIPACKAGE *package, const WCHAR *filename)
Definition: files.c:161
DWORD msi_get_file_attributes(MSIPACKAGE *package, const WCHAR *path)
Definition: files.c:106
DWORD msi_get_disk_file_size(MSIPACKAGE *package, const WCHAR *filename)
Definition: files.c:190
WCHAR * msi_get_font_file_version(MSIPACKAGE *package, const WCHAR *filename)
Definition: font.c:186
static unsigned int file_size
Definition: regtests2xml.c:47
BOOL installed
Definition: msipriv.h:518
BOOL ForceLocalState
Definition: msipriv.h:534

Referenced by ACTION_CostFinalize().

◆ create_temp_dir()

static WCHAR * create_temp_dir ( MSIDATABASE db)
static

Definition at line 1955 of file action.c.

1956{
1957 static UINT id;
1958 WCHAR *ret;
1959
1960 if (!db->tempfolder)
1961 {
1962 WCHAR tmp[MAX_PATH];
1963 DWORD len = ARRAY_SIZE( tmp );
1964
1965 if (msi_get_property( db, L"TempFolder", tmp, &len ) ||
1967 {
1968 GetTempPathW( MAX_PATH, tmp );
1969 }
1970 if (!(db->tempfolder = strdupW( tmp ))) return NULL;
1971 }
1972
1973 if ((ret = msi_alloc( (lstrlenW( db->tempfolder ) + 20) * sizeof(WCHAR) )))
1974 {
1975 for (;;)
1976 {
1977 if (!GetTempFileNameW( db->tempfolder, L"msi", ++id, ret ))
1978 {
1979 msi_free( ret );
1980 return NULL;
1981 }
1982 if (CreateDirectoryW( ret, NULL )) break;
1983 }
1984 }
1985
1986 return ret;
1987}
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: dir.c:90
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
Definition: path.c:2080
UINT WINAPI GetTempFileNameW(IN LPCWSTR lpPathName, IN LPCWSTR lpPrefixString, IN UINT uUnique, OUT LPWSTR lpTempFileName)
Definition: filename.c:84
GLuint id
Definition: glext.h:5910
UINT msi_get_property(MSIDATABASE *, LPCWSTR, LPWSTR, LPDWORD) DECLSPEC_HIDDEN
Definition: package.c:2250
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
LPWSTR tempfolder
Definition: msipriv.h:114

Referenced by set_target_path().

◆ delete_key()

static void delete_key ( const MSICOMPONENT comp,
HKEY  root,
const WCHAR path 
)
static

Definition at line 2838 of file action.c.

2839{
2842 WCHAR *subkey, *p;
2843 HKEY hkey;
2844
2845 if (!(subkey = strdupW( path ))) return;
2846 do
2847 {
2848 if ((p = wcsrchr( subkey, '\\' )))
2849 {
2850 *p = 0;
2851 if (!p[1]) continue; /* trailing backslash */
2852 hkey = open_key( comp, root, subkey, FALSE, READ_CONTROL );
2853 if (!hkey) break;
2854 if (!is_key_empty(comp, hkey, p + 1))
2855 {
2856 RegCloseKey(hkey);
2857 break;
2858 }
2859 res = RegDeleteKeyExW( hkey, p + 1, access, 0 );
2860 RegCloseKey( hkey );
2861 }
2862 else if (is_key_empty(comp, root, subkey))
2863 res = RegDeleteKeyExW( root, subkey, access, 0 );
2864 if (res)
2865 {
2866 TRACE( "failed to delete key %s (%ld)\n", debugstr_w(subkey), res );
2867 break;
2868 }
2869 } while (p);
2870 msi_free( subkey );
2871}
LONG WINAPI RegDeleteKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ REGSAM samDesired, _In_ DWORD Reserved)
Definition: reg.c:1286
static int is_key_empty(const MSICOMPONENT *comp, HKEY root, const WCHAR *path)
Definition: action.c:2823
static REGSAM get_registry_view(const MSICOMPONENT *comp)
Definition: action.c:2486
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
GLfloat GLfloat p
Definition: glext.h:8902
#define READ_CONTROL
Definition: nt_native.h:58
#define open_key(r, p, s, k)
Definition: reg_test.h:49
ACCESS_MASK REGSAM
Definition: winreg.h:69

◆ delete_tree()

static void delete_tree ( const MSICOMPONENT comp,
HKEY  root,
const WCHAR path 
)
static

Definition at line 2892 of file action.c.

2893{
2894 LONG res;
2895 HKEY hkey;
2896
2897 if (!(hkey = open_key( comp, root, path, FALSE, KEY_ALL_ACCESS ))) return;
2898 res = RegDeleteTreeW( hkey, NULL );
2899 if (res) TRACE( "failed to delete subtree of %s (%ld)\n", debugstr_w(path), res );
2900 delete_key( comp, root, path );
2901 RegCloseKey( hkey );
2902}
LSTATUS WINAPI RegDeleteTreeW(_In_ HKEY, _In_opt_ LPCWSTR)
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define delete_key(r, p, s)
Definition: reg_test.h:64

◆ delete_value()

static void delete_value ( const MSICOMPONENT comp,
HKEY  root,
const WCHAR path,
const WCHAR value 
)
static

Definition at line 2873 of file action.c.

2874{
2875 LONG res;
2876 HKEY hkey;
2877
2878 if ((hkey = open_key( comp, root, path, FALSE, KEY_SET_VALUE | KEY_QUERY_VALUE )))
2879 {
2880 if ((res = RegDeleteValueW( hkey, value )))
2881 TRACE( "failed to delete value %s (%ld)\n", debugstr_w(value), res );
2882
2883 RegCloseKey( hkey );
2884 if (is_key_empty(comp, root, path))
2885 {
2886 TRACE("removing empty key %s\n", debugstr_w(path));
2887 delete_key( comp, root, path );
2888 }
2889 }
2890}
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define KEY_SET_VALUE
Definition: nt_native.h:1017
Definition: pdh_main.c:94

◆ disable_children()

static void disable_children ( MSIFEATURE feature,
int  level 
)
static

Definition at line 1601 of file action.c.

1602{
1603 FeatureList *fl;
1604
1606 {
1608 {
1609 TRACE("child %s (level %d request %d) follows disabled parent %s (level %d request %d)\n",
1610 debugstr_w(fl->feature->Feature), fl->feature->Level, fl->feature->ActionRequest,
1611 debugstr_w(feature->Feature), feature->Level, feature->ActionRequest);
1612
1613 fl->feature->Level = feature->Level;
1614 fl->feature->Action = INSTALLSTATE_UNKNOWN;
1615 fl->feature->ActionRequest = INSTALLSTATE_UNKNOWN;
1616 }
1617 disable_children( fl->feature, level );
1618 }
1619}
static BOOL is_feature_selected(MSIFEATURE *feature, INT level)
Definition: action.c:1507
static void disable_children(MSIFEATURE *feature, int level)
Definition: action.c:1601

Referenced by disable_children(), and MSI_SetFeatureStates().

◆ dummy_thread_proc()

DWORD WINAPI dummy_thread_proc ( void arg)

Definition at line 7670 of file action.c.

7671{
7672 struct dummy_thread *info = arg;
7673 HRESULT hr;
7674
7676 if (FAILED(hr)) ERR("CoInitializeEx failed %08x\n", hr);
7677
7678 SetEvent(info->started);
7680
7682 return 0;
7683}
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
#define INFINITE
Definition: serial.h:102
#define FAILED(hr)
Definition: intsafe.h:51
@ COINIT_MULTITHREADED
Definition: objbase.h:279
HRESULT hr
Definition: shlfolder.c:183
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
void * arg
Definition: msvc.h:10

Referenced by start_dummy_thread().

◆ env_parse_flags()

static UINT env_parse_flags ( LPCWSTR name,
LPCWSTR value,
DWORD flags 
)
static

Definition at line 6680 of file action.c.

6681{
6682 const WCHAR *cptr = *name;
6683
6684 *flags = 0;
6685 while (*cptr)
6686 {
6687 if (*cptr == '=')
6689 else if (*cptr == '+')
6691 else if (*cptr == '-')
6693 else if (*cptr == '!')
6695 else if (*cptr == '*')
6697 else
6698 break;
6699
6700 cptr++;
6701 (*name)++;
6702 }
6703
6704 if (!*cptr)
6705 {
6706 ERR("Missing environment variable\n");
6707 return ERROR_FUNCTION_FAILED;
6708 }
6709
6710 if (*value)
6711 {
6712 LPCWSTR ptr = *value;
6713 if (!wcsncmp(ptr, L"[~]", 3))
6714 {
6715 if (ptr[3] == ';')
6716 {
6718 *value += 3;
6719 }
6720 else
6721 {
6722 *value = NULL;
6723 }
6724 }
6725 else if (lstrlenW(*value) >= 3)
6726 {
6727 ptr += lstrlenW(ptr) - 3;
6728 if (!wcscmp( ptr, L"[~]" ))
6729 {
6730 if ((ptr-1) > *value && *(ptr-1) == ';')
6731 {
6733 /* the "[~]" will be removed by deformat_string */;
6734 }
6735 else
6736 {
6737 *value = NULL;
6738 }
6739 }
6740 }
6741 }
6742
6747 {
6748 ERR( "invalid flags: %#lx\n", *flags );
6749 return ERROR_FUNCTION_FAILED;
6750 }
6751
6752 if (!*flags)
6754
6755 return ERROR_SUCCESS;
6756}
#define ENV_MOD_PREFIX
Definition: action.c:6675
#define ENV_ACT_REMOVEMATCH
Definition: action.c:6671
#define ENV_ACT_SETALWAYS
Definition: action.c:6668
#define check_flag_combo(x, y)
Definition: action.c:6678
#define ENV_MOD_APPEND
Definition: action.c:6674
#define ENV_ACT_REMOVE
Definition: action.c:6670
#define ENV_ACT_SETABSENT
Definition: action.c:6669
#define ENV_MOD_MACHINE
Definition: action.c:6673
#define ENV_MOD_MASK
Definition: action.c:6676
GLbitfield flags
Definition: glext.h:7161
_Check_return_ _CRTIMP int __cdecl wcsncmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
Definition: name.c:39

Referenced by ITERATE_RemoveEnvironmentString(), and ITERATE_WriteEnvironmentString().

◆ execute_script()

static UINT execute_script ( MSIPACKAGE package,
UINT  script 
)
static

Definition at line 1397 of file action.c.

1398{
1399 UINT i, rc = ERROR_SUCCESS;
1400
1401 TRACE("executing script %u\n", script);
1402
1403 package->script = script;
1404
1405 if (script == SCRIPT_ROLLBACK)
1406 {
1407 for (i = package->script_actions_count[script]; i > 0; i--)
1408 {
1409 rc = ACTION_PerformAction(package, package->script_actions[script][i-1]);
1410 if (rc != ERROR_SUCCESS)
1411 {
1412 ERR("Execution of script %i halted; action %s returned %u\n",
1413 script, debugstr_w(package->script_actions[script][i-1]), rc);
1414 break;
1415 }
1416 }
1417 }
1418 else
1419 {
1420 for (i = 0; i < package->script_actions_count[script]; i++)
1421 {
1422 rc = ACTION_PerformAction(package, package->script_actions[script][i]);
1423 if (rc != ERROR_SUCCESS)
1424 {
1425 ERR("Execution of script %i halted; action %s returned %u\n",
1426 script, debugstr_w(package->script_actions[script][i]), rc);
1427 break;
1428 }
1429 }
1430 }
1431
1432 package->script = SCRIPT_NONE;
1433
1435 return rc;
1436}
void msi_free_action_script(MSIPACKAGE *package, UINT script) DECLSPEC_HIDDEN
Definition: package.c:138
script
Definition: msipriv.h:383
LPWSTR * script_actions[SCRIPT_MAX]
Definition: msipriv.h:433
int script_actions_count[SCRIPT_MAX]
Definition: msipriv.h:434

Referenced by ACTION_InstallExecute(), ACTION_InstallFinalize(), and MSI_InstallPackage().

◆ find_feature_children()

static UINT find_feature_children ( MSIRECORD row,
LPVOID  param 
)
static

Definition at line 931 of file action.c.

932{
933 MSIPACKAGE *package = param;
935
937 if (!child)
939
940 if (!child->Feature_Parent)
941 return ERROR_SUCCESS;
942
943 parent = msi_get_loaded_feature( package, child->Feature_Parent );
944 if (!parent)
946
948 return ERROR_SUCCESS;
949}
static UINT add_feature_child(MSIFEATURE *parent, MSIFEATURE *child)
Definition: action.c:844
MSIFEATURE * msi_get_loaded_feature(MSIPACKAGE *package, const WCHAR *Feature)
Definition: action.c:563

Referenced by msi_load_all_features().

◆ find_folder_children()

static UINT find_folder_children ( MSIRECORD row,
LPVOID  param 
)
static

Definition at line 1342 of file action.c.

1343{
1344 MSIPACKAGE *package = param;
1346
1347 if (!(child = msi_get_loaded_folder( package, MSI_RecordGetString( row, 1 ) )))
1348 return ERROR_FUNCTION_FAILED;
1349
1350 if (!child->Parent) return ERROR_SUCCESS;
1351
1352 if (!(parent = msi_get_loaded_folder( package, child->Parent )))
1353 return ERROR_FUNCTION_FAILED;
1354
1355 return add_folder_child( parent, child );
1356}
static UINT add_folder_child(MSIFOLDER *parent, MSIFOLDER *child)
Definition: action.c:1332
MSIFOLDER * msi_get_loaded_folder(MSIPACKAGE *package, const WCHAR *dir)
Definition: action.c:585

Referenced by load_all_folders().

◆ flatten_multi_string_values()

static WCHAR * flatten_multi_string_values ( WCHAR **  left,
DWORD  left_count,
WCHAR **  right,
DWORD  right_count,
DWORD size 
)
static

Definition at line 2559 of file action.c.

2561{
2562 WCHAR *ret, *p;
2563 unsigned int i;
2564
2565 *size = sizeof(WCHAR);
2566 for (i = 0; i < left_count; i++) *size += (lstrlenW( left[i] ) + 1) * sizeof(WCHAR);
2567 for (i = 0; i < right_count; i++) *size += (lstrlenW( right[i] ) + 1) * sizeof(WCHAR);
2568
2569 if (!(ret = p = msi_alloc( *size ))) return NULL;
2570
2571 for (i = 0; i < left_count; i++)
2572 {
2573 lstrcpyW( p, left[i] );
2574 p += lstrlenW( p ) + 1;
2575 }
2576 for (i = 0; i < right_count; i++)
2577 {
2578 lstrcpyW( p, right[i] );
2579 p += lstrlenW( p ) + 1;
2580 }
2581 *p = 0;
2582 return ret;
2583}
GLdouble GLdouble right
Definition: glext.h:10859
GLint left
Definition: glext.h:7726

Referenced by join_multi_string_values().

◆ folder_split_path()

static LPWSTR folder_split_path ( LPWSTR  p,
WCHAR  ch 
)
static

Definition at line 974 of file action.c.

975{
976 if (!p)
977 return p;
978 p = wcschr(p, ch);
979 if (!p)
980 return p;
981 *p = 0;
982 return p+1;
983}
#define wcschr
Definition: compat.h:17

Referenced by load_file(), and load_folder().

◆ follow_parent()

static void follow_parent ( MSIFEATURE feature)
static

Definition at line 1621 of file action.c.

1622{
1623 FeatureList *fl;
1624
1626 {
1627 if (fl->feature->Attributes & msidbFeatureAttributesFollowParent)
1628 {
1629 TRACE("child %s (level %d request %d) follows parent %s (level %d request %d)\n",
1630 debugstr_w(fl->feature->Feature), fl->feature->Level, fl->feature->ActionRequest,
1631 debugstr_w(feature->Feature), feature->Level, feature->ActionRequest);
1632
1633 fl->feature->Action = feature->Action;
1634 fl->feature->ActionRequest = feature->ActionRequest;
1635 }
1636 follow_parent( fl->feature );
1637 }
1638}
static void follow_parent(MSIFEATURE *feature)
Definition: action.c:1621
@ msidbFeatureAttributesFollowParent
Definition: msidefs.h:150

Referenced by follow_parent(), and MSI_SetFeatureStates().

◆ get_client_counts()

static void get_client_counts ( MSIPACKAGE package)
static

Definition at line 1443 of file action.c.

1444{
1445 MSICOMPONENT *comp;
1446 HKEY hkey;
1447
1449 {
1450 if (!comp->ComponentId) continue;
1451
1452 if (MSIREG_OpenUserDataComponentKey( comp->ComponentId, L"S-1-5-18", &hkey, FALSE ) &&
1454 {
1455 comp->num_clients = 0;
1456 continue;
1457 }
1458 RegQueryInfoKeyW( hkey, NULL, NULL, NULL, NULL, NULL, NULL, (DWORD *)&comp->num_clients,
1459 NULL, NULL, NULL, NULL );
1460 RegCloseKey( hkey );
1461 }
1462}
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
Definition: reg.c:3662

Referenced by ACTION_CostFinalize().

◆ get_ini_file_name()

static WCHAR * get_ini_file_name ( MSIPACKAGE package,
MSIRECORD row 
)
static

Definition at line 4328 of file action.c.

4329{
4330 WCHAR *filename, *ptr, *folder, *ret;
4331 const WCHAR *dirprop;
4332
4334 if (filename && (ptr = wcschr( filename, '|' )))
4335 ptr++;
4336 else
4337 ptr = filename;
4338
4339 dirprop = MSI_RecordGetString( row, 3 );
4340 if (dirprop)
4341 {
4342 folder = strdupW( msi_get_target_folder( package, dirprop ) );
4343 if (!folder) folder = msi_dup_property( package->db, dirprop );
4344 }
4345 else
4346 folder = msi_dup_property( package->db, L"WindowsFolder" );
4347
4348 if (!folder)
4349 {
4350 ERR("Unable to resolve folder %s\n", debugstr_w(dirprop));
4351 msi_free( filename );
4352 return NULL;
4353 }
4354
4356
4357 msi_free( filename );
4358 msi_free( folder );
4359 return ret;
4360}
WCHAR *WINAPIV msi_build_directory_name(DWORD count,...)
Definition: action.c:2008
const WCHAR * msi_get_target_folder(MSIPACKAGE *package, const WCHAR *name)
Definition: install.c:232
WCHAR * msi_dup_record_field(MSIRECORD *row, INT index) DECLSPEC_HIDDEN
Definition: record.c:1002
Definition: fci.c:116

Referenced by ITERATE_RemoveIniValuesOnInstall(), ITERATE_RemoveIniValuesOnUninstall(), and ITERATE_WriteIniValues().

◆ get_install_location()

static WCHAR * get_install_location ( MSIPACKAGE package)
static

Definition at line 2162 of file action.c.

2163{
2164 HKEY hkey;
2165 WCHAR *path;
2166
2167 if (!package->ProductCode) return NULL;
2168 if (MSIREG_OpenInstallProps( package->ProductCode, package->Context, NULL, &hkey, FALSE )) return NULL;
2169 if ((path = msi_reg_get_val_str( hkey, L"InstallLocation" )) && !path[0])
2170 {
2171 msi_free( path );
2172 path = NULL;
2173 }
2174 RegCloseKey( hkey );
2175 return path;
2176}

Referenced by msi_resolve_target_folder().

◆ get_link_file()

static WCHAR * get_link_file ( MSIPACKAGE package,
MSIRECORD row 
)
static

Definition at line 3680 of file action.c.

3681{
3682 LPCWSTR directory, extension, link_folder;
3683 LPWSTR link_file, filename;
3684
3686 link_folder = msi_get_target_folder( package, directory );
3687 if (!link_folder)
3688 {
3689 ERR("unable to resolve folder %s\n", debugstr_w(directory));
3690 return NULL;
3691 }
3692 /* may be needed because of a bug somewhere else */
3693 msi_create_full_path( package, link_folder );
3694
3697
3698 extension = wcsrchr( filename, '.' );
3699 if (!extension || wcsicmp( extension, L".lnk" ))
3700 {
3701 int len = lstrlenW( filename );
3702 filename = msi_realloc( filename, len * sizeof(WCHAR) + sizeof(L".lnk") );
3703 memcpy( filename + len, L".lnk", sizeof(L".lnk") );
3704 }
3705 link_file = msi_build_directory_name( 2, link_folder, filename );
3706 msi_free( filename );
3707
3708 return link_file;
3709}
#define wcsicmp
Definition: compat.h:15
BOOL msi_create_full_path(MSIPACKAGE *package, const WCHAR *path)
Definition: files.c:202
void msi_reduce_to_long_filename(WCHAR *filename)
Definition: files.c:1074
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static void * msi_realloc(void *mem, size_t len) __WINE_ALLOC_SIZE(2)
Definition: msipriv.h:1154

Referenced by ITERATE_CreateShortcuts(), and ITERATE_RemoveShortcuts().

◆ get_registry_view()

static REGSAM get_registry_view ( const MSICOMPONENT comp)
inlinestatic

Definition at line 2486 of file action.c.

2487{
2488 REGSAM view = 0;
2489 if (is_wow64 || is_64bit)
2491 return view;
2492}
BOOL is_wow64
Definition: msi.c:54
@ msidbComponentAttributes64bit
Definition: msidefs.h:168
static const BOOL is_64bit
Definition: msipriv.h:44
#define KEY_WOW64_32KEY
Definition: cmtypes.h:45
#define KEY_WOW64_64KEY
Definition: cmtypes.h:46

Referenced by delete_key(), and open_key().

◆ get_root_key()

static const WCHAR * get_root_key ( MSIPACKAGE package,
INT  root,
HKEY root_key 
)
static

Definition at line 2444 of file action.c.

2445{
2446 const WCHAR *ret;
2447
2448 switch (root)
2449 {
2450 case -1:
2451 if (msi_get_property_int( package->db, L"ALLUSERS", 0 ))
2452 {
2453 *root_key = HKEY_LOCAL_MACHINE;
2454 ret = L"HKEY_LOCAL_MACHINE\\";
2455 }
2456 else
2457 {
2458 *root_key = HKEY_CURRENT_USER;
2459 ret = L"HKEY_CURRENT_USER\\";
2460 }
2461 break;
2462 case 0:
2463 *root_key = HKEY_CLASSES_ROOT;
2464 ret = L"HKEY_CLASSES_ROOT\\";
2465 break;
2466 case 1:
2467 *root_key = HKEY_CURRENT_USER;
2468 ret = L"HKEY_CURRENT_USER\\";
2469 break;
2470 case 2:
2471 *root_key = HKEY_LOCAL_MACHINE;
2472 ret = L"HKEY_LOCAL_MACHINE\\";
2473 break;
2474 case 3:
2475 *root_key = HKEY_USERS;
2476 ret = L"HKEY_USERS\\";
2477 break;
2478 default:
2479 ERR("Unknown root %i\n", root);
2480 return NULL;
2481 }
2482
2483 return ret;
2484}
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define HKEY_USERS
Definition: winreg.h:13

Referenced by ITERATE_RemoveRegistryValuesOnInstall(), ITERATE_RemoveRegistryValuesOnUninstall(), and ITERATE_WriteRegistryValues().

◆ get_shared_dlls_count()

static UINT get_shared_dlls_count ( MSICOMPONENT comp)
static

Definition at line 3207 of file action.c.

3208{
3209 DWORD count, type, sz = sizeof(count);
3210 HKEY hkey = open_shared_dlls_key( comp, FALSE, KEY_READ );
3211 if (RegQueryValueExW( hkey, comp->FullKeypath, NULL, &type, (BYTE *)&count, &sz )) count = 0;
3212 RegCloseKey( hkey );
3213 return count;
3214}
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
static HKEY open_shared_dlls_key(MSICOMPONENT *comp, BOOL create, REGSAM access)
Definition: action.c:3201
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define KEY_READ
Definition: nt_native.h:1023

Referenced by refcount_component().

◆ get_volume_space_required()

static ULONGLONG get_volume_space_required ( MSIPACKAGE package)
static

Definition at line 2222 of file action.c.

2223{
2224 MSICOMPONENT *comp;
2225 ULONGLONG ret = 0;
2226
2228 {
2229 if (comp->Action == INSTALLSTATE_LOCAL) ret += comp->Cost;
2230 }
2231 return ret;
2232}
INSTALLSTATE Action
Definition: msipriv.h:533

Referenced by ACTION_CostFinalize().

◆ is_feature_selected()

static BOOL is_feature_selected ( MSIFEATURE feature,