ReactOS 0.4.16-dev-340-g0540c21
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  package_feature
 
struct  typelib
 

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, const WCHAR *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 load_library (MSIPACKAGE *package, const WCHAR *filename, DWORD flags)
 
static HRESULT 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 publish_icons (MSIPACKAGE *package)
 
static UINT publish_sourcelist (MSIPACKAGE *package, HKEY hkey)
 
static UINT publish_product_properties (MSIPACKAGE *package, HKEY hkey)
 
static UINT publish_upgrade_code (MSIPACKAGE *package)
 
static BOOL check_publish (MSIPACKAGE *package)
 
static BOOL check_unpublish (MSIPACKAGE *package)
 
static UINT 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 unpublish_feature (MSIPACKAGE *package, MSIFEATURE *feature)
 
static UINT ACTION_UnpublishFeatures (MSIPACKAGE *package)
 
static UINT 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 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 const WCHAR ** service_args_to_vector (WCHAR *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 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 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 6718 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 6710 of file action.c.

◆ ENV_ACT_REMOVEMATCH

#define ENV_ACT_REMOVEMATCH   0x8

Definition at line 6711 of file action.c.

◆ ENV_ACT_SETABSENT

#define ENV_ACT_SETABSENT   0x2

Definition at line 6709 of file action.c.

◆ ENV_ACT_SETALWAYS

#define ENV_ACT_SETALWAYS   0x1

Definition at line 6708 of file action.c.

◆ ENV_MOD_APPEND

#define ENV_MOD_APPEND   0x40000000

Definition at line 6714 of file action.c.

◆ ENV_MOD_MACHINE

#define ENV_MOD_MACHINE   0x20000000

Definition at line 6713 of file action.c.

◆ ENV_MOD_MASK

#define ENV_MOD_MASK   0xC0000000

Definition at line 6716 of file action.c.

◆ ENV_MOD_PREFIX

#define ENV_MOD_PREFIX   0x80000000

Definition at line 6715 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 2605 of file action.c.

2606{
2610};
@ JOIN_OP_PREPEND
Definition: action.c:2608
@ JOIN_OP_APPEND
Definition: action.c:2607
@ JOIN_OP_REPLACE
Definition: action.c:2609

◆ 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 101 of file action.c.

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

Function Documentation

◆ ACTION_AllocateRegistrySpace()

static UINT ACTION_AllocateRegistrySpace ( MSIPACKAGE package)
static

Definition at line 7227 of file action.c.

7228{
7229 MSIRECORD *uirow;
7230 int space = msi_get_property_int( package->db, L"AVAILABLEFREEREG", 0 );
7231
7232 TRACE("%p %d kilobytes\n", package, space);
7233
7234 uirow = MSI_CreateRecord( 1 );
7235 MSI_RecordSetInteger( uirow, 1, space );
7237 msiobj_release( &uirow->hdr );
7238
7239 return ERROR_SUCCESS;
7240}
#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)
Definition: record.c:280
int msi_get_property_int(MSIDATABASE *package, LPCWSTR prop, int def)
Definition: package.c:2305
INT MSI_ProcessMessage(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *)
Definition: package.c:1909
MSIRECORD * MSI_CreateRecord(UINT)
Definition: record.c:76
#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 7450 of file action.c.

7451{
7452 MSIQUERY *view;
7453 UINT r;
7454
7455 r = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `BindImage`", &view );
7456 if (r == ERROR_SUCCESS)
7457 {
7459 msiobj_release( &view->hdr );
7460 }
7461 return ERROR_SUCCESS;
7462}
#define NULL
Definition: types.h:112
static UINT ITERATE_BindImage(MSIRECORD *rec, LPVOID param)
Definition: action.c:7412
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **)
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID)
Definition: msiquery.c:163
unsigned int UINT
Definition: ndis.h:50

◆ ACTION_CostFinalize()

static UINT ACTION_CostFinalize ( MSIPACKAGE package)
static

Definition at line 2232 of file action.c.

2233{
2234 MSICOMPONENT *comp;
2235 MSIQUERY *view;
2236 WCHAR *level, *primary_key, *primary_folder;
2237 UINT rc;
2238
2239 TRACE("Building directory properties\n");
2240 msi_resolve_target_folder( package, L"TARGETDIR", TRUE );
2241
2242 TRACE("Evaluating component conditions\n");
2244 {
2245 if (MSI_EvaluateConditionW( package, comp->Condition ) == MSICONDITION_FALSE)
2246 {
2247 TRACE("Disabling component %s\n", debugstr_w(comp->Component));
2248 comp->Enabled = FALSE;
2249 }
2250 else
2251 comp->Enabled = TRUE;
2252 }
2253 get_client_counts( package );
2254
2255 /* read components states from the registry */
2258
2259 if (!process_overrides( package, msi_get_property_int( package->db, L"INSTALLLEVEL", 1 ) ))
2260 {
2261 TRACE("Evaluating feature conditions\n");
2262
2263 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Condition`", &view );
2264 if (rc == ERROR_SUCCESS)
2265 {
2267 msiobj_release( &view->hdr );
2268 if (rc != ERROR_SUCCESS)
2269 return rc;
2270 }
2271 }
2272
2273 TRACE("Calculating file cost\n");
2274 calculate_file_cost( package );
2275
2276 msi_set_property( package->db, L"CostingComplete", L"1", -1 );
2277 /* set default run level if not set */
2278 level = msi_dup_property( package->db, L"INSTALLLEVEL" );
2279 if (!level) msi_set_property( package->db, L"INSTALLLEVEL", L"1", -1 );
2280 free(level);
2281
2282 if ((rc = MSI_SetFeatureStates( package ))) return rc;
2283
2284 if ((primary_key = msi_dup_property( package->db, L"PRIMARYFOLDER" )))
2285 {
2286 if ((primary_folder = msi_dup_property( package->db, primary_key )))
2287 {
2288 if (((primary_folder[0] >= 'A' && primary_folder[0] <= 'Z') ||
2289 (primary_folder[0] >= 'a' && primary_folder[0] <= 'z')) && primary_folder[1] == ':')
2290 {
2292 ULONGLONG required;
2293 WCHAR buf[21];
2294
2295 primary_folder[2] = 0;
2296 if (GetDiskFreeSpaceExW( primary_folder, &free, NULL, NULL ))
2297 {
2298#ifdef __REACTOS__
2299 swprintf(buf, ARRAY_SIZE(buf), L"%I64u", free.QuadPart / 512);
2300#else
2301 swprintf( buf, ARRAY_SIZE(buf), L"%lu", free.QuadPart / 512 );
2302#endif
2303 msi_set_property( package->db, L"PrimaryVolumeSpaceAvailable", buf, -1 );
2304 }
2305 required = get_volume_space_required( package );
2306#ifdef __REACTOS__
2307 swprintf( buf, ARRAY_SIZE(buf), L"%I64u", required );
2308#else
2309 swprintf( buf, ARRAY_SIZE(buf), L"%lu", required );
2310#endif
2311 msi_set_property( package->db, L"PrimaryVolumeSpaceRequired", buf, -1 );
2312
2313#ifdef __REACTOS__
2314 swprintf( buf, ARRAY_SIZE(buf), L"%I64u", (free.QuadPart / 512) - required );
2315#else
2316 swprintf( buf, ARRAY_SIZE(buf), L"%lu", (free.QuadPart / 512) - required );
2317#endif
2318 msi_set_property( package->db, L"PrimaryVolumeSpaceRemaining", buf, -1 );
2319 msi_set_property( package->db, L"PrimaryVolumePath", primary_folder, 2 );
2320 }
2321 free( primary_folder );
2322 }
2323 free( primary_key );
2324 }
2325
2326 /* FIXME: check volume disk space */
2327 msi_set_property( package->db, L"OutOfDiskSpace", L"0", -1 );
2328 msi_set_property( package->db, L"OutOfNoRbDiskSpace", L"0", -1 );
2329
2330 return ERROR_SUCCESS;
2331}
#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:1463
static UINT ITERATE_CostFinalizeConditions(MSIRECORD *row, LPVOID param)
Definition: action.c:1903
UINT MSI_SetFeatureStates(MSIPACKAGE *package)
Definition: action.c:1639
static void ACTION_GetFeatureInstallStates(MSIPACKAGE *package)
Definition: action.c:1491
static BOOL process_overrides(MSIPACKAGE *package, int level)
Definition: action.c:1568
static UINT calculate_file_cost(MSIPACKAGE *package)
Definition: action.c:2060
void msi_resolve_target_folder(MSIPACKAGE *package, const WCHAR *name, BOOL load_prop)
Definition: action.c:2176
static void get_client_counts(MSIPACKAGE *package)
Definition: action.c:1442
static ULONGLONG get_volume_space_required(MSIPACKAGE *package)
Definition: action.c:2220
#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
MSICONDITION MSI_EvaluateConditionW(MSIPACKAGE *, LPCWSTR)
UINT msi_set_property(MSIDATABASE *, const WCHAR *, const WCHAR *, int)
Definition: package.c:2100
WCHAR * msi_dup_property(MSIDATABASE *db, const WCHAR *prop)
@ MSICONDITION_FALSE
Definition: msiquery.h:26
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
LPWSTR Component
Definition: msipriv.h:524
LPWSTR Condition
Definition: msipriv.h:528
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 1380 of file action.c.

1381{
1382 msi_set_property( package->db, L"CostingComplete", L"0", -1 );
1383 msi_set_property( package->db, L"ROOTDRIVE", L"C:\\", -1 );
1384
1385 load_all_folders( package );
1386 msi_load_all_components( package );
1387 msi_load_all_features( package );
1388 load_all_files( package );
1389 load_all_patches( package );
1390 mark_patched_components( package );
1391 load_all_media( package );
1392
1393 return ERROR_SUCCESS;
1394}
static void mark_patched_components(MSIPACKAGE *package)
Definition: action.c:1227
UINT msi_load_all_components(MSIPACKAGE *package)
Definition: action.c:807
static UINT load_all_files(MSIPACKAGE *package)
Definition: action.c:1096
static UINT load_all_media(MSIPACKAGE *package)
Definition: action.c:1126
UINT msi_load_all_features(MSIPACKAGE *package)
Definition: action.c:950
static UINT load_all_patches(MSIPACKAGE *package)
Definition: action.c:1192
static UINT load_all_folders(MSIPACKAGE *package)
Definition: action.c:1357

◆ ACTION_CreateFolders()

static UINT ACTION_CreateFolders ( MSIPACKAGE package)
static

Definition at line 681 of file action.c.

682{
683 MSIQUERY *view;
684 UINT rc;
685
686 if (package->script == SCRIPT_NONE)
687 return msi_schedule_action(package, SCRIPT_INSTALL, L"CreateFolders");
688
689 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `CreateFolder`", &view );
690 if (rc != ERROR_SUCCESS)
691 return ERROR_SUCCESS;
692
694 msiobj_release(&view->hdr);
695 return rc;
696}
static UINT ITERATE_CreateFolders(MSIRECORD *row, LPVOID param)
Definition: action.c:631
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 3849 of file action.c.

3850{
3851 MSIQUERY *view;
3852 HRESULT res;
3853 UINT rc;
3854
3855 if (package->script == SCRIPT_NONE)
3856 return msi_schedule_action(package, SCRIPT_INSTALL, L"CreateShortcuts");
3857
3858 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `Shortcut`", &view);
3859 if (rc != ERROR_SUCCESS)
3860 return ERROR_SUCCESS;
3861
3862 res = CoInitialize( NULL );
3863
3865 msiobj_release(&view->hdr);
3866
3868 return rc;
3869}
static UINT ITERATE_CreateShortcuts(MSIRECORD *row, LPVOID param)
Definition: action.c:3733
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 6258 of file action.c.

6259{
6260 MSIQUERY *view;
6261 UINT rc;
6262
6263 if (package->script == SCRIPT_NONE)
6264 return msi_schedule_action(package, SCRIPT_INSTALL, L"DeleteServices");
6265
6266 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `ServiceControl`", &view );
6267 if (rc != ERROR_SUCCESS)
6268 return ERROR_SUCCESS;
6269
6271 msiobj_release( &view->hdr );
6272 return rc;
6273}
static UINT ITERATE_DeleteService(MSIRECORD *rec, LPVOID param)
Definition: action.c:6192

◆ ACTION_DisableRollback()

static UINT ACTION_DisableRollback ( MSIPACKAGE package)
static

Definition at line 7242 of file action.c.

7243{
7244 TRACE("%p\n", package);
7245
7246 msi_set_property( package->db, L"RollbackDisabled", L"1", -1 );
7247 return ERROR_SUCCESS;
7248}

◆ ACTION_ExecuteAction()

static UINT ACTION_ExecuteAction ( MSIPACKAGE package)
static

Definition at line 5375 of file action.c.

5376{
5377 WCHAR *productname;
5378 WCHAR *action;
5379 WCHAR *info_template;
5380 MSIQUERY *view;
5381 MSIRECORD *uirow, *uirow_info;
5382 UINT rc;
5383
5384 /* Send COMMONDATA and INFO messages. */
5385 /* FIXME: when should these messages be sent? [see also MsiOpenPackage()] */
5386 uirow = MSI_CreateRecord(3);
5387 if (!uirow) return ERROR_OUTOFMEMORY;
5388 MSI_RecordSetStringW(uirow, 0, NULL);
5389 MSI_RecordSetInteger(uirow, 1, 0);
5390 MSI_RecordSetInteger(uirow, 2, package->num_langids ? package->langids[0] : 0);
5393 /* FIXME: send INSTALLMESSAGE_PROGRESS */
5395
5396 if (!(needs_ui_sequence(package) && ui_sequence_exists(package)))
5397 {
5398 uirow_info = MSI_CreateRecord(0);
5399 if (!uirow_info)
5400 {
5401 msiobj_release(&uirow->hdr);
5402 return ERROR_OUTOFMEMORY;
5403 }
5404 info_template = msi_get_error_message(package->db, MSIERR_INFO_LOGGINGSTART);
5405 MSI_RecordSetStringW(uirow_info, 0, info_template);
5406 free(info_template);
5408 msiobj_release(&uirow_info->hdr);
5409 }
5410
5412
5413 productname = msi_dup_property(package->db, INSTALLPROPERTY_PRODUCTNAMEW);
5414 MSI_RecordSetInteger(uirow, 1, 1);
5415 MSI_RecordSetStringW(uirow, 2, productname);
5416 MSI_RecordSetStringW(uirow, 3, NULL);
5418 msiobj_release(&uirow->hdr);
5419
5421
5422 action = msi_dup_property(package->db, L"EXECUTEACTION");
5423 if (!action) action = msi_strdupW(L"INSTALL", ARRAY_SIZE(L"INSTALL") - 1);
5424
5425 /* Perform the action. Top-level actions trigger a sequence. */
5426 if (!wcscmp(action, L"INSTALL"))
5427 {
5428 /* Send ACTIONSTART/INFO and INSTALLSTART. */
5429 ui_actionstart(package, L"INSTALL", NULL, NULL);
5430 ui_actioninfo(package, L"INSTALL", TRUE, 0);
5431 uirow = MSI_CreateRecord(2);
5432 if (!uirow)
5433 {
5434 rc = ERROR_OUTOFMEMORY;
5435 goto end;
5436 }
5437 MSI_RecordSetStringW(uirow, 0, NULL);
5438 MSI_RecordSetStringW(uirow, 1, productname);
5439 MSI_RecordSetStringW(uirow, 2, package->ProductCode);
5441 msiobj_release(&uirow->hdr);
5442
5443 /* Perform the installation. Always use the ExecuteSequence. */
5444 package->InWhatSequence |= SEQUENCE_EXEC;
5445 rc = ACTION_ProcessExecSequence(package);
5446
5447 /* Send return value and INSTALLEND. */
5448 ui_actioninfo(package, L"INSTALL", FALSE, !rc);
5449 uirow = MSI_CreateRecord(3);
5450 if (!uirow)
5451 {
5452 rc = ERROR_OUTOFMEMORY;
5453 goto end;
5454 }
5455 MSI_RecordSetStringW(uirow, 0, NULL);
5456 MSI_RecordSetStringW(uirow, 1, productname);
5457 MSI_RecordSetStringW(uirow, 2, package->ProductCode);
5458 MSI_RecordSetInteger(uirow, 3, !rc);
5460 msiobj_release(&uirow->hdr);
5461 }
5462 else
5463 rc = ACTION_PerformAction(package, action);
5464
5465 /* Send all set properties. */
5466 if (!MSI_OpenQuery(package->db, &view, L"SELECT * FROM `_Property`"))
5467 {
5469 msiobj_release(&view->hdr);
5470 }
5471
5472 /* And finally, toggle the cancel off and on. */
5473 uirow = MSI_CreateRecord(2);
5474 if (!uirow)
5475 {
5476 rc = ERROR_OUTOFMEMORY;
5477 goto end;
5478 }
5479 MSI_RecordSetStringW(uirow, 0, NULL);
5480 MSI_RecordSetInteger(uirow, 1, 2);
5481 MSI_RecordSetInteger(uirow, 2, 0);
5483 MSI_RecordSetInteger(uirow, 2, 1);
5485 msiobj_release(&uirow->hdr);
5486
5487end:
5488 free(productname);
5489 free(action);
5490 return rc;
5491}
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
static void ui_actioninfo(MSIPACKAGE *package, const WCHAR *action, BOOL start, INT rc)
Definition: action.c:79
const WCHAR * action
Definition: action.c:7509
static UINT ACTION_ProcessExecSequence(MSIPACKAGE *package)
Definition: action.c:466
static BOOL needs_ui_sequence(MSIPACKAGE *package)
Definition: action.c:389
static BOOL ui_sequence_exists(MSIPACKAGE *package)
Definition: action.c:339
UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action)
Definition: action.c:7640
static UINT iterate_properties(MSIRECORD *record, void *param)
Definition: action.c:5361
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
UINT msi_get_string_table_codepage(const string_table *st)
Definition: string.c:671
INT MSI_ProcessMessageVerbatim(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *)
Definition: package.c:1843
UINT WINAPIV MSI_OpenQuery(MSIDATABASE *, MSIQUERY **, LPCWSTR,...)
Definition: msiquery.c:138
WCHAR * msi_strdupW(const WCHAR *value, int len)
Definition: record.c:155
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR)
Definition: record.c:597
WCHAR * msi_get_error_message(MSIDATABASE *, int)
Definition: package.c:1818
#define SEQUENCE_EXEC
Definition: msipriv.h:719
#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 1437 of file action.c.

1438{
1439 return ERROR_SUCCESS;
1440}

◆ ACTION_ForceReboot()

UINT ACTION_ForceReboot ( MSIPACKAGE package)

Definition at line 5219 of file action.c.

5220{
5221 WCHAR buffer[256], sysdir[MAX_PATH], squashed_pc[SQUASHED_GUID_SIZE];
5222 HKEY hkey;
5223
5224 squash_guid( package->ProductCode, squashed_pc );
5225
5226 GetSystemDirectoryW(sysdir, ARRAY_SIZE(sysdir));
5227 RegCreateKeyW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce", &hkey);
5228 swprintf(buffer, ARRAY_SIZE(buffer), L"%s\\MsiExec.exe /@ \"%s\"", sysdir, squashed_pc);
5229
5230 msi_reg_set_val_str( hkey, squashed_pc, buffer );
5231 RegCloseKey(hkey);
5232
5233 TRACE("Reboot command %s\n",debugstr_w(buffer));
5234
5235 RegCreateKeyW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Installer\\RunOnceEntries",
5236 &hkey);
5237 swprintf( buffer, ARRAY_SIZE(buffer), L"/I \"%s\" AFTERREBOOT=1 RUNONCEENTRY=\"%s\"", package->ProductCode,
5238 squashed_pc );
5239
5240 msi_reg_set_val_str( hkey, squashed_pc, buffer );
5241 RegCloseKey(hkey);
5242
5243 return ERROR_INSTALL_SUSPEND;
5244}
#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)
Definition: registry.c:74
LONG msi_reg_set_val_str(HKEY hkey, LPCWSTR name, LPCWSTR value)
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 1463 of file action.c.

1464{
1465 MSICOMPONENT *comp;
1466 UINT r;
1467
1469 {
1470 if (!comp->ComponentId) continue;
1471
1474 &comp->Installed );
1475 if (r == ERROR_SUCCESS) continue;
1476
1479 &comp->Installed );
1480 if (r == ERROR_SUCCESS) continue;
1481
1484 &comp->Installed );
1485 if (r == ERROR_SUCCESS) continue;
1486
1488 }
1489}
UINT WINAPI MsiQueryComponentStateW(LPCWSTR szProductCode, LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, LPCWSTR szComponent, INSTALLSTATE *pdwState)
Definition: msi.c:2140
@ 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:525
INSTALLSTATE Installed
Definition: msipriv.h:530

Referenced by ACTION_CostFinalize().

◆ ACTION_GetFeatureInstallStates()

static void ACTION_GetFeatureInstallStates ( MSIPACKAGE package)
static

Definition at line 1491 of file action.c.

1492{
1494
1496 {
1498
1500 feature->Installed = INSTALLSTATE_ABSENT;
1501 else
1502 feature->Installed = state;
1503 }
1504}
static int state
Definition: maze.c:121
INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
Definition: msi.c:3062
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 512 of file action.c.

513{
514 UINT arc;
515 INT uirc;
516
517 uirc = ui_actionstart(package, action, NULL, NULL);
518 if (uirc == IDCANCEL)
520 ui_actioninfo(package, action, TRUE, 0);
521 arc = ACTION_CustomAction(package, action);
522 uirc = !arc;
523
524 if (arc == ERROR_FUNCTION_NOT_CALLED && needs_ui_sequence(package))
525 {
526 uirc = ACTION_ShowDialog(package, action);
527 switch (uirc)
528 {
529 case -1:
530 return ERROR_SUCCESS; /* stop immediately */
531 case 0: arc = ERROR_FUNCTION_NOT_CALLED; break;
532 case 1: arc = ERROR_SUCCESS; break;
533 case 2: arc = ERROR_INSTALL_USEREXIT; break;
534 case 3: arc = ERROR_INSTALL_FAILURE; break;
535 case 4: arc = ERROR_INSTALL_SUSPEND; break;
536 case 5: arc = ERROR_MORE_DATA; break;
537 case 6: arc = ERROR_INVALID_HANDLE_STATE; break;
538 case 7: arc = ERROR_INVALID_DATA; break;
539 case 8: arc = ERROR_INSTALL_ALREADY_RUNNING; break;
540 case 9: arc = ERROR_INSTALL_PACKAGE_REJECTED; break;
541 default: arc = ERROR_FUNCTION_FAILED; break;
542 }
543 }
544
545 ui_actioninfo(package, action, FALSE, uirc);
546
547 return arc;
548}
#define ERROR_MORE_DATA
Definition: dderror.h:13
UINT ACTION_CustomAction(MSIPACKAGE *package, const WCHAR *action)
Definition: custom.c:1485
INT ACTION_ShowDialog(MSIPACKAGE *package, const WCHAR *dialog)
Definition: dialog.c:4454
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 7597 of file action.c.

7598{
7600 UINT i;
7601
7602 i = 0;
7603 while (StandardActions[i].action != NULL)
7604 {
7606 {
7607 WCHAR description[100] = {0}, template[100] = {0};
7608
7609 if (StandardActions[i].description != 0)
7611 if (StandardActions[i].template != 0)
7612 LoadStringW(msi_hInstance, StandardActions[i].template, (LPWSTR)&template, 100);
7613
7614 ui_actionstart(package, action, description, template);
7616 {
7617 ui_actioninfo( package, action, TRUE, 0 );
7618 rc = StandardActions[i].handler( package );
7619 ui_actioninfo( package, action, FALSE, !rc );
7620
7622 {
7623 TRACE("scheduling rollback action\n");
7625 }
7626 }
7627 else
7628 {
7629 FIXME("unhandled standard action %s\n", debugstr_w(action));
7630 rc = ERROR_SUCCESS;
7631 }
7632 break;
7633 }
7634 i++;
7635 }
7636
7637 return rc;
7638}
#define FIXME(fmt,...)
Definition: precomp.h:53
static const struct @499 StandardActions[]
const UINT description
Definition: action.c:7510
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7512
const WCHAR * action_rollback
Definition: action.c:7513
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 5493 of file action.c.

5494{
5495 msi_set_property(package->db, L"EXECUTEACTION", L"INSTALL", -1);
5496 if (needs_ui_sequence(package) && ui_sequence_exists(package))
5497 {
5498 package->InWhatSequence |= SEQUENCE_UI;
5499 return ACTION_ProcessUISequence(package);
5500 }
5501 else
5502 return ACTION_ExecuteAction(package);
5503}
static UINT ACTION_ProcessUISequence(MSIPACKAGE *package)
Definition: action.c:492
static UINT ACTION_ExecuteAction(MSIPACKAGE *package)
Definition: action.c:5375
#define SEQUENCE_UI
Definition: msipriv.h:718

◆ ACTION_InstallAdminPackage()

static UINT ACTION_InstallAdminPackage ( MSIPACKAGE package)
static

Definition at line 7250 of file action.c.

7251{
7252 FIXME("%p\n", package);
7253 return ERROR_SUCCESS;
7254}

◆ ACTION_InstallExecute()

static UINT ACTION_InstallExecute ( MSIPACKAGE package)
static

Definition at line 5033 of file action.c.

5034{
5035 return execute_script(package, SCRIPT_INSTALL);
5036}
static UINT execute_script(MSIPACKAGE *package, UINT script)
Definition: action.c:1396

◆ ACTION_InstallFinalize()

static UINT ACTION_InstallFinalize ( MSIPACKAGE package)
static

Definition at line 5159 of file action.c.

5160{
5161 UINT rc;
5162 MSIFILE *file;
5163 MSIFILEPATCH *patch;
5164
5165 /* first do the same as an InstallExecute */
5166 rc = execute_script(package, SCRIPT_INSTALL);
5167 if (rc != ERROR_SUCCESS)
5168 return rc;
5169
5170 /* install global assemblies */
5172 {
5173 MSICOMPONENT *comp = file->Component;
5174
5175 if (!msi_is_global_assembly( comp ) || (file->state != msifs_missing && file->state != msifs_overwrite))
5176 continue;
5177
5178 rc = msi_install_assembly( package, comp );
5179 if (rc != ERROR_SUCCESS)
5180 {
5181 ERR("Failed to install assembly\n");
5182 return ERROR_INSTALL_FAILURE;
5183 }
5184 file->state = msifs_installed;
5185 }
5186
5187 /* patch global assemblies */
5189 {
5190 MSICOMPONENT *comp = patch->File->Component;
5191
5192 if (!msi_is_global_assembly( comp ) || !patch->path) continue;
5193
5194 rc = msi_patch_assembly( package, comp->assembly, patch );
5195 if (rc && !(patch->Attributes & msidbPatchAttributesNonVital))
5196 {
5197 ERR("Failed to apply patch to file: %s\n", debugstr_w(patch->File->File));
5198 return rc;
5199 }
5200
5201 if ((rc = msi_install_assembly( package, comp )))
5202 {
5203 ERR("Failed to install patched assembly\n");
5204 return rc;
5205 }
5206 }
5207
5208 /* then handle commit actions */
5209 rc = execute_script(package, SCRIPT_COMMIT);
5210 if (rc != ERROR_SUCCESS)
5211 return rc;
5212
5213 if (is_full_uninstall(package))
5214 rc = ACTION_UnpublishProduct(package);
5215
5216 return rc;
5217}
#define ERR(fmt,...)
Definition: precomp.h:57
BOOL msi_is_global_assembly(MSICOMPONENT *comp)
Definition: action.c:2036
static BOOL is_full_uninstall(MSIPACKAGE *package)
Definition: action.c:5145
static UINT ACTION_UnpublishProduct(MSIPACKAGE *package)
Definition: action.c:5113
UINT msi_patch_assembly(MSIPACKAGE *package, MSIASSEMBLY *assembly, MSIFILEPATCH *patch)
Definition: files.c:726
UINT msi_install_assembly(MSIPACKAGE *package, MSICOMPONENT *comp)
Definition: assembly.c:356
@ msidbPatchAttributesNonVital
Definition: msidefs.h:43
@ SCRIPT_COMMIT
Definition: msipriv.h:386
@ msifs_missing
Definition: msipriv.h:595
@ msifs_installed
Definition: msipriv.h:598
@ msifs_overwrite
Definition: msipriv.h:596
Definition: fci.c:127
MSIASSEMBLY * assembly
Definition: msipriv.h:540
MSIFILE * File
Definition: msipriv.h:626
WCHAR * path
Definition: msipriv.h:632
LPWSTR File
Definition: msipriv.h:606
MSICOMPONENT * Component
Definition: msipriv.h:607
struct list files
Definition: msipriv.h:403
struct list filepatches
Definition: msipriv.h:404

◆ ACTION_InstallInitialize()

static UINT ACTION_InstallInitialize ( MSIPACKAGE package)
static

Definition at line 3060 of file action.c.

3061{
3062 return ERROR_SUCCESS;
3063}

◆ ACTION_InstallODBC()

static UINT ACTION_InstallODBC ( MSIPACKAGE package)
static

Definition at line 6504 of file action.c.

6505{
6506 MSIQUERY *view;
6507 UINT rc;
6508
6509 if (package->script == SCRIPT_NONE)
6510 return msi_schedule_action(package, SCRIPT_INSTALL, L"InstallODBC");
6511
6512 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `ODBCDriver`", &view);
6513 if (rc == ERROR_SUCCESS)
6514 {
6516 msiobj_release(&view->hdr);
6517 if (rc != ERROR_SUCCESS)
6518 return rc;
6519 }
6520 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `ODBCTranslator`", &view);
6521 if (rc == ERROR_SUCCESS)
6522 {
6524 msiobj_release(&view->hdr);
6525 if (rc != ERROR_SUCCESS)
6526 return rc;
6527 }
6528 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `ODBCDataSource`", &view);
6529 if (rc == ERROR_SUCCESS)
6530 {
6532 msiobj_release(&view->hdr);
6533 if (rc != ERROR_SUCCESS)
6534 return rc;
6535 }
6536 return ERROR_SUCCESS;
6537}
static UINT ITERATE_InstallODBCTranslator(MSIRECORD *rec, LPVOID param)
Definition: action.c:6367
static UINT ITERATE_InstallODBCDriver(MSIRECORD *rec, LPVOID param)
Definition: action.c:6275
static UINT ITERATE_InstallODBCDataSource(MSIRECORD *rec, LPVOID param)
Definition: action.c:6450

◆ ACTION_InstallServices()

static UINT ACTION_InstallServices ( MSIPACKAGE package)
static

Definition at line 5847 of file action.c.

5848{
5849 MSIQUERY *view;
5850 UINT rc;
5851
5852 if (package->script == SCRIPT_NONE)
5853 return msi_schedule_action(package, SCRIPT_INSTALL, L"InstallServices");
5854
5855 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `ServiceInstall`", &view);
5856 if (rc != ERROR_SUCCESS)
5857 return ERROR_SUCCESS;
5858
5860 msiobj_release(&view->hdr);
5861 return rc;
5862}
static UINT ITERATE_InstallService(MSIRECORD *rec, LPVOID param)
Definition: action.c:5720

◆ ACTION_InstallSFPCatalogFile()

static UINT ACTION_InstallSFPCatalogFile ( MSIPACKAGE package)
static

Definition at line 7502 of file action.c.

7503{
7504 return unimplemented_action_stub( package, "InstallSFPCatalogFile", L"SFPCatalog" );
7505}
static UINT unimplemented_action_stub(MSIPACKAGE *package, LPCSTR action, LPCWSTR table)
Definition: action.c:7464

◆ ACTION_InstallValidate()

static UINT ACTION_InstallValidate ( MSIPACKAGE package)
static

Definition at line 3066 of file action.c.

3067{
3068 MSICOMPONENT *comp;
3069 DWORD total = 0, count = 0;
3070 MSIQUERY *view;
3072 MSIFILE *file;
3073 UINT rc;
3074
3075 TRACE("InstallValidate\n");
3076
3077 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Registry`", &view );
3078 if (rc == ERROR_SUCCESS)
3079 {
3080 rc = MSI_IterateRecords( view, &count, NULL, package );
3081 msiobj_release( &view->hdr );
3082 if (rc != ERROR_SUCCESS)
3083 return rc;
3085 }
3088
3090 total += file->FileSize;
3091
3092 msi_ui_progress( package, 0, total, 0, 0 );
3093
3095 {
3096 TRACE("Feature: %s Installed %d Request %d Action %d\n",
3097 debugstr_w(feature->Feature), feature->Installed,
3098 feature->ActionRequest, feature->Action);
3099 }
3100 return ERROR_SUCCESS;
3101}
#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:594
#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

◆ ACTION_IsolateComponents()

static UINT ACTION_IsolateComponents ( MSIPACKAGE package)
static

Definition at line 7482 of file action.c.

7483{
7484 return unimplemented_action_stub( package, "IsolateComponents", L"IsolateComponent" );
7485}

◆ ACTION_LaunchConditions()

static UINT ACTION_LaunchConditions ( MSIPACKAGE package)
static

Definition at line 3128 of file action.c.

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

◆ ACTION_MigrateFeatureStates()

static UINT ACTION_MigrateFeatureStates ( MSIPACKAGE package)
static

Definition at line 7379 of file action.c.

7380{
7381 MSIQUERY *view;
7382 UINT r;
7383
7384 if (msi_get_property_int( package->db, L"Installed", 0 ))
7385 {
7386 TRACE("product is installed, skipping action\n");
7387 return ERROR_SUCCESS;
7388 }
7389 if (msi_get_property_int( package->db, L"Preselected", 0 ))
7390 {
7391 TRACE("Preselected property is set, not migrating feature states\n");
7392 return ERROR_SUCCESS;
7393 }
7394 r = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Upgrade`", &view );
7395 if (r == ERROR_SUCCESS)
7396 {
7398 msiobj_release( &view->hdr );
7399 if (r != ERROR_SUCCESS)
7400 return r;
7401 }
7402 return ERROR_SUCCESS;
7403}
static UINT ITERATE_MigrateFeatureStates(MSIRECORD *rec, LPVOID param)
Definition: action.c:7344

◆ ACTION_PerformAction()

UINT ACTION_PerformAction ( MSIPACKAGE package,
const WCHAR action 
)

Definition at line 7640 of file action.c.

7641{
7642 UINT rc;
7643
7644 TRACE("Performing action (%s)\n", debugstr_w(action));
7645
7646 package->action_progress_increment = 0;
7647 rc = ACTION_HandleStandardAction(package, action);
7648
7649 if (rc == ERROR_FUNCTION_NOT_CALLED)
7650 rc = ACTION_HandleCustomAction(package, action);
7651
7652 if (rc == ERROR_FUNCTION_NOT_CALLED)
7653 WARN("unhandled msi action %s\n", debugstr_w(action));
7654
7655 return rc;
7656}
#define WARN(fmt,...)
Definition: precomp.h:61
static UINT ACTION_HandleStandardAction(MSIPACKAGE *package, LPCWSTR action)
Definition: action.c:7597
static UINT ACTION_HandleCustomAction(MSIPACKAGE *package, LPCWSTR action)
Definition: action.c:512
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 7658 of file action.c.

7659{
7660 UINT rc = ERROR_SUCCESS;
7661 MSIRECORD *row;
7662
7663 if (needs_ui_sequence(package))
7664 row = MSI_QueryGetRecord(package->db, L"SELECT * FROM `InstallUISequence` WHERE `Sequence` = %d", seq);
7665 else
7666 row = MSI_QueryGetRecord(package->db, L"SELECT * FROM `InstallExecuteSequence` WHERE `Sequence` = %d", seq);
7667
7668 if (row)
7669 {
7670 LPCWSTR action, cond;
7671
7672 TRACE("Running the actions\n");
7673
7674 /* check conditions */
7675 cond = MSI_RecordGetString(row, 2);
7676
7677 /* this is a hack to skip errors in the condition code */
7678 if (MSI_EvaluateConditionW(package, cond) == MSICONDITION_FALSE)
7679 {
7680 msiobj_release(&row->hdr);
7681 return ERROR_SUCCESS;
7682 }
7683
7685 if (!action)
7686 {
7687 ERR("failed to fetch action\n");
7688 msiobj_release(&row->hdr);
7689 return ERROR_FUNCTION_FAILED;
7690 }
7691
7692 rc = ACTION_PerformAction(package, action);
7693
7694 msiobj_release(&row->hdr);
7695 }
7696
7697 return rc;
7698}
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
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT)
Definition: record.c:433
MSIRECORD *WINAPIV MSI_QueryGetRecord(MSIDATABASE *db, LPCWSTR query,...)
Definition: msiquery.c:201
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by MSI_InstallPackage().

◆ ACTION_ProcessComponents()

static UINT ACTION_ProcessComponents ( MSIPACKAGE package)
static

Definition at line 3311 of file action.c.

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

◆ ACTION_ProcessExecSequence()

static UINT ACTION_ProcessExecSequence ( MSIPACKAGE package)
static

Definition at line 466 of file action.c.

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

Referenced by ACTION_ExecuteAction().

◆ ACTION_ProcessUISequence()

static UINT ACTION_ProcessUISequence ( MSIPACKAGE package)
static

Definition at line 492 of file action.c.

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

Referenced by ACTION_INSTALL().

◆ ACTION_PublishComponents()

static UINT ACTION_PublishComponents ( MSIPACKAGE package)
static

Definition at line 5637 of file action.c.

5638{
5639 MSIQUERY *view;
5640 UINT rc;
5641
5642 if (package->script == SCRIPT_NONE)
5643 return msi_schedule_action(package, SCRIPT_INSTALL, L"PublishComponents");
5644
5645 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `PublishComponent`", &view);
5646 if (rc != ERROR_SUCCESS)
5647 return ERROR_SUCCESS;
5648
5650 msiobj_release(&view->hdr);
5651 return rc;
5652}
static UINT ITERATE_PublishComponent(MSIRECORD *rec, LPVOID param)
Definition: action.c:5533

◆ ACTION_PublishFeatures()

static UINT ACTION_PublishFeatures ( MSIPACKAGE package)
static

Definition at line 4728 of file action.c.

4729{
4731 UINT rc;
4732 HKEY hkey = NULL, userdata = NULL;
4733
4734 if (package->script == SCRIPT_NONE)
4735 return msi_schedule_action(package, SCRIPT_INSTALL, L"PublishFeatures");
4736
4737 if (!check_publish(package))
4738 return ERROR_SUCCESS;
4739
4740 rc = MSIREG_OpenFeaturesKey(package->ProductCode, NULL, package->Context,
4741 &hkey, TRUE);
4742 if (rc != ERROR_SUCCESS)
4743 goto end;
4744
4745 rc = MSIREG_OpenUserDataFeaturesKey(package->ProductCode, NULL, package->Context,
4746 &userdata, TRUE);
4747 if (rc != ERROR_SUCCESS)
4748 goto end;
4749
4750 /* here the guids are base 85 encoded */
4752 {
4753 ComponentList *cl;
4754 LPWSTR data = NULL;
4755 GUID clsid;
4756 INT size;
4757 BOOL absent = FALSE;
4758 MSIRECORD *uirow;
4759
4760 if (feature->Level <= 0) continue;
4761 if (feature->Action == INSTALLSTATE_UNKNOWN &&
4762 feature->Installed != INSTALLSTATE_ABSENT) continue;
4763
4764 if (feature->Action != INSTALLSTATE_LOCAL &&
4765 feature->Action != INSTALLSTATE_SOURCE &&
4766 feature->Action != INSTALLSTATE_ADVERTISED) absent = TRUE;
4767
4768 size = 1;
4769 LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry )
4770 {
4771 size += 21;
4772 }
4773 if (feature->Feature_Parent)
4774 size += lstrlenW( feature->Feature_Parent )+2;
4775
4776 data = malloc(size * sizeof(WCHAR));
4777
4778 data[0] = 0;
4779 LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry )
4780 {
4781 MSICOMPONENT* component = cl->component;
4782 WCHAR buf[21];
4783
4784 buf[0] = 0;
4785 if (component->ComponentId)
4786 {
4787 TRACE("From %s\n",debugstr_w(component->ComponentId));
4788 CLSIDFromString(component->ComponentId, &clsid);
4790 TRACE("to %s\n",debugstr_w(buf));
4791 lstrcatW(data,buf);
4792 }
4793 }
4794
4795 if (feature->Feature_Parent)
4796 {
4797 lstrcatW(data, L"\2");
4798 lstrcatW(data, feature->Feature_Parent);
4799 }
4800
4801 msi_reg_set_val_str( userdata, feature->Feature, data );
4802 free(data);
4803
4804 size = 0;
4805 if (feature->Feature_Parent)
4806 size = lstrlenW(feature->Feature_Parent)*sizeof(WCHAR);
4807 if (!absent)
4808 {
4809 size += sizeof(WCHAR);
4810 RegSetValueExW(hkey, feature->Feature, 0 ,REG_SZ,
4811 (const BYTE*)(feature->Feature_Parent ? feature->Feature_Parent : L""), size);
4812 }
4813 else
4814 {
4815 size += 2*sizeof(WCHAR);
4816 data = malloc(size);
4817 data[0] = 0x6;
4818 data[1] = 0;
4819 if (feature->Feature_Parent)
4820 lstrcpyW( &data[1], feature->Feature_Parent );
4821 RegSetValueExW(hkey,feature->Feature,0,REG_SZ,
4822 (LPBYTE)data,size);
4823 free(data);
4824 }
4825
4826 /* the UI chunk */
4827 uirow = MSI_CreateRecord( 1 );
4828 MSI_RecordSetStringW( uirow, 1, feature->Feature );
4830 msiobj_release( &uirow->hdr );
4831 /* FIXME: call msi_ui_progress? */
4832 }
4833
4834end:
4835 RegCloseKey(hkey);
4836 RegCloseKey(userdata);
4837 return rc;
4838}
#define malloc
Definition: debug_ros.c:4
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 check_publish(MSIPACKAGE *package)
Definition: action.c:4109
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
BOOL encode_base85_guid(GUID *, LPWSTR)
Definition: registry.c:165
UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create)
Definition: registry.c:404
UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create)
Definition: registry.c:472
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 4239 of file action.c.

4240{
4241 UINT rc;
4242 HKEY hukey = NULL, hudkey = NULL;
4243 MSIRECORD *uirow;
4244 BOOL republish = FALSE;
4245
4246 if (package->script == SCRIPT_NONE)
4247 return msi_schedule_action(package, SCRIPT_INSTALL, L"PublishProduct");
4248
4249 if (!list_empty(&package->patches))
4250 {
4251 rc = publish_patches(package);
4252 if (rc != ERROR_SUCCESS)
4253 goto end;
4254 }
4255
4256 rc = MSIREG_OpenProductKey(package->ProductCode, NULL, package->Context,
4257 &hukey, FALSE);
4258 if (rc == ERROR_SUCCESS)
4259 {
4260 WCHAR *package_code;
4261
4263 if (package_code)
4264 {
4265 WCHAR *guid;
4266
4267 guid = msi_get_package_code(package->db);
4268 if (guid)
4269 {
4271
4273 free(guid);
4274 if (!wcscmp(packed, package_code))
4275 {
4276 TRACE("re-publishing product - new package\n");
4277 republish = TRUE;
4278 }
4279 }
4280 free(package_code);
4281 }
4282 }
4283
4284 /* FIXME: also need to publish if the product is in advertise mode */
4285 if (!republish && !check_publish(package))
4286 {
4287 if (hukey)
4288 RegCloseKey(hukey);
4289 return ERROR_SUCCESS;
4290 }
4291
4292 if (!hukey)
4293 {
4294 rc = MSIREG_OpenProductKey(package->ProductCode, NULL, package->Context,
4295 &hukey, TRUE);
4296 if (rc != ERROR_SUCCESS)
4297 goto end;
4298 }
4299
4300 rc = MSIREG_OpenUserDataProductKey(package->ProductCode, package->Context,
4301 NULL, &hudkey, TRUE);
4302 if (rc != ERROR_SUCCESS)
4303 goto end;
4304
4305 rc = publish_upgrade_code(package);
4306 if (rc != ERROR_SUCCESS)
4307 goto end;
4308
4309 rc = publish_product_properties(package, hukey);
4310 if (rc != ERROR_SUCCESS)
4311 goto end;
4312
4313 rc = publish_sourcelist(package, hukey);
4314 if (rc != ERROR_SUCCESS)
4315 goto end;
4316
4317 rc = publish_icons(package);
4318
4319end:
4320 uirow = MSI_CreateRecord( 1 );
4321 MSI_RecordSetStringW( uirow, 1, package->ProductCode );
4323 msiobj_release( &uirow->hdr );
4324
4325 RegCloseKey(hukey);
4326 RegCloseKey(hudkey);
4327 return rc;
4328}
static int list_empty(struct list_entry *head)
Definition: list.h:58
static UINT publish_product_properties(MSIPACKAGE *package, HKEY hkey)
Definition: action.c:4035
static UINT publish_icons(MSIPACKAGE *package)
Definition: action.c:3965
static UINT publish_patches(MSIPACKAGE *package)
Definition: action.c:4137
static UINT publish_upgrade_code(MSIPACKAGE *package)
Definition: action.c:4081
static UINT publish_sourcelist(MSIPACKAGE *package, HKEY hkey)
Definition: action.c:3981
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)
Definition: registry.c:338
WCHAR * msi_get_package_code(MSIDATABASE *db)
Definition: package.c:1277
UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create)
Definition: registry.c:582
WCHAR * msi_reg_get_val_str(HKEY hkey, const WCHAR *name)
struct list patches
Definition: msipriv.h:400

◆ ACTION_RegisterComPlus()

static UINT ACTION_RegisterComPlus ( MSIPACKAGE package)
static

Definition at line 7492 of file action.c.

7493{
7494 return unimplemented_action_stub( package, "RegisterComPlus", L"Complus" );
7495}

◆ ACTION_RegisterProduct()

static UINT ACTION_RegisterProduct ( MSIPACKAGE package)
static

Definition at line 4978 of file action.c.

4979{
4980 WCHAR *upgrade_code, squashed_pc[SQUASHED_GUID_SIZE];
4981 MSIRECORD *uirow;
4982 HKEY hkey, props, upgrade_key;
4983 UINT rc;
4984
4985 if (package->script == SCRIPT_NONE)
4986 return msi_schedule_action(package, SCRIPT_INSTALL, L"RegisterProduct");
4987
4988 /* FIXME: also need to publish if the product is in advertise mode */
4989 if (!msi_get_property_int( package->db, L"ProductToBeRegistered", 0 ) && !check_publish(package))
4990 return ERROR_SUCCESS;
4991
4992 rc = MSIREG_OpenUninstallKey(package->ProductCode, package->platform, &hkey, TRUE);
4993 if (rc != ERROR_SUCCESS)
4994 return rc;
4995
4996 rc = MSIREG_OpenInstallProps(package->ProductCode, package->Context, NULL, &props, TRUE);
4997 if (rc != ERROR_SUCCESS)
4998 goto done;
4999
5000 rc = publish_install_properties(package, hkey);
5001 if (rc != ERROR_SUCCESS)
5002 goto done;
5003
5004 rc = publish_install_properties(package, props);
5005 if (rc != ERROR_SUCCESS)
5006 goto done;
5007
5008 upgrade_code = msi_dup_property(package->db, L"UpgradeCode");
5009 if (upgrade_code)
5010 {
5011 rc = MSIREG_OpenUpgradeCodesKey( upgrade_code, &upgrade_key, TRUE );
5012 if (rc == ERROR_SUCCESS)
5013 {
5014 squash_guid( package->ProductCode, squashed_pc );
5015 msi_reg_set_val_str( upgrade_key, squashed_pc, NULL );
5016 RegCloseKey( upgrade_key );
5017 }
5018 free( upgrade_code );
5019 }
5021 package->delete_on_close = FALSE;
5022
5023done:
5024 uirow = MSI_CreateRecord( 1 );
5025 MSI_RecordSetStringW( uirow, 1, package->ProductCode );
5027 msiobj_release( &uirow->hdr );
5028
5029 RegCloseKey(hkey);
5030 return ERROR_SUCCESS;
5031}
static UINT publish_install_properties(MSIPACKAGE *package, HKEY hkey)
Definition: action.c:4890
static const WCHAR INSTALLPROPERTY_LOCALPACKAGEW[]
Definition: msi.h:343
UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create)
Definition: registry.c:692
UINT MSIREG_OpenUninstallKey(const WCHAR *, enum platform, HKEY *, BOOL)
UINT MSIREG_OpenUpgradeCodesKey(LPCWSTR szProduct, HKEY *key, BOOL create)
Definition: registry.c:783
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 3600 of file action.c.

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

◆ ACTION_RegisterUser()

static UINT ACTION_RegisterUser ( MSIPACKAGE package)
static

Definition at line 5304 of file action.c.

5305{
5306 static const WCHAR szPropKeys[][80] =
5307 {
5308 L"ProductID",
5309 L"USERNAME",
5310 L"COMPANYNAME",
5311 L"",
5312 };
5313 static const WCHAR szRegKeys[][80] =
5314 {
5315 L"ProductID",
5316 L"RegOwner",
5317 L"RegCompany",
5318 L"",
5319 };
5320 HKEY hkey = 0;
5321 LPWSTR buffer, productid = NULL;
5322 UINT i, rc = ERROR_SUCCESS;
5323 MSIRECORD *uirow;
5324
5325 if (package->script == SCRIPT_NONE)
5326 return msi_schedule_action(package, SCRIPT_INSTALL, L"RegisterUser");
5327
5328 if (check_unpublish(package))
5329 {
5331 goto end;
5332 }
5333
5334 productid = msi_dup_property( package->db, INSTALLPROPERTY_PRODUCTIDW );
5335 if (!productid)
5336 goto end;
5337
5338 rc = MSIREG_OpenInstallProps(package->ProductCode, package->Context,
5339 NULL, &hkey, TRUE);
5340 if (rc != ERROR_SUCCESS)
5341 goto end;
5342
5343 for( i = 0; szPropKeys[i][0]; i++ )
5344 {
5345 buffer = msi_dup_property( package->db, szPropKeys[i] );
5346 msi_reg_set_val_str( hkey, szRegKeys[i], buffer );
5347 free( buffer );
5348 }
5349
5350end:
5351 uirow = MSI_CreateRecord( 1 );
5352 MSI_RecordSetStringW( uirow, 1, productid );
5354 msiobj_release( &uirow->hdr );
5355
5356 free(productid);
5357 RegCloseKey(hkey);
5358 return rc;
5359}
static BOOL check_unpublish(MSIPACKAGE *package)
Definition: action.c:4123
static const WCHAR INSTALLPROPERTY_PRODUCTIDW[]
Definition: msi.h:363
UINT MSIREG_DeleteUserDataProductKey(LPCWSTR, MSIINSTALLCONTEXT)
Definition: registry.c:720

◆ ACTION_RemoveEnvironmentStrings()

static UINT ACTION_RemoveEnvironmentStrings ( MSIPACKAGE package)
static

Definition at line 7171 of file action.c.

7172{
7173 MSIQUERY *view;
7174 UINT rc;
7175
7176 if (package->script == SCRIPT_NONE)
7177 return msi_schedule_action(package, SCRIPT_INSTALL, L"RemoveEnvironmentStrings");
7178
7179 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Environment`", &view );
7180 if (rc != ERROR_SUCCESS)
7181 return ERROR_SUCCESS;
7182
7184 msiobj_release( &view->hdr );
7185 return rc;
7186}
static UINT ITERATE_RemoveEnvironmentString(MSIRECORD *rec, LPVOID param)
Definition: action.c:7034

◆ ACTION_RemoveExistingProducts()

static UINT ACTION_RemoveExistingProducts ( MSIPACKAGE package)
static

Definition at line 7328 of file action.c.

7329{
7330 MSIQUERY *view;
7331 UINT r;
7332
7333 r = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `Upgrade`", &view );
7334 if (r == ERROR_SUCCESS)
7335 {
7337 msiobj_release( &view->hdr );
7338 if (r != ERROR_SUCCESS)
7339 return r;
7340 }
7341 return ERROR_SUCCESS;
7342}
static UINT ITERATE_RemoveExistingProducts(MSIRECORD *rec, LPVOID param)
Definition: action.c:7285

◆ ACTION_RemoveFolders()

static UINT ACTION_RemoveFolders ( MSIPACKAGE package)
static

Definition at line 760 of file action.c.

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

◆ ACTION_RemoveIniValues()

static UINT ACTION_RemoveIniValues ( MSIPACKAGE package)
static

Definition at line 4578 of file action.c.

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

◆ ACTION_RemoveODBC()

static UINT ACTION_RemoveODBC ( MSIPACKAGE package)
static

Definition at line 6673 of file action.c.

6674{
6675 MSIQUERY *view;
6676 UINT rc;
6677
6678 if (package->script == SCRIPT_NONE)
6679 return msi_schedule_action(package, SCRIPT_INSTALL, L"RemoveODBC");
6680
6681 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `ODBCDriver`", &view );
6682 if (rc == ERROR_SUCCESS)
6683 {
6685 msiobj_release( &view->hdr );
6686 if (rc != ERROR_SUCCESS)
6687 return rc;
6688 }
6689 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `ODBCTranslator`", &view );
6690 if (rc == ERROR_SUCCESS)
6691 {
6693 msiobj_release( &view->hdr );
6694 if (rc != ERROR_SUCCESS)
6695 return rc;
6696 }
6697 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `ODBCDataSource`", &view );
6698 if (rc == ERROR_SUCCESS)
6699 {
6701 msiobj_release( &view->hdr );
6702 if (rc != ERROR_SUCCESS)
6703 return rc;
6704 }
6705 return ERROR_SUCCESS;
6706}
static UINT ITERATE_RemoveODBCDataSource(MSIRECORD *rec, LPVOID param)
Definition: action.c:6617
static UINT ITERATE_RemoveODBCDriver(MSIRECORD *rec, LPVOID param)
Definition: action.c:6539
static UINT ITERATE_RemoveODBCTranslator(MSIRECORD *rec, LPVOID param)
Definition: action.c:6578

◆ ACTION_RemoveRegistryValues()

static UINT ACTION_RemoveRegistryValues ( MSIPACKAGE package)
static

Definition at line 3033 of file action.c.

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

◆ ACTION_RemoveShortcuts()

static UINT ACTION_RemoveShortcuts ( MSIPACKAGE package)
static

Definition at line 3899 of file action.c.

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

◆ ACTION_ResolveSource()

static UINT ACTION_ResolveSource ( MSIPACKAGE package)
static

Definition at line 5246 of file action.c.

5247{
5248 DWORD attrib;
5249 UINT rc;
5250
5251 /*
5252 * We are currently doing what should be done here in the top level Install
5253 * however for Administrative and uninstalls this step will be needed
5254 */
5255 if (!package->PackagePath)
5256 return ERROR_SUCCESS;
5257
5258 msi_set_sourcedir_props(package, TRUE);
5259
5260 attrib = GetFileAttributesW(package->db->path);
5261 if (attrib == INVALID_FILE_ATTRIBUTES)
5262 {
5264 LPWSTR prompt;
5265 DWORD size = 0;
5266
5267 rc = MsiSourceListGetInfoW(package->ProductCode, NULL,
5268 package->Context, MSICODE_PRODUCT,
5270 if (rc == ERROR_MORE_DATA)
5271 {
5272 prompt = malloc(size * sizeof(WCHAR));
5274 package->Context, MSICODE_PRODUCT,
5276 }
5277 else
5278 prompt = wcsdup(package->db->path);
5279
5282 MSI_RecordSetStringW(record, 2, prompt);
5283 free(prompt);
5284 while(attrib == INVALID_FILE_ATTRIBUTES)
5285 {
5288 if (rc == IDCANCEL)
5289 {
5290 msiobj_release(&record->hdr);
5292 }
5293 attrib = GetFileAttributesW(package->db->path);
5294 }
5295 msiobj_release(&record->hdr);
5296 rc = ERROR_SUCCESS;
5297 }
5298 else
5299 return ERROR_SUCCESS;
5300
5301 return rc;
5302}
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
_Check_return_ _CRTIMP wchar_t *__cdecl wcsdup(_In_z_ const wchar_t *_Str)
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 7487 of file action.c.

7488{
7489 return unimplemented_action_stub( package, "RMCCPSearch", L"CCPSearch" );
7490}

◆ ACTION_ScheduleReboot()

static UINT ACTION_ScheduleReboot ( MSIPACKAGE package)
static

Definition at line 7220 of file action.c.

7221{
7222 TRACE("\n");
7223 package->need_reboot_at_end = 1;
7224 return ERROR_SUCCESS;
7225}
unsigned char need_reboot_at_end
Definition: msipriv.h:469

◆ ACTION_SelfRegModules()

static UINT ACTION_SelfRegModules ( MSIPACKAGE package)
static

Definition at line 4661 of file action.c.

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

◆ ACTION_SelfUnregModules()

static UINT ACTION_SelfUnregModules ( MSIPACKAGE package)
static

Definition at line 4711 of file action.c.

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

◆ ACTION_SetODBCFolders()

static UINT ACTION_SetODBCFolders ( MSIPACKAGE package)
static

Definition at line 7256 of file action.c.

7257{
7258 MSIQUERY *view;
7259 UINT r;
7260 DWORD count;
7261
7262 r = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `ODBCDriver`", &view );
7263 if (r == ERROR_SUCCESS)
7264 {
7265 count = 0;
7266 r = MSI_IterateRecords( view, &count, NULL, package );
7267 msiobj_release( &view->hdr );
7268 if (r != ERROR_SUCCESS)
7269 return r;
7270 if (count) FIXME( "ignored %lu rows in ODBCDriver table\n", count );
7271 }
7272 r = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `ODBCTranslator`", &view );
7273 if (r == ERROR_SUCCESS)
7274 {
7275 count = 0;
7276 r = MSI_IterateRecords( view, &count, NULL, package );
7277 msiobj_release( &view->hdr );
7278 if (r != ERROR_SUCCESS)
7279 return r;
7280 if (count) FIXME( "ignored %lu rows in ODBCTranslator table\n", count );
7281 }
7282 return ERROR_SUCCESS;
7283}

◆ ACTION_StartServices()

static UINT ACTION_StartServices ( MSIPACKAGE package)
static

Definition at line 6016 of file action.c.

6017{
6018 MSIQUERY *view;
6019 UINT rc;
6020
6021 if (package->script == SCRIPT_NONE)
6022 return msi_schedule_action(package, SCRIPT_INSTALL, L"StartServices");
6023
6024 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `ServiceControl`", &view);
6025 if (rc != ERROR_SUCCESS)
6026 return ERROR_SUCCESS;
6027
6029 msiobj_release(&view->hdr);
6030 return rc;
6031}
static UINT ITERATE_StartService(MSIRECORD *rec, LPVOID param)
Definition: action.c:5906

◆ ACTION_StopServices()

static UINT ACTION_StopServices ( MSIPACKAGE package)
static

Definition at line 6175 of file action.c.

6176{
6177 MSIQUERY *view;
6178 UINT rc;
6179
6180 if (package->script == SCRIPT_NONE)
6181 return msi_schedule_action(package, SCRIPT_INSTALL, L"StopServices");
6182
6183 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `ServiceControl`", &view);
6184 if (rc != ERROR_SUCCESS)
6185 return ERROR_SUCCESS;
6186
6188 msiobj_release(&view->hdr);
6189 return rc;
6190}
static UINT ITERATE_StopService(MSIRECORD *rec, LPVOID param)
Definition: action.c:6118

◆ ACTION_UnpublishComponents()

static UINT ACTION_UnpublishComponents ( MSIPACKAGE package)
static

Definition at line 5703 of file action.c.

5704{
5705 MSIQUERY *view;
5706 UINT rc;
5707
5708 if (package->script == SCRIPT_NONE)
5709 return msi_schedule_action(package, SCRIPT_INSTALL, L"UnpublishComponents");
5710
5711 rc = MSI_DatabaseOpenViewW( package->db, L"SELECT * FROM `PublishComponent`", &view );
5712 if (rc != ERROR_SUCCESS)
5713 return ERROR_SUCCESS;
5714
5716 msiobj_release( &view->hdr );
5717 return rc;
5718}
static UINT ITERATE_UnpublishComponent(MSIRECORD *rec, LPVOID param)
Definition: action.c:5654

◆ ACTION_UnpublishFeatures()

static UINT ACTION_UnpublishFeatures ( MSIPACKAGE package)
static

Definition at line 4872 of file action.c.

4873{
4875
4876 if (package->script == SCRIPT_NONE)
4877 return msi_schedule_action(package, SCRIPT_INSTALL, L"UnpublishFeatures");
4878
4879 if (!check_unpublish(package))
4880 return ERROR_SUCCESS;
4881
4883 {
4884 unpublish_feature(package, feature);
4885 }
4886
4887 return ERROR_SUCCESS;
4888}
static UINT unpublish_feature(MSIPACKAGE *package, MSIFEATURE *feature)
Definition: action.c:4840

◆ ACTION_UnpublishProduct()

static UINT ACTION_UnpublishProduct ( MSIPACKAGE package)
static

Definition at line 5113 of file action.c.

5114{
5115 MSIPATCHINFO *patch;
5116
5120
5125
5126 remove_product_upgrade_code( package );
5127
5128 LIST_FOR_EACH_ENTRY(patch, &package->patches, MSIPATCHINFO, entry)
5129 {
5131 if (!wcscmp( package->ProductCode, patch->products ))
5132 {
5133 TRACE("removing local patch package %s\n", debugstr_w(patch->localfile));
5134 patch->delete_on_close = TRUE;
5135 }
5136 /* FIXME: remove local patch package if this is the last product */
5137 }
5138 TRACE("removing local package %s\n", debugstr_w(package->localfile));
5139 package->delete_on_close = TRUE;
5140
5141 unpublish_icons( package );
5142 return ERROR_SUCCESS;
5143}
static void remove_product_upgrade_code(MSIPACKAGE *package)
Definition: action.c:5075
static UINT unpublish_icons(MSIPACKAGE *package)
Definition: action.c:5059
UINT MSIREG_DeleteLocalClassesFeaturesKey(LPCWSTR szProductCode)
Definition: registry.c:858
UINT MSIREG_DeleteUninstallKey(const WCHAR *, enum platform)
UINT MSIREG_DeleteUserProductKey(LPCWSTR szProduct)
Definition: registry.c:378
UINT MSIREG_DeleteLocalClassesProductKey(LPCWSTR szProductCode)
Definition: registry.c:841
UINT MSIREG_DeleteUserFeaturesKey(LPCWSTR szProduct)
Definition: registry.c:445
UINT MSIREG_DeleteProductKey(LPCWSTR szProduct)
Definition: registry.c:751
UINT MSIREG_DeleteUserDataPatchKey(LPCWSTR patch, MSIINSTALLCONTEXT context)
Definition: registry.c:636
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 7497 of file action.c.

7498{
7499 return unimplemented_action_stub( package, "UnregisterComPlus", L"Complus" );
7500}

◆ ACTION_UnregisterTypeLibraries()

static UINT ACTION_UnregisterTypeLibraries ( MSIPACKAGE package)
static

Definition at line 3661 of file action.c.

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

◆ ACTION_ValidateProductID()

static UINT ACTION_ValidateProductID ( MSIPACKAGE package)
static

Definition at line 7215 of file action.c.

7216{
7217 return msi_validate_product_id( package );
7218}
UINT msi_validate_product_id(MSIPACKAGE *package)
Definition: action.c:7188

◆ ACTION_WriteEnvironmentStrings()

static UINT ACTION_WriteEnvironmentStrings ( MSIPACKAGE package)
static

Definition at line 7017 of file action.c.

7018{
7019 MSIQUERY *view;
7020 UINT rc;
7021
7022 if (package->script == SCRIPT_NONE)
7023 return msi_schedule_action(package, SCRIPT_INSTALL, L"WriteEnvironmentStrings");
7024
7025 rc = MSI_DatabaseOpenViewW(package->db, L"SELECT * FROM `Environment`", &view);
7026 if (rc != ERROR_SUCCESS)
7027 return ERROR_SUCCESS;
7028
7030 msiobj_release(&view->hdr);
7031 return rc;
7032}
static UINT ITERATE_WriteEnvironmentString(MSIRECORD *rec, LPVOID param)
Definition: action.c:6825

◆ ACTION_WriteIniValues()

static UINT ACTION_WriteIniValues ( MSIPACKAGE package)
static

Definition at line 4438 of file action.c.

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

◆ ACTION_WriteRegistryValues()

static UINT ACTION_WriteRegistryValues ( MSIPACKAGE package)
static

Definition at line 2804 of file action.c.

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

◆ add_feature_child()

static UINT add_feature_child ( MSIFEATURE parent,
MSIFEATURE child 
)
static

Definition at line 837 of file action.c.

838{
840
841 fl = malloc( sizeof(*fl) );
842 if ( !fl )
844 fl->feature = child;
845 list_add_tail( &parent->Children, &fl->entry );
846
847 return ERROR_SUCCESS;
848}
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 824 of file action.c.

825{
826 ComponentList *cl;
827
828 cl = malloc( sizeof(*cl) );
829 if ( !cl )
831 cl->component = comp;
832 list_add_tail( &feature->Components, &cl->entry );
833
834 return ERROR_SUCCESS;
835}
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 1331 of file action.c.

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

Referenced by find_folder_children().

◆ bind_image()

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

Definition at line 7405 of file action.c.

7406{
7407 msi_disable_fs_redirection( package );
7408 if (!BindImage( filename, path, NULL )) WARN( "failed to bind image %lu\n", GetLastError() );
7409 msi_revert_fs_redirection( package );
7410}
BOOL WINAPI BindImage(PCSTR ImageName, PCSTR DllPath, PCSTR SymbolPath)
Definition: modify.c:40
const char * filename
Definition: ioapi.h:137
static void msi_revert_fs_redirection(MSIPACKAGE *package)
Definition: msipriv.h:1076
static void msi_disable_fs_redirection(MSIPACKAGE *package)
Definition: msipriv.h:1072
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 3294 of file action.c.

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

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 2634 of file action.c.

2636{
2637 DWORD i, old_len = 0, new_len = 0, old_count = 0, new_count = 0;
2638 const WCHAR *new_ptr = NULL, *old_ptr = NULL;
2639 enum join_op op = JOIN_OP_REPLACE;
2640 WCHAR **old = NULL, **new = NULL;
2641 BYTE *ret;
2642
2643 if (new_size / sizeof(WCHAR) - 1 > 1)
2644 {
2645 new_ptr = (const WCHAR *)new_value;
2646 new_len = new_size / sizeof(WCHAR) - 1;
2647
2648 if (!new_ptr[0] && new_ptr[new_len - 1])
2649 {
2651 new_len--;
2652 new_ptr++;
2653 }
2654 else if (new_ptr[0] && !new_ptr[new_len - 1])
2655 {
2657 new_len--;
2658 }
2659 else if (new_len > 2 && !new_ptr[0] && !new_ptr[new_len - 1])
2660 {
2662 new_len -= 2;
2663 new_ptr++;
2664 }
2665 new = split_multi_string_values( new_ptr, new_len, &new_count );
2666 }
2667 if (old_size / sizeof(WCHAR) - 1 > 1)
2668 {
2669 old_ptr = (const WCHAR *)old_value;
2670 old_len = old_size / sizeof(WCHAR) - 1;
2671 old = split_multi_string_values( old_ptr, old_len, &old_count );
2672 }
2673 ret = (BYTE *)join_multi_string_values( op, old, old_count, new, new_count, size );
2674 for (i = 0; i < old_count; i++) free( old[i] );
2675 for (i = 0; i < new_count; i++) free( new[i] );
2676 free( old );
2677 free( new );
2678 return ret;
2679}
UINT op
Definition: effect.c:236
join_op
Definition: action.c:2606
static WCHAR ** split_multi_string_values(const WCHAR *str, DWORD len, DWORD *count)
Definition: action.c:2528
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:2612
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 2060 of file action.c.

2061{
2062 VS_FIXEDFILEINFO *file_version;
2063 WCHAR *font_version;
2064 MSIFILE *file;
2065
2067 {
2068 MSICOMPONENT *comp = file->Component;
2070
2071 if (!comp->Enabled) continue;
2072
2073 if (file->IsCompressed)
2074 comp->ForceLocalState = TRUE;
2075
2076 set_target_path( package, file );
2077
2078 if (msi_get_file_attributes( package, file->TargetPath ) == INVALID_FILE_ATTRIBUTES)
2079 {
2080 comp->cost += cost_from_size( file->FileSize );
2081 continue;
2082 }
2083 file_size = msi_get_disk_file_size( package, file->TargetPath );
2084 TRACE("%s (size %lu)\n", debugstr_w(file->TargetPath), file_size);
2085
2086 if (file->Version)
2087 {
2088 if ((file_version = msi_get_disk_file_version( package, file->TargetPath )))
2089 {
2090 if (msi_compare_file_versions( file_version, file->Version ) < 0)
2091 {
2092 comp->cost += cost_from_size( file->FileSize - file_size );
2093 }
2094 free( file_version );
2095 continue;
2096 }
2097 else if ((font_version = msi_get_font_file_version( package, file->TargetPath )))
2098 {
2099 if (msi_compare_font_versions( font_version, file->Version ) < 0)
2100 {
2101 comp->cost += cost_from_size( file->FileSize - file_size );
2102 }
2103 free( font_version );
2104 continue;
2105 }
2106 }
2107 if (file_size != file->FileSize)
2108 {
2109 comp->cost += cost_from_size( file->FileSize - file_size );
2110 }
2111 }
2112
2113 return ERROR_SUCCESS;
2114}
int msi_compare_file_versions(VS_FIXEDFILEINFO *fi, const WCHAR *version)
Definition: action.c:1929
int msi_compare_font_versions(const WCHAR *ver1, const WCHAR *ver2)
Definition: action.c:1942
static void set_target_path(MSIPACKAGE *package, MSIFILE *file)
Definition: action.c:2041
VS_FIXEDFILEINFO * msi_get_disk_file_version(MSIPACKAGE *package, const WCHAR *filename)
Definition: files.c:170
DWORD msi_get_file_attributes(MSIPACKAGE *package, const WCHAR *path)
Definition: files.c:115
DWORD msi_get_disk_file_size(MSIPACKAGE *package, const WCHAR *filename)
Definition: files.c:199
WCHAR * msi_get_font_file_version(MSIPACKAGE *package, const WCHAR *filename)
Definition: font.c:189
static int cost_from_size(int size)
Definition: msipriv.h:1198
static unsigned int file_size
Definition: regtests2xml.c:47
BOOL ForceLocalState
Definition: msipriv.h:533

Referenced by ACTION_CostFinalize().

◆ check_publish()

static BOOL check_publish ( MSIPACKAGE package)
static

Definition at line 4109 of file action.c.

4110{
4112
4114 {
4115 feature->Action = msi_get_feature_action( package, feature );
4116 if (feature->Action == INSTALLSTATE_LOCAL || feature->Action == INSTALLSTATE_SOURCE)
4117 return TRUE;
4118 }
4119
4120 return FALSE;
4121}
INSTALLSTATE msi_get_feature_action(MSIPACKAGE *package, MSIFEATURE *feature)
Definition: action.c:625

Referenced by ACTION_PublishFeatures(), ACTION_PublishProduct(), and ACTION_RegisterProduct().

◆ check_unpublish()

static BOOL check_unpublish ( MSIPACKAGE package)
static

Definition at line 4123 of file action.c.

4124{
4126
4128 {
4129 feature->Action = msi_get_feature_action( package, feature );
4130 if (feature->Action != INSTALLSTATE_ABSENT)
4131 return FALSE;
4132 }
4133
4134 return TRUE;
4135}

Referenced by ACTION_RegisterUser(), and ACTION_UnpublishFeatures().

◆ create_temp_dir()

static WCHAR * create_temp_dir ( MSIDATABASE db)
static

Definition at line 1954 of file action.c.

1955{
1956 static UINT id;
1957 WCHAR *ret;
1958
1959 if (!db->tempfolder)
1960 {
1961 WCHAR tmp[MAX_PATH];
1962 DWORD len = ARRAY_SIZE( tmp );
1963
1964 if (msi_get_property( db, L"TempFolder", tmp, &len ) ||
1966 {
1967 GetTempPathW( MAX_PATH, tmp );
1968 }
1969 if (!(db->tempfolder = wcsdup( tmp ))) return NULL;
1970 }
1971
1972 if ((ret = malloc( (wcslen( db->tempfolder ) + 20) * sizeof(WCHAR) )))
1973 {
1974 for (;;)
1975 {
1976 if (!GetTempFileNameW( db->tempfolder, L"msi", ++id, ret ))
1977 {
1978 free( ret );
1979 return NULL;
1980 }
1981 if (CreateDirectoryW( ret, NULL )) break;
1982 }
1983 }
1984
1985 return ret;
1986}
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
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
UINT msi_get_property(MSIDATABASE *, LPCWSTR, LPWSTR, LPDWORD)
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 2836 of file action.c.

2837{
2840 WCHAR *subkey, *p;
2841 HKEY hkey;
2842
2843 if (!(subkey = wcsdup( path ))) return;
2844 do
2845 {
2846 if ((p = wcsrchr( subkey, '\\' )))
2847 {
2848 *p = 0;
2849 if (!p[1]) continue; /* trailing backslash */
2850 hkey = open_key( comp, root, subkey, FALSE, READ_CONTROL );
2851 if (!hkey) break;
2852 if (!is_key_empty(comp, hkey, p + 1))
2853 {
2854 RegCloseKey(hkey);
2855 break;
2856 }
2857 res = RegDeleteKeyExW( hkey, p + 1, access, 0 );
2858 RegCloseKey( hkey );
2859 }
2860 else if (is_key_empty(comp, root, subkey))
2861 res = RegDeleteKeyExW( root, subkey, access, 0 );
2862 if (res)
2863 {
2864 TRACE( "failed to delete key %s (%ld)\n", debugstr_w(subkey), res );
2865 break;
2866 }
2867 } while (p);
2868 free( subkey );
2869}
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:2821
static REGSAM get_registry_view(const MSICOMPONENT *comp)
Definition: action.c:2484
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 2890 of file action.c.

2891{
2892 LONG res;
2893 HKEY hkey;
2894
2895 if (!(hkey = open_key( comp, root, path, FALSE, KEY_ALL_ACCESS ))) return;
2896 res = RegDeleteTreeW( hkey, NULL );
2897 if (res) TRACE( "failed to delete subtree of %s (%ld)\n", debugstr_w(path), res );
2898 delete_key( comp, root, path );
2899 RegCloseKey( hkey );
2900}
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 2871 of file action.c.

2872{
2873 LONG res;
2874 HKEY hkey;
2875
2876 if ((hkey = open_key( comp, root, path, FALSE, KEY_SET_VALUE | KEY_QUERY_VALUE )))
2877 {
2878 if ((res = RegDeleteValueW( hkey, value )))
2879 TRACE( "failed to delete value %s (%ld)\n", debugstr_w(value), res );
2880
2881 RegCloseKey( hkey );
2882 if (is_key_empty(comp, root, path))
2883 {
2884 TRACE("removing empty key %s\n", debugstr_w(path));
2885 delete_key( comp, root, path );
2886 }
2887 }
2888}
#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 1600 of file action.c.

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

Referenced by disable_children(), and MSI_SetFeatureStates().

◆ dummy_thread_proc()

DWORD WINAPI dummy_thread_proc ( void arg)

Definition at line 7700 of file action.c.

7701{
7702 struct dummy_thread *info = arg;
7703 HRESULT hr;
7704
7706 if (FAILED(hr)) ERR("CoInitializeEx failed %08x\n", hr);
7707
7708 SetEvent(info->started);
7710
7712 return 0;
7713}
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 6720 of file action.c.

6721{
6722 const WCHAR *cptr = *name;
6723
6724 *flags = 0;
6725 while (*cptr)
6726 {
6727 if (*cptr == '=')
6729 else if (*cptr == '+')
6731 else if (*cptr == '-')
6733 else if (*cptr == '!')
6735 else if (*cptr == '*')
6737 else
6738 break;
6739
6740 cptr++;
6741 (*name)++;
6742 }
6743
6744 if (!*cptr)
6745 {
6746 ERR("Missing environment variable\n");
6747 return ERROR_FUNCTION_FAILED;
6748 }
6749
6750 if (*value)
6751 {
6752 LPCWSTR ptr = *value;
6753 if (!wcsncmp(ptr, L"[~]", 3))
6754 {
6755 if (ptr[3] == ';')
6756 {
6758 *value += 3;
6759 }
6760 else
6761 {
6762 *value = NULL;
6763 }
6764 }
6765 else if (lstrlenW(*value) >= 3)
6766 {
6767 ptr += lstrlenW(ptr) - 3;
6768 if (!wcscmp( ptr, L"[~]" ))
6769 {
6770 if ((ptr-1) > *value && *(ptr-1) == ';')
6771 {
6773 /* the "[~]" will be removed by deformat_string */;
6774 }
6775 else
6776 {
6777 *value = NULL;
6778 }
6779 }
6780 }
6781 }
6782
6787 {
6788 ERR( "invalid flags: %#lx\n", *flags );
6789 return ERROR_FUNCTION_FAILED;
6790 }
6791
6792 if (!*flags)
6794
6795 return ERROR_SUCCESS;
6796}
#define ENV_MOD_PREFIX
Definition: action.c:6715
#define ENV_ACT_REMOVEMATCH
Definition: action.c:6711
#define ENV_ACT_SETALWAYS
Definition: action.c:6708
#define check_flag_combo(x, y)
Definition: action.c:6718
#define ENV_MOD_APPEND
Definition: action.c:6714
#define ENV_ACT_REMOVE
Definition: action.c:6710
#define ENV_ACT_SETABSENT
Definition: action.c:6709
#define ENV_MOD_MACHINE
Definition: action.c:6713
#define ENV_MOD_MASK
Definition: action.c:6716
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 1396 of file action.c.

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

931{
932 MSIPACKAGE *package = param;
934
936 if (!child)
938
939 if (!child->Feature_Parent)
940 return ERROR_SUCCESS;
941
942 parent = msi_get_loaded_feature( package, child->Feature_Parent );
943 if (!parent)
945
947 return ERROR_SUCCESS;
948}
static UINT add_feature_child(MSIFEATURE *parent, MSIFEATURE *child)
Definition: action.c:837
MSIFEATURE * msi_get_loaded_feature(MSIPACKAGE *package, const WCHAR *Feature)
Definition: action.c:561

Referenced by msi_load_all_features().

◆ find_folder_children()

static UINT find_folder_children ( MSIRECORD row,
LPVOID  param 
)
static

Definition at line 1341 of file action.c.

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

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 2557 of file action.c.

2559{
2560 WCHAR *ret, *p;
2561 unsigned int i;
2562
2563 *size = sizeof(WCHAR);
2564 for (i = 0; i < left_count; i++) *size += (lstrlenW( left[i] ) + 1) * sizeof(WCHAR);
2565 for (i = 0; i < right_count; i++) *size += (lstrlenW( right[i] ) + 1) * sizeof(WCHAR);
2566
2567 if (!(ret = p = malloc( *size ))) return NULL;
2568
2569 for (i = 0; i < left_count; i++)
2570 {
2571 lstrcpyW( p, left[i] );
2572 p += lstrlenW( p ) + 1;
2573 }
2574 for (i = 0; i < right_count; i++)
2575 {
2576 lstrcpyW( p, right[i] );
2577 p += lstrlenW( p ) + 1;
2578 }
2579 *p = 0;
2580 return ret;
2581}
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 973 of file action.c.

974{
975 if (!p)
976 return p;
977 p = wcschr(p, ch);
978 if (!p)
979 return p;
980 *p = 0;
981 return p+1;
982}
#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 1620 of file action.c.

1621{
1622 FeatureList *fl;
1623
1625 {
1626 if (fl->feature->Attributes & msidbFeatureAttributesFollowParent)
1627 {
1628 TRACE("child %s (level %d request %d) follows parent %s (level %d request %d)\n",
1629 debugstr_w(fl->feature->Feature), fl->feature->Level, fl->feature->ActionRequest,
1630 debugstr_w(feature->Feature), feature->Level, feature->ActionRequest);
1631
1632 fl->feature->Action = feature->Action;
1633 fl->feature->ActionRequest = feature->ActionRequest;
1634 }
1635 follow_parent( fl->feature );
1636 }
1637}
static void follow_parent(MSIFEATURE *feature)
Definition: action.c:1620
@ 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 1442 of file action.c.

1443{
1444 MSICOMPONENT *comp;
1445 HKEY hkey;
1446
1448 {
1449 if (!comp->ComponentId) continue;
1450
1451 if (MSIREG_OpenUserDataComponentKey( comp->ComponentId, L"S-1-5-18", &hkey, FALSE ) &&
1453 {
1454 comp->num_clients = 0;
1455 continue;
1456 }
1457 RegQueryInfoKeyW( hkey, NULL, NULL, NULL, NULL, NULL, NULL, (DWORD *)&comp->num_clients,
1458 NULL, NULL, NULL, NULL );
1459 RegCloseKey( hkey );
1460 }
1461}
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 4330 of file action.c.

4331{
4332 WCHAR *filename, *ptr, *folder, *ret;
4333 const WCHAR *dirprop;
4334
4336 if (filename && (ptr = wcschr( filename, '|' )))
4337 ptr++;
4338 else
4339 ptr = filename;
4340
4341 dirprop = MSI_RecordGetString( row, 3 );
4342 if (dirprop)
4343 {
4344 folder = wcsdup( msi_get_target_folder( package, dirprop ) );
4345 if (!folder) folder = msi_dup_property( package->db, dirprop );
4346 }
4347 else
4348 folder = msi_dup_property( package->db, L"WindowsFolder" );
4349
4350 if (!folder)
4351 {
4352 ERR("Unable to resolve folder %s\n", debugstr_w(dirprop));
4353 free( filename );
4354 return NULL;
4355 }
4356
4358
4359 free( filename );
4360 free( folder );
4361 return ret;
4362}
WCHAR *WINAPIV msi_build_directory_name(DWORD count,...)
Definition: action.c:2007
const WCHAR * msi_get_target_folder(MSIPACKAGE *package, const WCHAR *name)
Definition: install.c:232
WCHAR * msi_dup_record_field(MSIRECORD *row, INT index)
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 2160 of file action.c.

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

Referenced by msi_resolve_target_folder().

◆ get_link_file()

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

Definition at line 3678 of file action.c.

3679{
3680 LPCWSTR directory, extension, link_folder;
3681 WCHAR *link_file = NULL, *filename, *new_filename;
3682
3684 link_folder = msi_get_target_folder( package, directory );
3685 if (!link_folder)
3686 {
3687 ERR("unable to resolve folder %s\n", debugstr_w(directory));
3688 return NULL;
3689 }
3690 /* may be needed because of a bug somewhere else */
3691 msi_create_full_path( package, link_folder );
3692
3694 if (!filename) return NULL;
3696
3697 extension = wcsrchr( filename, '.' );
3698 if (!extension || wcsicmp( extension, L".lnk" ))
3699 {
3700 int len = lstrlenW( filename );
3701 new_filename = realloc( filename, len * sizeof(WCHAR) + sizeof(L".lnk") );
3702 if (!new_filename) goto done;
3703 filename = new_filename;
3704 memcpy( filename + len, L".lnk", sizeof(L".lnk") );
3705 }
3706 link_file = msi_build_directory_name( 2, link_folder, filename );
3707
3708done:
3709 free( filename );
3710 return link_file;
3711}
#define realloc
Definition: debug_ros.c:6
#define wcsicmp
Definition: compat.h:15
BOOL msi_create_full_path(MSIPACKAGE *package, const WCHAR *path)
Definition: files.c:211
void msi_reduce_to_long_filename(WCHAR *filename)
Definition: files.c:1053
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878

Referenced by ITERATE_CreateShortcuts(), and ITERATE_RemoveShortcuts().

◆ get_registry_view()

static REGSAM get_registry_view ( const MSICOMPONENT comp)
inlinestatic

Definition at line 2484 of file action.c.

2485{
2486 REGSAM view = 0;
2487 if (is_wow64 || is_64bit)
2489 return