ReactOS  0.4.13-dev-249-gcba1a2f
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 "wine/unicode.h"
#include "winver.h"
#include "msipriv.h"
#include "resource.h"
Include dependency graph for action.c:

Go to the source code of this file.

Classes

struct  dummy_thread
 
struct  _ilfs
 
struct  typelib_struct
 

Macros

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

Enumerations

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

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msi)
 
static INT ui_actionstart (MSIPACKAGE *package, LPCWSTR action, LPCWSTR description, LPCWSTR template)
 
static void ui_actioninfo (MSIPACKAGE *package, LPCWSTR action, BOOL start, INT rc)
 
static int parse_prop (const WCHAR *str, WCHAR *value, int *quotes)
 
static void remove_quotes (WCHAR *str)
 
UINT msi_parse_command_line (MSIPACKAGE *package, LPCWSTR szCommandLine, BOOL preserve_case)
 
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, UINT script)
 
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)
 
BOOL msi_create_full_path (const WCHAR *path)
 
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 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)
 
VS_FIXEDFILEINFOmsi_get_disk_file_version (LPCWSTR filename)
 
int msi_compare_file_versions (VS_FIXEDFILEINFO *fi, const WCHAR *version)
 
int msi_compare_font_versions (const WCHAR *ver1, const WCHAR *ver2)
 
DWORD msi_get_disk_file_size (LPCWSTR filename)
 
BOOL msi_file_hash_matches (MSIFILE *file)
 
static WCHARcreate_temp_dir (MSIDATABASE *db)
 
WCHARmsi_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 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 openSharedDLLsKey (void)
 
static UINT ACTION_GetSharedDLLsCount (LPCWSTR dll)
 
static UINT ACTION_WriteSharedDLLsCount (LPCWSTR path, UINT count)
 
static void ACTION_RefCountComponent (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 UINT ITERATE_RegisterTypeLibraries (MSIRECORD *row, LPVOID param)
 
static UINT ACTION_RegisterTypeLibraries (MSIPACKAGE *package)
 
static UINT ITERATE_UnregisterTypeLibraries (MSIRECORD *row, LPVOID param)
 
static UINT ACTION_UnregisterTypeLibraries (MSIPACKAGE *package)
 
static WCHARget_link_file (MSIPACKAGE *package, MSIRECORD *row)
 
WCHARmsi_build_icon_path (MSIPACKAGE *package, const WCHAR *icon_name)
 
static UINT ITERATE_CreateShortcuts (MSIRECORD *row, LPVOID param)
 
static UINT ACTION_CreateShortcuts (MSIPACKAGE *package)
 
static UINT ITERATE_RemoveShortcuts (MSIRECORD *row, LPVOID param)
 
static UINT ACTION_RemoveShortcuts (MSIPACKAGE *package)
 
static UINT ITERATE_PublishIcon (MSIRECORD *row, LPVOID param)
 
static UINT msi_publish_icons (MSIPACKAGE *package)
 
static UINT msi_publish_sourcelist (MSIPACKAGE *package, HKEY hkey)
 
static UINT msi_publish_product_properties (MSIPACKAGE *package, HKEY hkey)
 
static UINT msi_publish_upgrade_code (MSIPACKAGE *package)
 
static BOOL msi_check_publish (MSIPACKAGE *package)
 
static BOOL msi_check_unpublish (MSIPACKAGE *package)
 
static UINT msi_publish_patches (MSIPACKAGE *package)
 
static UINT ACTION_PublishProduct (MSIPACKAGE *package)
 
static WCHARget_ini_file_name (MSIPACKAGE *package, MSIRECORD *row)
 
static UINT ITERATE_WriteIniValues (MSIRECORD *row, LPVOID param)
 
static UINT ACTION_WriteIniValues (MSIPACKAGE *package)
 
static UINT ITERATE_RemoveIniValuesOnUninstall (MSIRECORD *row, LPVOID param)
 
static UINT ITERATE_RemoveIniValuesOnInstall (MSIRECORD *row, LPVOID param)
 
static UINT ACTION_RemoveIniValues (MSIPACKAGE *package)
 
static void register_dll (const WCHAR *dll, BOOL unregister)
 
static UINT ITERATE_SelfRegModules (MSIRECORD *row, LPVOID param)
 
static UINT ACTION_SelfRegModules (MSIPACKAGE *package)
 
static UINT ITERATE_SelfUnregModules (MSIRECORD *row, LPVOID param)
 
static UINT ACTION_SelfUnregModules (MSIPACKAGE *package)
 
static UINT ACTION_PublishFeatures (MSIPACKAGE *package)
 
static UINT msi_unpublish_feature (MSIPACKAGE *package, MSIFEATURE *feature)
 
static UINT ACTION_UnpublishFeatures (MSIPACKAGE *package)
 
static UINT msi_publish_install_properties (MSIPACKAGE *package, HKEY hkey)
 
static UINT ACTION_RegisterProduct (MSIPACKAGE *package)
 
static UINT ACTION_InstallExecute (MSIPACKAGE *package)
 
static UINT ITERATE_UnpublishIcon (MSIRECORD *row, LPVOID param)
 
static UINT msi_unpublish_icons (MSIPACKAGE *package)
 
static void remove_product_upgrade_code (MSIPACKAGE *package)
 
static UINT ACTION_UnpublishProduct (MSIPACKAGE *package)
 
static BOOL is_full_uninstall (MSIPACKAGE *package)
 
static UINT ACTION_InstallFinalize (MSIPACKAGE *package)
 
UINT ACTION_ForceReboot (MSIPACKAGE *package)
 
static UINT ACTION_ResolveSource (MSIPACKAGE *package)
 
static UINT ACTION_RegisterUser (MSIPACKAGE *package)
 
static UINT iterate_properties (MSIRECORD *record, void *param)
 
static UINT ACTION_ExecuteAction (MSIPACKAGE *package)
 
static UINT ACTION_INSTALL (MSIPACKAGE *package)
 
WCHARmsi_create_component_advertise_string (MSIPACKAGE *package, MSICOMPONENT *component, const WCHAR *feature)
 
static UINT ITERATE_PublishComponent (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_PublishComponents (MSIPACKAGE *package)
 
static UINT ITERATE_UnpublishComponent (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_UnpublishComponents (MSIPACKAGE *package)
 
static UINT ITERATE_InstallService (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_InstallServices (MSIPACKAGE *package)
 
static LPCWSTRmsi_service_args_to_vector (LPWSTR args, DWORD *numargs)
 
static UINT ITERATE_StartService (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_StartServices (MSIPACKAGE *package)
 
static BOOL stop_service_dependents (SC_HANDLE scm, SC_HANDLE service)
 
static UINT stop_service (LPCWSTR name)
 
static UINT ITERATE_StopService (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_StopServices (MSIPACKAGE *package)
 
static UINT ITERATE_DeleteService (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_DeleteServices (MSIPACKAGE *package)
 
static UINT ITERATE_InstallODBCDriver (MSIRECORD *rec, LPVOID param)
 
static UINT ITERATE_InstallODBCTranslator (MSIRECORD *rec, LPVOID param)
 
static UINT ITERATE_InstallODBCDataSource (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_InstallODBC (MSIPACKAGE *package)
 
static UINT ITERATE_RemoveODBCDriver (MSIRECORD *rec, LPVOID param)
 
static UINT ITERATE_RemoveODBCTranslator (MSIRECORD *rec, LPVOID param)
 
static UINT ITERATE_RemoveODBCDataSource (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_RemoveODBC (MSIPACKAGE *package)
 
static UINT env_parse_flags (LPCWSTR *name, LPCWSTR *value, DWORD *flags)
 
static UINT open_env_key (DWORD flags, HKEY *key)
 
static UINT ITERATE_WriteEnvironmentString (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_WriteEnvironmentStrings (MSIPACKAGE *package)
 
static UINT ITERATE_RemoveEnvironmentString (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_RemoveEnvironmentStrings (MSIPACKAGE *package)
 
UINT msi_validate_product_id (MSIPACKAGE *package)
 
static UINT ACTION_ValidateProductID (MSIPACKAGE *package)
 
static UINT ACTION_ScheduleReboot (MSIPACKAGE *package)
 
static UINT ACTION_AllocateRegistrySpace (MSIPACKAGE *package)
 
static UINT ACTION_DisableRollback (MSIPACKAGE *package)
 
static UINT ACTION_InstallAdminPackage (MSIPACKAGE *package)
 
static UINT ACTION_SetODBCFolders (MSIPACKAGE *package)
 
static UINT ITERATE_RemoveExistingProducts (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_RemoveExistingProducts (MSIPACKAGE *package)
 
static UINT ITERATE_MigrateFeatureStates (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_MigrateFeatureStates (MSIPACKAGE *package)
 
static void bind_image (const char *filename, const char *path)
 
static UINT ITERATE_BindImage (MSIRECORD *rec, LPVOID param)
 
static UINT ACTION_BindImage (MSIPACKAGE *package)
 
static UINT msi_unimplemented_action_stub (MSIPACKAGE *package, LPCSTR action, LPCWSTR table)
 
static UINT ACTION_IsolateComponents (MSIPACKAGE *package)
 
static UINT ACTION_RMCCPSearch (MSIPACKAGE *package)
 
static UINT ACTION_RegisterComPlus (MSIPACKAGE *package)
 
static UINT ACTION_UnregisterComPlus (MSIPACKAGE *package)
 
static UINT ACTION_InstallSFPCatalogFile (MSIPACKAGE *package)
 
static UINT ACTION_HandleStandardAction (MSIPACKAGE *package, LPCWSTR action)
 
UINT ACTION_PerformAction (MSIPACKAGE *package, const WCHAR *action, UINT script)
 
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

static const WCHAR szCreateFolders []
 
static const WCHAR szCostFinalize []
 
static const WCHAR szWriteRegistryValues []
 
static const WCHAR szFileCost []
 
static const WCHAR szInstallInitialize []
 
static const WCHAR szInstallValidate []
 
static const WCHAR szLaunchConditions []
 
static const WCHAR szProcessComponents []
 
static const WCHAR szRegisterTypeLibraries []
 
static const WCHAR szCreateShortcuts []
 
static const WCHAR szPublishProduct []
 
static const WCHAR szWriteIniValues []
 
static const WCHAR szSelfRegModules []
 
static const WCHAR szPublishFeatures []
 
static const WCHAR szRegisterProduct []
 
static const WCHAR szInstallExecute []
 
static const WCHAR szInstallExecuteAgain []
 
static const WCHAR szInstallFinalize []
 
static const WCHAR szForceReboot []
 
static const WCHAR szResolveSource []
 
static const WCHAR szAllocateRegistrySpace []
 
static const WCHAR szBindImage []
 
static const WCHAR szDeleteServices []
 
static const WCHAR szDisableRollback []
 
static const WCHAR szExecuteAction []
 
static const WCHAR szInstallAdminPackage []
 
static const WCHAR szInstallSFPCatalogFile []
 
static const WCHAR szIsolateComponents []
 
static const WCHAR szMigrateFeatureStates []
 
static const WCHAR szMsiUnpublishAssemblies []
 
static const WCHAR szInstallODBC []
 
static const WCHAR szInstallServices []
 
static const WCHAR szPublishComponents []
 
static const WCHAR szRegisterComPlus []
 
static const WCHAR szRegisterUser []
 
static const WCHAR szRemoveEnvironmentStrings []
 
static const WCHAR szRemoveExistingProducts []
 
static const WCHAR szRemoveFolders []
 
static const WCHAR szRemoveIniValues []
 
static const WCHAR szRemoveODBC []
 
static const WCHAR szRemoveRegistryValues []
 
static const WCHAR szRemoveShortcuts []
 
static const WCHAR szRMCCPSearch []
 
static const WCHAR szScheduleReboot []
 
static const WCHAR szSelfUnregModules []
 
static const WCHAR szSetODBCFolders []
 
static const WCHAR szStartServices []
 
static const WCHAR szStopServices []
 
static const WCHAR szUnpublishComponents []
 
static const WCHAR szUnpublishFeatures []
 
static const WCHAR szUnpublishProduct []
 
static const WCHAR szUnregisterComPlus []
 
static const WCHAR szUnregisterTypeLibraries []
 
static const WCHAR szValidateProductID []
 
static const WCHAR szWriteEnvironmentStrings []
 
static const WCHAR szINSTALL []
 
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 6975 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 46 of file action.c.

◆ ENV_ACT_REMOVE

#define ENV_ACT_REMOVE   0x4

Definition at line 6967 of file action.c.

◆ ENV_ACT_REMOVEMATCH

#define ENV_ACT_REMOVEMATCH   0x8

Definition at line 6968 of file action.c.

◆ ENV_ACT_SETABSENT

#define ENV_ACT_SETABSENT   0x2

Definition at line 6966 of file action.c.

◆ ENV_ACT_SETALWAYS

#define ENV_ACT_SETALWAYS   0x1

Definition at line 6965 of file action.c.

◆ ENV_MOD_APPEND

#define ENV_MOD_APPEND   0x40000000

Definition at line 6971 of file action.c.

◆ ENV_MOD_MACHINE

#define ENV_MOD_MACHINE   0x20000000

Definition at line 6970 of file action.c.

◆ ENV_MOD_MASK

#define ENV_MOD_MASK   0xC0000000

Definition at line 6973 of file action.c.

◆ ENV_MOD_PREFIX

#define ENV_MOD_PREFIX   0x80000000

Definition at line 6972 of file action.c.

◆ REG_PROGRESS_VALUE

#define REG_PROGRESS_VALUE   13200

Definition at line 45 of file action.c.

Enumeration Type Documentation

◆ join_op

Enumerator
JOIN_OP_APPEND 
JOIN_OP_PREPEND 
JOIN_OP_REPLACE 

Definition at line 2775 of file action.c.

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

220 {
222  state_token,
224 };

Function Documentation

◆ ACTION_AllocateRegistrySpace()

static UINT ACTION_AllocateRegistrySpace ( MSIPACKAGE package)
static

Definition at line 7474 of file action.c.

7475 {
7476  static const WCHAR szAvailableFreeReg[] =
7477  {'A','V','A','I','L','A','B','L','E','F','R','E','E','R','E','G',0};
7478  MSIRECORD *uirow;
7479  int space = msi_get_property_int( package->db, szAvailableFreeReg, 0 );
7480 
7481  TRACE("%p %d kilobytes\n", package, space);
7482 
7483  uirow = MSI_CreateRecord( 1 );
7484  MSI_RecordSetInteger( uirow, 1, space );
7486  msiobj_release( &uirow->hdr );
7487 
7488  return ERROR_SUCCESS;
7489 }
#define ERROR_SUCCESS
Definition: deptool.c:10
MSIOBJECTHDR hdr
Definition: msipriv.h:141
int msi_get_property_int(MSIDATABASE *package, LPCWSTR prop, int def) DECLSPEC_HIDDEN
Definition: package.c:2392
UINT MSI_RecordSetInteger(MSIRECORD *, UINT, int) DECLSPEC_HIDDEN
Definition: record.c:328
INT MSI_ProcessMessage(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *) DECLSPEC_HIDDEN
Definition: package.c:1946
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
Definition: record.c:79

◆ ACTION_BindImage()

static UINT ACTION_BindImage ( MSIPACKAGE package)
static

Definition at line 7711 of file action.c.

7712 {
7713  static const WCHAR query[] = {
7714  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
7715  'B','i','n','d','I','m','a','g','e',0};
7716  MSIQUERY *view;
7717  UINT r;
7718 
7719  r = MSI_DatabaseOpenViewW( package->db, query, &view );
7720  if (r == ERROR_SUCCESS)
7721  {
7723  msiobj_release( &view->hdr );
7724  if (r != ERROR_SUCCESS)
7725  return r;
7726  }
7727  return ERROR_SUCCESS;
7728 }
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static UINT ITERATE_BindImage(MSIRECORD *rec, LPVOID param)
Definition: action.c:7675
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
unsigned int UINT
Definition: ndis.h:50
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:168
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

◆ ACTION_CostFinalize()

static UINT ACTION_CostFinalize ( MSIPACKAGE package)
static

Definition at line 2393 of file action.c.

2394 {
2395  static const WCHAR query[] =
2396  {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
2397  '`','C','o','n','d','i','t','i','o','n','`',0};
2398  static const WCHAR szOutOfDiskSpace[] =
2399  {'O','u','t','O','f','D','i','s','k','S','p','a','c','e',0};
2400  static const WCHAR szPrimaryFolder[] =
2401  {'P','R','I','M','A','R','Y','F','O','L','D','E','R',0};
2402  static const WCHAR szPrimaryVolumePath[] =
2403  {'P','r','i','m','a','r','y','V','o','l','u','m','e','P','a','t','h',0};
2404  static const WCHAR szPrimaryVolumeSpaceAvailable[] =
2405  {'P','r','i','m','a','r','y','V','o','l','u','m','e','S','p','a','c','e',
2406  'A','v','a','i','l','a','b','l','e',0};
2407  static const WCHAR szPrimaryVolumeSpaceRequired[] =
2408  {'P','r','i','m','a','r','y','V','o','l','u','m','e','S','p','a','c','e',
2409  'R','e','q','u','i','r','e','d',0};
2410  static const WCHAR szPrimaryVolumeSpaceRemaining[] =
2411  {'P','r','i','m','a','r','y','V','o','l','u','m','e','S','p','a','c','e',
2412  'R','e','m','a','i','n','i','n','g',0};
2413  static const WCHAR szOutOfNoRbDiskSpace[] =
2414  {'O','u','t','O','f','N','o','R','b','D','i','s','k','S','p','a','c','e',0};
2415  MSICOMPONENT *comp;
2416  MSIQUERY *view;
2417  WCHAR *level, *primary_key, *primary_folder;
2418  UINT rc;
2419 
2420  TRACE("Building directory properties\n");
2422 
2423  TRACE("Evaluating component conditions\n");
2424  LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry )
2425  {
2426  if (MSI_EvaluateConditionW( package, comp->Condition ) == MSICONDITION_FALSE)
2427  {
2428  TRACE("Disabling component %s\n", debugstr_w(comp->Component));
2429  comp->Enabled = FALSE;
2430  }
2431  else
2432  comp->Enabled = TRUE;
2433  }
2434  get_client_counts( package );
2435 
2436  /* read components states from the registry */
2439 
2440  if (!process_overrides( package, msi_get_property_int( package->db, szInstallLevel, 1 ) ))
2441  {
2442  TRACE("Evaluating feature conditions\n");
2443 
2444  rc = MSI_DatabaseOpenViewW( package->db, query, &view );
2445  if (rc == ERROR_SUCCESS)
2446  {
2448  msiobj_release( &view->hdr );
2449  if (rc != ERROR_SUCCESS)
2450  return rc;
2451  }
2452  }
2453 
2454  TRACE("Calculating file cost\n");
2455  calculate_file_cost( package );
2456 
2457  msi_set_property( package->db, szCostingComplete, szOne, -1 );
2458  /* set default run level if not set */
2459  level = msi_dup_property( package->db, szInstallLevel );
2460  if (!level) msi_set_property( package->db, szInstallLevel, szOne, -1 );
2461  msi_free(level);
2462 
2463  if ((rc = MSI_SetFeatureStates( package ))) return rc;
2464 
2465  if ((primary_key = msi_dup_property( package->db, szPrimaryFolder )))
2466  {
2467  if ((primary_folder = msi_dup_property( package->db, primary_key )))
2468  {
2469  if (((primary_folder[0] >= 'A' && primary_folder[0] <= 'Z') ||
2470  (primary_folder[0] >= 'a' && primary_folder[0] <= 'z')) && primary_folder[1] == ':')
2471  {
2472  static const WCHAR fmtW[] = {'%','l','u',0};
2474  ULONGLONG required;
2475  WCHAR buf[21];
2476 
2477  primary_folder[2] = 0;
2478  if (GetDiskFreeSpaceExW( primary_folder, &free, NULL, NULL ))
2479  {
2480  sprintfW( buf, fmtW, free.QuadPart / 512 );
2481  msi_set_property( package->db, szPrimaryVolumeSpaceAvailable, buf, -1 );
2482  }
2483  required = get_volume_space_required( package );
2484  sprintfW( buf, fmtW, required / 512 );
2485  msi_set_property( package->db, szPrimaryVolumeSpaceRequired, buf, -1 );
2486 
2487  sprintfW( buf, fmtW, (free.QuadPart - required) / 512 );
2488  msi_set_property( package->db, szPrimaryVolumeSpaceRemaining, buf, -1 );
2489  msi_set_property( package->db, szPrimaryVolumePath, primary_folder, 2 );
2490  }
2491  msi_free( primary_folder );
2492  }
2493  msi_free( primary_key );
2494  }
2495 
2496  /* FIXME: check volume disk space */
2497  msi_set_property( package->db, szOutOfDiskSpace, szZero, -1 );
2498  msi_set_property( package->db, szOutOfNoRbDiskSpace, szZero, -1 );
2499 
2500  return ERROR_SUCCESS;
2501 }
GLint level
Definition: gl.h:1546
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
static UINT calculate_file_cost(MSIPACKAGE *package)
Definition: action.c:2217
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
int msi_get_property_int(MSIDATABASE *package, LPCWSTR prop, int def) DECLSPEC_HIDDEN
Definition: package.c:2392
#define free
Definition: debug_ros.c:5
static const WCHAR szZero[]
Definition: msipriv.h:1109
static void get_client_counts(MSIPACKAGE *package)
Definition: action.c:1591
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
static ULONGLONG get_volume_space_required(MSIPACKAGE *package)
Definition: action.c:2381
static BOOL process_overrides(MSIPACKAGE *package, int level)
Definition: action.c:1717
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
static void ACTION_GetComponentInstallStates(MSIPACKAGE *package)
Definition: action.c:1612
#define TRACE(s)
Definition: solgame.cpp:4
UINT MSI_SetFeatureStates(MSIPACKAGE *package)
Definition: action.c:1794
__wchar_t WCHAR
Definition: xmlstorage.h:180
uint64_t ULONGLONG
Definition: typedefs.h:65
static const WCHAR szCostingComplete[]
Definition: msipriv.h:1181
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
LPWSTR Component
Definition: msipriv.h:502
struct list components
Definition: msipriv.h:392
uint32_t entry
Definition: isohybrid.c:63
LPWSTR Condition
Definition: msipriv.h:506
void msi_resolve_target_folder(MSIPACKAGE *package, const WCHAR *name, BOOL load_prop)
Definition: action.c:2333
#define sprintfW
Definition: unicode.h:58
static const WCHAR szOne[]
Definition: msipriv.h:1108
static UINT ITERATE_CostFinalizeConditions(MSIRECORD *row, LPVOID param)
Definition: action.c:2002
unsigned int UINT
Definition: ndis.h:50
UINT msi_set_property(MSIDATABASE *, const WCHAR *, const WCHAR *, int) DECLSPEC_HIDDEN
Definition: package.c:2149
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
MSICONDITION MSI_EvaluateConditionW(MSIPACKAGE *package, LPCWSTR szCondition)
Definition: cond.tab.c:2442
static const WCHAR szTargetDir[]
Definition: msipriv.h:1103
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:168
static void ACTION_GetFeatureInstallStates(MSIPACKAGE *package)
Definition: action.c:1640
BOOL WINAPI GetDiskFreeSpaceExW(IN LPCWSTR lpDirectoryName OPTIONAL, OUT PULARGE_INTEGER lpFreeBytesAvailableToCaller, OUT PULARGE_INTEGER lpTotalNumberOfBytes, OUT PULARGE_INTEGER lpTotalNumberOfFreeBytes)
Definition: disk.c:342
static const WCHAR szInstallLevel[]
Definition: msipriv.h:1190
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop) DECLSPEC_HIDDEN
Definition: package.c:2370
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

◆ ACTION_CostInitialize()

static UINT ACTION_CostInitialize ( MSIPACKAGE package)
static

Definition at line 1535 of file action.c.

1536 {
1537  msi_set_property( package->db, szCostingComplete, szZero, -1 );
1538  msi_set_property( package->db, szRootDrive, szCRoot, -1 );
1539 
1540  load_all_folders( package );
1541  msi_load_all_components( package );
1542  msi_load_all_features( package );
1543  load_all_files( package );
1544  load_all_patches( package );
1545  load_all_media( package );
1546 
1547  return ERROR_SUCCESS;
1548 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static const WCHAR szRootDrive[]
Definition: msipriv.h:1102
static const WCHAR szZero[]
Definition: msipriv.h:1109
UINT msi_load_all_features(MSIPACKAGE *package)
Definition: action.c:1108
static UINT load_all_folders(MSIPACKAGE *package)
Definition: action.c:1509
static UINT load_all_patches(MSIPACKAGE *package)
Definition: action.c:1380
static const WCHAR szCostingComplete[]
Definition: msipriv.h:1181
UINT msi_load_all_components(MSIPACKAGE *package)
Definition: action.c:952
MSIDATABASE * db
Definition: msipriv.h:386
static UINT load_all_files(MSIPACKAGE *package)
Definition: action.c:1272
UINT msi_set_property(MSIDATABASE *, const WCHAR *, const WCHAR *, int) DECLSPEC_HIDDEN
Definition: package.c:2149
static const WCHAR szCRoot[]
Definition: msipriv.h:1184
static UINT load_all_media(MSIPACKAGE *package)
Definition: action.c:1306

◆ ACTION_CreateFolders()

static UINT ACTION_CreateFolders ( MSIPACKAGE package)
static

Definition at line 826 of file action.c.

827 {
828  static const WCHAR query[] = {
829  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
830  '`','C','r','e','a','t','e','F','o','l','d','e','r','`',0};
831  MSIQUERY *view;
832  UINT rc;
833 
834  rc = MSI_DatabaseOpenViewW( package->db, query, &view );
835  if (rc != ERROR_SUCCESS)
836  return ERROR_SUCCESS;
837 
839  msiobj_release(&view->hdr);
840  return rc;
841 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static UINT ITERATE_CreateFolders(MSIRECORD *row, LPVOID param)
Definition: action.c:777
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
unsigned int UINT
Definition: ndis.h:50
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:168
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

◆ ACTION_CreateShortcuts()

static UINT ACTION_CreateShortcuts ( MSIPACKAGE package)
static

Definition at line 4029 of file action.c.

4030 {
4031  static const WCHAR query[] = {
4032  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
4033  '`','S','h','o','r','t','c','u','t','`',0};
4034  MSIQUERY *view;
4035  HRESULT res;
4036  UINT rc;
4037 
4038  rc = MSI_DatabaseOpenViewW(package->db, query, &view);
4039  if (rc != ERROR_SUCCESS)
4040  return ERROR_SUCCESS;
4041 
4042  res = CoInitialize( NULL );
4043 
4045  msiobj_release(&view->hdr);
4046 
4047  if (SUCCEEDED(res)) CoUninitialize();
4048  return rc;
4049 }
#define ERROR_SUCCESS
Definition: deptool.c:10
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static UINT ITERATE_CreateShortcuts(MSIRECORD *row, LPVOID param)
Definition: action.c:3917
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:1991
unsigned int UINT
Definition: ndis.h:50
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1897
GLuint res
Definition: glext.h:9613
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:168
#define SUCCEEDED(hr)
Definition: intsafe.h:57
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

◆ ACTION_DeleteServices()

static UINT ACTION_DeleteServices ( MSIPACKAGE package)
static

Definition at line 6482 of file action.c.

6483 {
6484  static const WCHAR query[] = {
6485  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
6486  'S','e','r','v','i','c','e','C','o','n','t','r','o','l',0};
6487  MSIQUERY *view;
6488  UINT rc;
6489 
6490  rc = MSI_DatabaseOpenViewW( package->db, query, &view );
6491  if (rc != ERROR_SUCCESS)
6492  return ERROR_SUCCESS;
6493 
6495  msiobj_release( &view->hdr );
6496  return rc;
6497 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static UINT ITERATE_DeleteService(MSIRECORD *rec, LPVOID param)
Definition: action.c:6416
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
unsigned int UINT
Definition: ndis.h:50
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:168
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

◆ ACTION_DisableRollback()

static UINT ACTION_DisableRollback ( MSIPACKAGE package)
static

Definition at line 7491 of file action.c.

7492 {
7493  TRACE("%p\n", package);
7494 
7495  msi_set_property( package->db, szRollbackDisabled, szOne, -1 );
7496  return ERROR_SUCCESS;
7497 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static const WCHAR szRollbackDisabled[]
Definition: msipriv.h:1193
#define TRACE(s)
Definition: solgame.cpp:4
MSIDATABASE * db
Definition: msipriv.h:386
static const WCHAR szOne[]
Definition: msipriv.h:1108
UINT msi_set_property(MSIDATABASE *, const WCHAR *, const WCHAR *, int) DECLSPEC_HIDDEN
Definition: package.c:2149

◆ ACTION_ExecuteAction()

static UINT ACTION_ExecuteAction ( MSIPACKAGE package)
static

Definition at line 5580 of file action.c.

5581 {
5582  static const WCHAR prop_query[] =
5583  {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','`','_','P','r','o','p','e','r','t','y','`',0};
5584  WCHAR *productname;
5585  WCHAR *action;
5586  WCHAR *info_template;
5587  MSIQUERY *view;
5588  MSIRECORD *uirow, *uirow_info;
5589  UINT rc;
5590 
5591  /* Send COMMONDATA and INFO messages. */
5592  /* FIXME: when should these messages be sent? [see also MsiOpenPackage()] */
5593  uirow = MSI_CreateRecord(3);
5594  if (!uirow) return ERROR_OUTOFMEMORY;
5595  MSI_RecordSetStringW(uirow, 0, NULL);
5596  MSI_RecordSetInteger(uirow, 1, 0);
5597  MSI_RecordSetInteger(uirow, 2, package->num_langids ? package->langids[0] : 0);
5600  /* FIXME: send INSTALLMESSAGE_PROGRESS */
5602 
5603  if (!(needs_ui_sequence(package) && ui_sequence_exists(package)))
5604  {
5605  uirow_info = MSI_CreateRecord(0);
5606  if (!uirow_info)
5607  {
5608  msiobj_release(&uirow->hdr);
5609  return ERROR_OUTOFMEMORY;
5610  }
5611  info_template = msi_get_error_message(package->db, MSIERR_INFO_LOGGINGSTART);
5612  MSI_RecordSetStringW(uirow_info, 0, info_template);
5613  msi_free(info_template);
5614  MSI_ProcessMessage(package, INSTALLMESSAGE_INFO|MB_ICONHAND, uirow_info);
5615  msiobj_release(&uirow_info->hdr);
5616  }
5617 
5619 
5620  productname = msi_dup_property(package->db, INSTALLPROPERTY_PRODUCTNAMEW);
5621  MSI_RecordSetInteger(uirow, 1, 1);
5622  MSI_RecordSetStringW(uirow, 2, productname);
5623  MSI_RecordSetStringW(uirow, 3, NULL);
5625  msiobj_release(&uirow->hdr);
5626 
5628 
5631 
5632  /* Perform the action. Top-level actions trigger a sequence. */
5633  if (!strcmpW(action, szINSTALL))
5634  {
5635  /* Send ACTIONSTART/INFO and INSTALLSTART. */
5636  ui_actionstart(package, szINSTALL, NULL, NULL);
5637  ui_actioninfo(package, szINSTALL, TRUE, 0);
5638  uirow = MSI_CreateRecord(2);
5639  if (!uirow)
5640  {
5641  rc = ERROR_OUTOFMEMORY;
5642  goto end;
5643  }
5644  MSI_RecordSetStringW(uirow, 0, NULL);
5645  MSI_RecordSetStringW(uirow, 1, productname);
5646  MSI_RecordSetStringW(uirow, 2, package->ProductCode);
5648  msiobj_release(&uirow->hdr);
5649 
5650  /* Perform the installation. Always use the ExecuteSequence. */
5651  package->InWhatSequence |= SEQUENCE_EXEC;
5652  rc = ACTION_ProcessExecSequence(package);
5653 
5654  /* Send return value and INSTALLEND. */
5655  ui_actioninfo(package, szINSTALL, FALSE, !rc);
5656  uirow = MSI_CreateRecord(3);
5657  if (!uirow)
5658  {
5659  rc = ERROR_OUTOFMEMORY;
5660  goto end;
5661  }
5662  MSI_RecordSetStringW(uirow, 0, NULL);
5663  MSI_RecordSetStringW(uirow, 1, productname);
5664  MSI_RecordSetStringW(uirow, 2, package->ProductCode);
5665  MSI_RecordSetInteger(uirow, 3, !rc);
5667  msiobj_release(&uirow->hdr);
5668  }
5669  else
5670  rc = ACTION_PerformAction(package, action, SCRIPT_NONE);
5671 
5672  /* Send all set properties. */
5673  if (!MSI_OpenQuery(package->db, &view, prop_query))
5674  {
5676  msiobj_release(&view->hdr);
5677  }
5678 
5679  /* And finally, toggle the cancel off and on. */
5680  uirow = MSI_CreateRecord(2);
5681  if (!uirow)
5682  {
5683  rc = ERROR_OUTOFMEMORY;
5684  goto end;
5685  }
5686  MSI_RecordSetStringW(uirow, 0, NULL);
5687  MSI_RecordSetInteger(uirow, 1, 2);
5688  MSI_RecordSetInteger(uirow, 2, 0);
5690  MSI_RecordSetInteger(uirow, 2, 1);
5692  msiobj_release(&uirow->hdr);
5693 
5694 end:
5695  msi_free(productname);
5696  msi_free(action);
5697  return rc;
5698 }
LPWSTR ProductCode
Definition: msipriv.h:426
#define MB_ICONHAND
Definition: winuser.h:782
#define TRUE
Definition: types.h:120
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
Definition: record.c:649
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
static UINT iterate_properties(MSIRECORD *record, void *param)
Definition: action.c:5564
static UINT ACTION_ProcessExecSequence(MSIPACKAGE *package)
Definition: action.c:560
UINT LastActionResult
Definition: msipriv.h:403
MSIOBJECTHDR hdr
Definition: msipriv.h:141
WCHAR * msi_get_error_message(MSIDATABASE *, int) DECLSPEC_HIDDEN
Definition: package.c:1851
#define MSI_NULL_INTEGER
Definition: msiquery.h:32
GLuint GLuint end
Definition: gl.h:1545
static const WCHAR szINSTALL[]
Definition: action.c:160
UINT MSI_OpenQuery(MSIDATABASE *, MSIQUERY **, LPCWSTR,...) DECLSPEC_HIDDEN
Definition: msiquery.c:143
static void ui_actioninfo(MSIPACKAGE *package, LPCWSTR action, BOOL start, INT rc)
Definition: action.c:196
UINT MSI_RecordSetInteger(MSIRECORD *, UINT, int) DECLSPEC_HIDDEN
Definition: record.c:328
string_table * strings
Definition: msipriv.h:99
INT MSI_ProcessMessage(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *) DECLSPEC_HIDDEN
Definition: package.c:1946
smooth NULL
Definition: ftsmooth.c:416
UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, UINT script)
Definition: action.c:7913
static BOOL needs_ui_sequence(MSIPACKAGE *package)
Definition: action.c:478
#define SEQUENCE_EXEC
Definition: msipriv.h:696
WCHAR * msi_strdupW(const WCHAR *value, int len) DECLSPEC_HIDDEN
Definition: record.c:158
#define MSIERR_INFO_LOGGINGSTART
Definition: resource.h:24
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
LANGID * langids
Definition: msipriv.h:390
static INT ui_actionstart(MSIPACKAGE *package, LPCWSTR action, LPCWSTR description, LPCWSTR template)
Definition: action.c:170
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
Definition: record.c:79
static const WCHAR szEXECUTEACTION[]
Definition: msipriv.h:1200
static const WCHAR INSTALLPROPERTY_PRODUCTNAMEW[]
Definition: msi.h:277
UINT num_langids
Definition: msipriv.h:389
UINT InWhatSequence
Definition: msipriv.h:420
const WCHAR * action
Definition: action.c:7783
unsigned int UINT
Definition: ndis.h:50
static BOOL ui_sequence_exists(MSIPACKAGE *package)
Definition: action.c:424
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229
static IOleDocumentView * view
Definition: activex.c:1749
INT MSI_ProcessMessageVerbatim(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *) DECLSPEC_HIDDEN
Definition: package.c:1880
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:168
UINT msi_get_string_table_codepage(const string_table *st) DECLSPEC_HIDDEN
Definition: string.c:675
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop) DECLSPEC_HIDDEN
Definition: package.c:2370

Referenced by ACTION_INSTALL().

◆ ACTION_FileCost()

static UINT ACTION_FileCost ( MSIPACKAGE package)
static

Definition at line 1586 of file action.c.

1587 {
1588  return ERROR_SUCCESS;
1589 }
#define ERROR_SUCCESS
Definition: deptool.c:10

◆ ACTION_ForceReboot()

UINT ACTION_ForceReboot ( MSIPACKAGE package)

Definition at line 5407 of file action.c.

5408 {
5409  static const WCHAR RunOnce[] = {
5410  'S','o','f','t','w','a','r','e','\\',
5411  'M','i','c','r','o','s','o','f','t','\\',
5412  'W','i','n','d','o','w','s','\\',
5413  'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
5414  'R','u','n','O','n','c','e',0};
5415  static const WCHAR InstallRunOnce[] = {
5416  'S','o','f','t','w','a','r','e','\\',
5417  'M','i','c','r','o','s','o','f','t','\\',
5418  'W','i','n','d','o','w','s','\\',
5419  'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
5420  'I','n','s','t','a','l','l','e','r','\\',
5421  'R','u','n','O','n','c','e','E','n','t','r','i','e','s',0};
5422 
5423  static const WCHAR msiexec_fmt[] = {
5424  '%','s',
5425  '\\','M','s','i','E','x','e','c','.','e','x','e',' ','/','@',' ',
5426  '\"','%','s','\"',0};
5427  static const WCHAR install_fmt[] = {
5428  '/','I',' ','\"','%','s','\"',' ',
5429  'A','F','T','E','R','R','E','B','O','O','T','=','1',' ',
5430  'R','U','N','O','N','C','E','E','N','T','R','Y','=','\"','%','s','\"',0};
5431  WCHAR buffer[256], sysdir[MAX_PATH], squashed_pc[SQUASHED_GUID_SIZE];
5432  HKEY hkey;
5433 
5434  squash_guid( package->ProductCode, squashed_pc );
5435 
5436  GetSystemDirectoryW(sysdir, sizeof(sysdir)/sizeof(sysdir[0]));
5437  RegCreateKeyW(HKEY_LOCAL_MACHINE,RunOnce,&hkey);
5438  snprintfW( buffer, sizeof(buffer)/sizeof(buffer[0]), msiexec_fmt, sysdir, squashed_pc );
5439 
5440  msi_reg_set_val_str( hkey, squashed_pc, buffer );
5441  RegCloseKey(hkey);
5442 
5443  TRACE("Reboot command %s\n",debugstr_w(buffer));
5444 
5446  sprintfW( buffer, install_fmt, package->ProductCode, squashed_pc );
5447 
5448  msi_reg_set_val_str( hkey, squashed_pc, buffer );
5449  RegCloseKey(hkey);
5450 
5451  return ERROR_INSTALL_SUSPEND;
5452 }
LPWSTR ProductCode
Definition: msipriv.h:426
#define snprintfW
Definition: unicode.h:60
GLuint buffer
Definition: glext.h:5915
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define debugstr_w
Definition: kernel32.h:32
LONG msi_reg_set_val_str(HKEY hkey, LPCWSTR name, LPCWSTR value) DECLSPEC_HIDDEN
Definition: registry.c:360
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR InstallRunOnce[]
Definition: msiexec.c:51
#define MAX_PATH
Definition: compat.h:26
LONG WINAPI RegCreateKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1202
#define ERROR_INSTALL_SUSPEND
Definition: winerror.h:962
#define SQUASHED_GUID_SIZE
Definition: msipriv.h:711
#define sprintfW
Definition: unicode.h:58
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: path.c:2312
BOOL squash_guid(LPCWSTR in, LPWSTR out) DECLSPEC_HIDDEN
Definition: registry.c:225
#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 1612 of file action.c.

1613 {
1614  MSICOMPONENT *comp;
1615  UINT r;
1616 
1618  {
1619  if (!comp->ComponentId) continue;
1620 
1623  &comp->Installed );
1624  if (r == ERROR_SUCCESS) continue;
1625 
1628  &comp->Installed );
1629  if (r == ERROR_SUCCESS) continue;
1630 
1633  &comp->Installed );
1634  if (r == ERROR_SUCCESS) continue;
1635 
1637  }
1638 }
LPWSTR ProductCode
Definition: msipriv.h:426
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
smooth NULL
Definition: ftsmooth.c:416
struct list components
Definition: msipriv.h:392
uint32_t entry
Definition: isohybrid.c:63
LPWSTR ComponentId
Definition: msipriv.h:503
unsigned int UINT
Definition: ndis.h:50
INSTALLSTATE Installed
Definition: msipriv.h:508
UINT WINAPI MsiQueryComponentStateW(LPCWSTR szProductCode, LPCWSTR szUserSid, MSIINSTALLCONTEXT dwContext, LPCWSTR szComponent, INSTALLSTATE *pdwState)
Definition: msi.c:2172

Referenced by ACTION_CostFinalize().

◆ ACTION_GetFeatureInstallStates()

static void ACTION_GetFeatureInstallStates ( MSIPACKAGE package)
static

Definition at line 1640 of file action.c.

1641 {
1643 
1645  {
1647 
1649  feature->Installed = INSTALLSTATE_ABSENT;
1650  else
1651  feature->Installed = state;
1652  }
1653 }
LPWSTR ProductCode
Definition: msipriv.h:426
INTERNETFEATURELIST feature
Definition: misc.c:1689
INSTALLSTATE WINAPI MsiQueryFeatureStateW(LPCWSTR szProduct, LPCWSTR szFeature)
Definition: msi.c:3118
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
struct list features
Definition: msipriv.h:393
static int state
Definition: maze.c:121
uint32_t entry
Definition: isohybrid.c:63
int INSTALLSTATE
Definition: msiserver.idl:35

Referenced by ACTION_CostFinalize().

◆ ACTION_GetSharedDLLsCount()

static UINT ACTION_GetSharedDLLsCount ( LPCWSTR  dll)
static

Definition at line 3388 of file action.c.

3389 {
3390  HKEY hkey;
3391  DWORD count=0;
3392  DWORD type;
3393  DWORD sz = sizeof(count);
3394  DWORD rc;
3395 
3396  hkey = openSharedDLLsKey();
3397  rc = RegQueryValueExW(hkey, dll, NULL, &type, (LPBYTE)&count, &sz);
3398  if (rc != ERROR_SUCCESS)
3399  count = 0;
3400  RegCloseKey(hkey);
3401  return count;
3402 }
#define ERROR_SUCCESS
Definition: deptool.c:10
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static HMODULE dll
Definition: str.c:188
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
smooth NULL
Definition: ftsmooth.c:416
static HKEY openSharedDLLsKey(void)
Definition: action.c:3374
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
unsigned long DWORD
Definition: ntddk_ex.h:95

Referenced by ACTION_RefCountComponent().

◆ ACTION_HandleCustomAction()

static UINT ACTION_HandleCustomAction ( MSIPACKAGE package,
LPCWSTR  action,
UINT  script 
)
static

Definition at line 614 of file action.c.

615 {
616  UINT arc;
617  INT uirc;
618 
619  uirc = ui_actionstart(package, action, NULL, NULL);
620  if (uirc == IDCANCEL)
621  return ERROR_INSTALL_USEREXIT;
622  ui_actioninfo(package, action, TRUE, 0);
623  arc = ACTION_CustomAction( package, action, script );
624  uirc = !arc;
625 
626  if (arc == ERROR_FUNCTION_NOT_CALLED && needs_ui_sequence(package))
627  {
628  uirc = ACTION_ShowDialog(package, action);
629  switch (uirc)
630  {
631  case -1:
632  return ERROR_SUCCESS; /* stop immediately */
633  case 0: arc = ERROR_FUNCTION_NOT_CALLED; break;
634  case 1: arc = ERROR_SUCCESS; break;
635  case 2: arc = ERROR_INSTALL_USEREXIT; break;
636  case 3: arc = ERROR_INSTALL_FAILURE; break;
637  case 4: arc = ERROR_INSTALL_SUSPEND; break;
638  case 5: arc = ERROR_MORE_DATA; break;
639  case 6: arc = ERROR_INVALID_HANDLE_STATE; break;
640  case 7: arc = ERROR_INVALID_DATA; break;
641  case 8: arc = ERROR_INSTALL_ALREADY_RUNNING; break;
642  case 9: arc = ERROR_INSTALL_PACKAGE_REJECTED; break;
643  default: arc = ERROR_FUNCTION_FAILED; break;
644  }
645  }
646 
647  ui_actioninfo(package, action, FALSE, uirc);
648 
649  return arc;
650 }
#define ERROR_INSTALL_PACKAGE_REJECTED
Definition: winerror.h:983
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
int32_t INT
Definition: typedefs.h:56
static void ui_actioninfo(MSIPACKAGE *package, LPCWSTR action, BOOL start, INT rc)
Definition: action.c:196
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
INT ACTION_ShowDialog(MSIPACKAGE *package, const WCHAR *dialog)
Definition: dialog.c:4465
#define ERROR_INVALID_HANDLE_STATE
Definition: winerror.h:967
#define ERROR_FUNCTION_NOT_CALLED
Definition: winerror.h:984
smooth NULL
Definition: ftsmooth.c:416
script
Definition: msipriv.h:374
static BOOL needs_ui_sequence(MSIPACKAGE *package)
Definition: action.c:478
#define ERROR_INSTALL_USEREXIT
Definition: winerror.h:960
#define ERROR_INSTALL_FAILURE
Definition: winerror.h:961
static INT ui_actionstart(MSIPACKAGE *package, LPCWSTR action, LPCWSTR description, LPCWSTR template)
Definition: action.c:170
#define ERROR_MORE_DATA
Definition: dderror.h:13
UINT ACTION_CustomAction(MSIPACKAGE *package, LPCWSTR action, UINT script)
Definition: custom.c:1193
#define ERROR_INVALID_DATA
Definition: winerror.h:116
#define ERROR_INSTALL_SUSPEND
Definition: winerror.h:962
const WCHAR * action
Definition: action.c:7783
#define ERROR_INSTALL_ALREADY_RUNNING
Definition: winerror.h:976
unsigned int UINT
Definition: ndis.h:50
#define IDCANCEL
Definition: winuser.h:825

Referenced by ACTION_PerformAction().

◆ ACTION_HandleStandardAction()

static UINT ACTION_HandleStandardAction ( MSIPACKAGE package,
LPCWSTR  action 
)
static

Definition at line 7871 of file action.c.

7872 {
7874  UINT i;
7875 
7876  i = 0;
7877  while (StandardActions[i].action != NULL)
7878  {
7880  {
7881  WCHAR description[100] = {0}, template[100] = {0};
7882 
7883  if (StandardActions[i].description != 0)
7885  if (StandardActions[i].template != 0)
7886  LoadStringW(msi_hInstance, StandardActions[i].template, (LPWSTR)&template, 100);
7887 
7888  ui_actionstart(package, action, description, template);
7889  if (StandardActions[i].handler)
7890  {
7891  ui_actioninfo( package, action, TRUE, 0 );
7892  rc = StandardActions[i].handler( package );
7893  ui_actioninfo( package, action, FALSE, !rc );
7894 
7895  if (StandardActions[i].action_rollback && !package->need_rollback)
7896  {
7897  TRACE("scheduling rollback action\n");
7899  }
7900  }
7901  else
7902  {
7903  FIXME("unhandled standard action %s\n", debugstr_w(action));
7904  rc = ERROR_SUCCESS;
7905  }
7906  break;
7907  }
7908  i++;
7909  }
7910  return rc;
7911 }
static const struct @474 StandardActions[]
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * action_rollback
Definition: action.c:7787
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
static void ui_actioninfo(MSIPACKAGE *package, LPCWSTR action, BOOL start, INT rc)
Definition: action.c:196
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
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
#define ERROR_FUNCTION_NOT_CALLED
Definition: winerror.h:984
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
HINSTANCE msi_hInstance
Definition: msi_main.c:51
static INT ui_actionstart(MSIPACKAGE *package, LPCWSTR action, LPCWSTR description, LPCWSTR template)
Definition: action.c:170
const WCHAR * action
Definition: action.c:7783
unsigned int UINT
Definition: ndis.h:50
const UINT description
Definition: action.c:7784
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229
UINT(* handler)(MSIPACKAGE *)
Definition: action.c:7786
WCHAR * LPWSTR
Definition: xmlstorage.h:184
unsigned char need_rollback
Definition: msipriv.h:449
UINT msi_schedule_action(MSIPACKAGE *package, UINT script, const WCHAR *action)
Definition: custom.c:71

Referenced by ACTION_PerformAction().

◆ ACTION_INSTALL()

static UINT ACTION_INSTALL ( MSIPACKAGE package)
static

Definition at line 5700 of file action.c.

5701 {
5702  msi_set_property(package->db, szEXECUTEACTION, szINSTALL, -1);
5703  if (needs_ui_sequence(package) && ui_sequence_exists(package))
5704  {
5705  package->InWhatSequence |= SEQUENCE_UI;
5706  return ACTION_ProcessUISequence(package);
5707  }
5708  else
5709  return ACTION_ExecuteAction(package);
5710 }
static const WCHAR szINSTALL[]
Definition: action.c:160
static BOOL needs_ui_sequence(MSIPACKAGE *package)
Definition: action.c:478
static UINT ACTION_ExecuteAction(MSIPACKAGE *package)
Definition: action.c:5580
MSIDATABASE * db
Definition: msipriv.h:386
static const WCHAR szEXECUTEACTION[]
Definition: msipriv.h:1200
UINT InWhatSequence
Definition: msipriv.h:420
static UINT ACTION_ProcessUISequence(MSIPACKAGE *package)
Definition: action.c:591
UINT msi_set_property(MSIDATABASE *, const WCHAR *, const WCHAR *, int) DECLSPEC_HIDDEN
Definition: package.c:2149
static BOOL ui_sequence_exists(MSIPACKAGE *package)
Definition: action.c:424
#define SEQUENCE_UI
Definition: msipriv.h:695

◆ ACTION_InstallAdminPackage()

static UINT ACTION_InstallAdminPackage ( MSIPACKAGE package)
static

Definition at line 7499 of file action.c.

7500 {
7501  FIXME("%p\n", package);
7502  return ERROR_SUCCESS;
7503 }
#define ERROR_SUCCESS
Definition: deptool.c:10
#define FIXME(fmt,...)
Definition: debug.h:110

◆ ACTION_InstallExecute()

static UINT ACTION_InstallExecute ( MSIPACKAGE package)
static

Definition at line 5259 of file action.c.

5260 {
5261  return execute_script(package, SCRIPT_INSTALL);
5262 }
static UINT execute_script(MSIPACKAGE *package, UINT script)
Definition: action.c:1550

◆ ACTION_InstallFinalize()

static UINT ACTION_InstallFinalize ( MSIPACKAGE package)
static

Definition at line 5387 of file action.c.

5388 {
5389  UINT rc;
5390 
5391  /* first do the same as an InstallExecute */
5392  rc = execute_script(package, SCRIPT_INSTALL);
5393  if (rc != ERROR_SUCCESS)
5394  return rc;
5395 
5396  /* then handle commit actions */
5397  rc = execute_script(package, SCRIPT_COMMIT);
5398  if (rc != ERROR_SUCCESS)
5399  return rc;
5400 
5401  if (is_full_uninstall(package))
5402  rc = ACTION_UnpublishProduct(package);
5403 
5404  return rc;
5405 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static UINT execute_script(MSIPACKAGE *package, UINT script)
Definition: action.c:1550
static BOOL is_full_uninstall(MSIPACKAGE *package)
Definition: action.c:5373
unsigned int UINT
Definition: ndis.h:50
static UINT ACTION_UnpublishProduct(MSIPACKAGE *package)
Definition: action.c:5341

◆ ACTION_InstallInitialize()

static UINT ACTION_InstallInitialize ( MSIPACKAGE package)
static

Definition at line 3218 of file action.c.

3219 {
3220  return ERROR_SUCCESS;
3221 }
#define ERROR_SUCCESS
Definition: deptool.c:10

◆ ACTION_InstallODBC()

static UINT ACTION_InstallODBC ( MSIPACKAGE package)
static

Definition at line 6746 of file action.c.

6747 {
6748  static const WCHAR driver_query[] = {
6749  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
6750  'O','D','B','C','D','r','i','v','e','r',0};
6751  static const WCHAR translator_query[] = {
6752  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
6753  'O','D','B','C','T','r','a','n','s','l','a','t','o','r',0};
6754  static const WCHAR source_query[] = {
6755  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
6756  'O','D','B','C','D','a','t','a','S','o','u','r','c','e',0};
6757  MSIQUERY *view;
6758  UINT rc;
6759 
6760  rc = MSI_DatabaseOpenViewW(package->db, driver_query, &view);
6761  if (rc == ERROR_SUCCESS)
6762  {
6764  msiobj_release(&view->hdr);
6765  if (rc != ERROR_SUCCESS)
6766  return rc;
6767  }
6768  rc = MSI_DatabaseOpenViewW(package->db, translator_query, &view);
6769  if (rc == ERROR_SUCCESS)
6770  {
6772  msiobj_release(&view->hdr);
6773  if (rc != ERROR_SUCCESS)
6774  return rc;
6775  }
6776  rc = MSI_DatabaseOpenViewW(package->db, source_query, &view);
6777  if (rc == ERROR_SUCCESS)
6778  {
6780  msiobj_release(&view->hdr);
6781  if (rc != ERROR_SUCCESS)
6782  return rc;
6783  }
6784  return ERROR_SUCCESS;
6785 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static UINT ITERATE_InstallODBCTranslator(MSIRECORD *rec, LPVOID param)
Definition: action.c:6598
static UINT ITERATE_InstallODBCDriver(MSIRECORD *rec, LPVOID param)
Definition: action.c:6499
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
unsigned int UINT
Definition: ndis.h:50
static UINT ITERATE_InstallODBCDataSource(MSIRECORD *rec, LPVOID param)
Definition: action.c:6686
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:168
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

◆ ACTION_InstallServices()

static UINT ACTION_InstallServices ( MSIPACKAGE package)
static

Definition at line 6065 of file action.c.

6066 {
6067  static const WCHAR query[] = {
6068  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
6069  'S','e','r','v','i','c','e','I','n','s','t','a','l','l',0};
6070  MSIQUERY *view;
6071  UINT rc;
6072 
6073  rc = MSI_DatabaseOpenViewW(package->db, query, &view);
6074  if (rc != ERROR_SUCCESS)
6075  return ERROR_SUCCESS;
6076 
6078  msiobj_release(&view->hdr);
6079  return rc;
6080 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static UINT ITERATE_InstallService(MSIRECORD *rec, LPVOID param)
Definition: action.c:5934
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
unsigned int UINT
Definition: ndis.h:50
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:168
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

◆ ACTION_InstallSFPCatalogFile()

static UINT ACTION_InstallSFPCatalogFile ( MSIPACKAGE package)
static

Definition at line 7775 of file action.c.

7776 {
7777  static const WCHAR table[] = { 'S','F','P','C','a','t','a','l','o','g',0 };
7778  return msi_unimplemented_action_stub( package, "InstallSFPCatalogFile", table );
7779 }
__wchar_t WCHAR
Definition: xmlstorage.h:180
static UINT msi_unimplemented_action_stub(MSIPACKAGE *package, LPCSTR action, LPCWSTR table)
Definition: action.c:7730

◆ ACTION_InstallValidate()

static UINT ACTION_InstallValidate ( MSIPACKAGE package)
static

Definition at line 3224 of file action.c.

3225 {
3226  static const WCHAR query[]= {
3227  'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ',
3228  '`','R','e','g','i','s','t','r','y','`',0};
3229  MSICOMPONENT *comp;
3230  DWORD total = 0, count = 0;
3231  MSIQUERY *view;
3233  MSIFILE *file;
3234  UINT rc;
3235 
3236  TRACE("InstallValidate\n");
3237 
3238  rc = MSI_DatabaseOpenViewW( package->db, query, &view );
3239  if (rc == ERROR_SUCCESS)
3240  {
3241  rc = MSI_IterateRecords( view, &count, NULL, package );
3242  msiobj_release( &view->hdr );
3243  if (rc != ERROR_SUCCESS)
3244  return rc;
3245  total += count * REG_PROGRESS_VALUE;
3246  }
3247  LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry )
3248  total += COMPONENT_PROGRESS_VALUE;
3249 
3250  LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry )
3251  total += file->FileSize;
3252 
3253  msi_ui_progress( package, 0, total, 0, 0 );
3254 
3256  {
3257  TRACE("Feature: %s Installed %d Request %d Action %d\n",
3258  debugstr_w(feature->Feature), feature->Installed,
3259  feature->ActionRequest, feature->Action);
3260  }
3261  return ERROR_SUCCESS;
3262 }
INTERNETFEATURELIST feature
Definition: misc.c:1689
#define ERROR_SUCCESS
Definition: deptool.c:10
GLuint GLuint GLsizei count
Definition: gl.h:1545
void msi_ui_progress(MSIPACKAGE *package, int a, int b, int c, int d)
Definition: action.c:740
struct list files
Definition: msipriv.h:394
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
#define debugstr_w
Definition: kernel32.h:32
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
struct list features
Definition: msipriv.h:393
__wchar_t WCHAR
Definition: xmlstorage.h:180
const char file[]
Definition: icontest.c:11
unsigned long DWORD
Definition: ntddk_ex.h:95
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
#define REG_PROGRESS_VALUE
Definition: action.c:45
struct list components
Definition: msipriv.h:392
uint32_t entry
Definition: isohybrid.c:63
#define COMPONENT_PROGRESS_VALUE
Definition: action.c:46
unsigned int UINT
Definition: ndis.h:50
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:168
Definition: fci.c:126
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

◆ ACTION_IsolateComponents()

static UINT ACTION_IsolateComponents ( MSIPACKAGE package)
static

Definition at line 7750 of file action.c.

7751 {
7752  static const WCHAR table[] = {
7753  'I','s','o','l','a','t','e','d','C','o','m','p','o','n','e','n','t',0 };
7754  return msi_unimplemented_action_stub( package, "IsolateComponents", table );
7755 }
__wchar_t WCHAR
Definition: xmlstorage.h:180
static UINT msi_unimplemented_action_stub(MSIPACKAGE *package, LPCSTR action, LPCWSTR table)
Definition: action.c:7730

◆ ACTION_LaunchConditions()

static UINT ACTION_LaunchConditions ( MSIPACKAGE package)
static

Definition at line 3294 of file action.c.

3295 {
3296  static const WCHAR query[] = {
3297  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
3298  '`','L','a','u','n','c','h','C','o','n','d','i','t','i','o','n','`',0};
3299  MSIQUERY *view;
3300  UINT rc;
3301 
3302  TRACE("Checking launch conditions\n");
3303 
3304  rc = MSI_DatabaseOpenViewW(package->db, query, &view);
3305  if (rc != ERROR_SUCCESS)
3306  return ERROR_SUCCESS;
3307 
3309  msiobj_release(&view->hdr);
3310  return rc;
3311 }
#define ERROR_SUCCESS
Definition: deptool.c:10
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
unsigned int UINT
Definition: ndis.h:50
static IOleDocumentView * view
Definition: activex.c:1749
static UINT ITERATE_LaunchConditions(MSIRECORD *row, LPVOID param)
Definition: action.c:3264
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:168
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

◆ ACTION_MigrateFeatureStates()

static UINT ACTION_MigrateFeatureStates ( MSIPACKAGE package)
static

Definition at line 7638 of file action.c.

7639 {
7640  static const WCHAR query[] = {
7641  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
7642  'U','p','g','r','a','d','e',0};
7643  MSIQUERY *view;
7644  UINT r;
7645 
7646  if (msi_get_property_int( package->db, szInstalled, 0 ))
7647  {
7648  TRACE("product is installed, skipping action\n");
7649  return ERROR_SUCCESS;
7650  }
7651  if (msi_get_property_int( package->db, szPreselected, 0 ))
7652  {
7653  TRACE("Preselected property is set, not migrating feature states\n");
7654  return ERROR_SUCCESS;
7655  }
7656  r = MSI_DatabaseOpenViewW( package->db, query, &view );
7657  if (r == ERROR_SUCCESS)
7658  {
7660  msiobj_release( &view->hdr );
7661  if (r != ERROR_SUCCESS)
7662  return r;
7663  }
7664  return ERROR_SUCCESS;
7665 }
static const WCHAR szPreselected[]
Definition: msipriv.h:1116
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
int msi_get_property_int(MSIDATABASE *package, LPCWSTR prop, int def) DECLSPEC_HIDDEN
Definition: package.c:2392
smooth NULL
Definition: ftsmooth.c:416
static UINT ITERATE_MigrateFeatureStates(MSIRECORD *rec, LPVOID param)
Definition: action.c:7603
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
unsigned int UINT
Definition: ndis.h:50
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:168
static const WCHAR szInstalled[]
Definition: msipriv.h:1122
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

◆ ACTION_PerformAction()

UINT ACTION_PerformAction ( MSIPACKAGE package,
const WCHAR action,
UINT  script 
)

Definition at line 7913 of file action.c.

7914 {
7915  UINT rc;
7916 
7917  TRACE("Performing action (%s)\n", debugstr_w(action));
7918 
7919  package->action_progress_increment = 0;
7920  rc = ACTION_HandleStandardAction(package, action);
7921 
7922  if (rc == ERROR_FUNCTION_NOT_CALLED)
7923  rc = ACTION_HandleCustomAction(package, action, script);
7924 
7925  if (rc == ERROR_FUNCTION_NOT_CALLED)
7926  WARN("unhandled msi action %s\n", debugstr_w(action));
7927 
7928  return rc;
7929 }
#define WARN(fmt,...)
Definition: debug.h:111
#define debugstr_w
Definition: kernel32.h:32
#define ERROR_FUNCTION_NOT_CALLED
Definition: winerror.h:984
script
Definition: msipriv.h:374
#define TRACE(s)
Definition: solgame.cpp:4
static UINT ACTION_HandleCustomAction(MSIPACKAGE *package, LPCWSTR action, UINT script)
Definition: action.c:614
const WCHAR * action
Definition: action.c:7783
unsigned int UINT
Definition: ndis.h:50
UINT action_progress_increment
Definition: msipriv.h:404
static UINT ACTION_HandleStandardAction(MSIPACKAGE *package, LPCWSTR action)
Definition: action.c:7871

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

7932 {
7933  UINT rc = ERROR_SUCCESS;
7934  MSIRECORD *row;
7935 
7936  static const WCHAR query[] =
7937  {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
7938  '`','I','n','s','t','a','l','l','E','x','e','c','u','t','e',
7939  'S','e','q','u','e','n','c','e','`',' ', 'W','H','E','R','E',' ',
7940  '`','S','e','q','u','e','n','c','e','`',' ', '=',' ','%','i',0};
7941  static const WCHAR ui_query[] =
7942  {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
7943  '`','I','n','s','t','a','l','l','U','I','S','e','q','u','e','n','c','e',
7944  '`', ' ', 'W','H','E','R','E',' ','`','S','e','q','u','e','n','c','e','`',
7945  ' ', '=',' ','%','i',0};
7946 
7947  if (needs_ui_sequence(package))
7948  row = MSI_QueryGetRecord(package->db, ui_query, seq);
7949  else
7950  row = MSI_QueryGetRecord(package->db, query, seq);
7951 
7952  if (row)
7953  {
7954  LPCWSTR action, cond;
7955 
7956  TRACE("Running the actions\n");
7957 
7958  /* check conditions */
7959  cond = MSI_RecordGetString(row, 2);
7960 
7961  /* this is a hack to skip errors in the condition code */
7962  if (MSI_EvaluateConditionW(package, cond) == MSICONDITION_FALSE)
7963  {
7964  msiobj_release(&row->hdr);
7965  return ERROR_SUCCESS;
7966  }
7967 
7969  if (!action)
7970  {
7971  ERR("failed to fetch action\n");
7972  msiobj_release(&row->hdr);
7973  return ERROR_FUNCTION_FAILED;
7974  }
7975 
7976  rc = ACTION_PerformAction(package, action, SCRIPT_NONE);
7977 
7978  msiobj_release(&row->hdr);
7979  }
7980 
7981  return rc;
7982 }
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
UINT ACTION_PerformAction(MSIPACKAGE *package, const WCHAR *action, UINT script)
Definition: action.c:7913
const WCHAR * MSI_RecordGetString(const MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:482
static BOOL needs_ui_sequence(MSIPACKAGE *package)
Definition: action.c:478
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIRECORD * MSI_QueryGetRecord(MSIDATABASE *db, LPCWSTR query,...) DECLSPEC_HIDDEN
Definition: msiquery.c:206
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
#define ERR(fmt,...)
Definition: debug.h:109
const WCHAR * action
Definition: action.c:7783
unsigned int UINT
Definition: ndis.h:50
MSICONDITION MSI_EvaluateConditionW(MSIPACKAGE *package, LPCWSTR szCondition)
Definition: cond.tab.c:2442
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

Referenced by MSI_InstallPackage().

◆ ACTION_ProcessComponents()

static UINT ACTION_ProcessComponents ( MSIPACKAGE package)
static

Definition at line 3508 of file action.c.

3509 {
3510  WCHAR squashed_pc[SQUASHED_GUID_SIZE], squashed_cc[SQUASHED_GUID_SIZE];
3511  UINT rc;
3512  MSICOMPONENT *comp;
3513  HKEY hkey;
3514 
3515  TRACE("\n");
3516 
3517  squash_guid( package->ProductCode, squashed_pc );
3518  msi_set_sourcedir_props(package, FALSE);
3519 
3520  LIST_FOR_EACH_ENTRY( comp, &package->components, MSICOMPONENT, entry )
3521  {
3522  MSIRECORD *uirow;
3524 
3525  msi_ui_progress( package, 2, COMPONENT_PROGRESS_VALUE, 0, 0 );
3526  if (!comp->ComponentId)
3527  continue;
3528 
3529  squash_guid( comp->ComponentId, squashed_cc );
3530  msi_free( comp->FullKeypath );
3531  comp->FullKeypath = build_full_keypath( package, comp );
3532 
3533  ACTION_RefCountComponent( package, comp );
3534 
3535  if (package->need_rollback) action = comp->Installed;
3536  else action = comp->ActionRequest;
3537 
3538  TRACE("Component %s (%s) Keypath=%s RefCount=%u Clients=%u Action=%u\n",
3539  debugstr_w(comp->Component), debugstr_w(squashed_cc),
3540  debugstr_w(comp->FullKeypath), comp->RefCount, comp->num_clients, action);
3541 
3543  {
3544  if (package->Context == MSIINSTALLCONTEXT_MACHINE)
3546  else
3548 
3549  if (rc != ERROR_SUCCESS)
3550  continue;
3551 
3553  {
3554  static const WCHAR szPermKey[] =
3555  { '0','0','0','0','0','0','0','0','0','0','0','0',
3556  '0','0','0','0','0','0','0','0','0','0','0','0',
3557  '0','0','0','0','0','0','0','0',0 };
3558 
3559  msi_reg_set_val_str(hkey, szPermKey, comp->FullKeypath);
3560  }
3561  if (action == INSTALLSTATE_LOCAL)
3562  msi_reg_set_val_str( hkey, squashed_pc, comp->FullKeypath );
3563  else
3564  {
3565  MSIFILE *file;
3566  MSIRECORD *row;
3567  LPWSTR ptr, ptr2;
3569  WCHAR base[MAX_PATH];
3570  LPWSTR sourcepath;
3571 
3572  static const WCHAR fmt[] = {'%','0','2','d','\\',0};
3573  static const WCHAR query[] = {
3574  'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ',
3575  '`','M','e','d','i','a','`',' ','W','H','E','R','E',' ',
3576  '`','L','a','s','t','S','e','q','u','e','n','c','e','`',' ',
3577  '>','=',' ','%','i',' ','O','R','D','E','R',' ','B','Y',' ',
3578  '`','D','i','s','k','I','d','`',0};
3579 
3580  if (!comp->KeyPath || !(file = msi_get_loaded_file(package, comp->KeyPath)))
3581  continue;
3582 
3583  if (!(row = MSI_QueryGetRecord(package->db, query, file->Sequence)))
3584  return ERROR_FUNCTION_FAILED;
3585 
3587  ptr2 = strrchrW(source, '\\') + 1;
3588  msiobj_release(&row->hdr);
3589 
3590  lstrcpyW(base, package->PackagePath);
3591  ptr = strrchrW(base, '\\');
3592  *(ptr + 1) = '\0';
3593 
3594  sourcepath = msi_resolve_file_source(package, file);
3595  ptr = sourcepath + lstrlenW(base);
3596  lstrcpyW(ptr2, ptr);
3597  msi_free(sourcepath);
3598 
3599  msi_reg_set_val_str( hkey, squashed_pc, source );
3600  }
3601  RegCloseKey(hkey);
3602  }
3603  else if (action == INSTALLSTATE_ABSENT)
3604  {
3605  if (comp->num_clients <= 0)
3606  {
3607  if (package->Context == MSIINSTALLCONTEXT_MACHINE)
3609  else
3611 
3612  if (rc != ERROR_SUCCESS) WARN( "failed to delete component key %u\n", rc );
3613  }
3614  else
3615  {
3616  LONG res;
3617 
3618  if (package->Context == MSIINSTALLCONTEXT_MACHINE)
3620  else
3621  rc = MSIREG_OpenUserDataComponentKey( comp->ComponentId, NULL, &hkey, FALSE );
3622 
3623  if (rc != ERROR_SUCCESS)
3624  {
3625  WARN( "failed to open component key %u\n", rc );
3626  continue;
3627  }
3628  res = RegDeleteValueW( hkey, squashed_pc );
3629  RegCloseKey(hkey);
3630  if (res) WARN( "failed to delete component value %d\n", res );
3631  }
3632  }
3633 
3634  /* UI stuff */
3635  uirow = MSI_CreateRecord(3);
3636  MSI_RecordSetStringW(uirow,1,package->ProductCode);
3637  MSI_RecordSetStringW(uirow,2,comp->ComponentId);
3638  MSI_RecordSetStringW(uirow,3,comp->FullKeypath);
3640  msiobj_release( &uirow->hdr );
3641  }
3642  return ERROR_SUCCESS;
3643 }
LPWSTR ProductCode
Definition: msipriv.h:426
#define TRUE
Definition: types.h:120
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
Definition: record.c:649
#define ERROR_SUCCESS
Definition: deptool.c:10
static void ACTION_RefCountComponent(MSIPACKAGE *package, MSICOMPONENT *comp)
Definition: action.c:3417
MSIOBJECTHDR hdr
Definition: msipriv.h:141
LPWSTR PackagePath
Definition: msipriv.h:425
#define WARN(fmt,...)
Definition: debug.h:111
UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace)
Definition: action.c:441
void msi_ui_progress(MSIPACKAGE *package, int a, int b, int c, int d)
Definition: action.c:740
LPWSTR KeyPath
Definition: msipriv.h:507
#define lstrlenW
Definition: compat.h:407
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define ERROR_FUNCTION_FAILED
Definition: winerror.h:985
long LONG
Definition: pedump.c:60
#define debugstr_w
Definition: kernel32.h:32
INT MSI_ProcessMessage(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *) DECLSPEC_HIDDEN
Definition: package.c:1946
static PVOID ptr
Definition: dispmode.c:27
UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:674
smooth NULL
Definition: ftsmooth.c:416
INSTALLSTATE ActionRequest
Definition: msipriv.h:509
LONG msi_reg_set_val_str(HKEY hkey, LPCWSTR name, LPCWSTR value) DECLSPEC_HIDDEN
Definition: registry.c:360
MSIFILE * msi_get_loaded_file(MSIPACKAGE *package, const WCHAR *key)
Definition: action.c:674
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIRECORD * MSI_QueryGetRecord(MSIDATABASE *db, LPCWSTR query,...) DECLSPEC_HIDDEN
Definition: msiquery.c:206
static const WCHAR szLocalSid[]
Definition: msipriv.h:1104
#define MAX_PATH
Definition: compat.h:26
const char file[]
Definition: icontest.c:11
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
LPWSTR Component
Definition: msipriv.h:502
struct list components
Definition: msipriv.h:392
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
Definition: record.c:79
uint32_t entry
Definition: isohybrid.c:63
WINE_UNICODE_INLINE WCHAR * strrchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:254
int MSI_RecordGetInteger(MSIRECORD *, UINT) DECLSPEC_HIDDEN
Definition: record.c:245
UINT MSIREG_DeleteUserDataComponentKey(LPCWSTR szComponent, LPCWSTR szUserSid) DECLSPEC_HIDDEN
Definition: registry.c:699
LPWSTR ComponentId
Definition: msipriv.h:503
#define COMPONENT_PROGRESS_VALUE
Definition: action.c:46
int INSTALLSTATE
Definition: msiserver.idl:35
const WCHAR * action
Definition: action.c:7783
#define SQUASHED_GUID_SIZE
Definition: msipriv.h:711
#define lstrcpyW
Definition: compat.h:406
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
Definition: reg.c:2368
#define sprintfW
Definition: unicode.h:58
unsigned int UINT
Definition: ndis.h:50
WCHAR * msi_resolve_file_source(MSIPACKAGE *package, MSIFILE *file)
Definition: files.c:326
UINT Context
Definition: msipriv.h:437
INSTALLSTATE Installed
Definition: msipriv.h:508
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
LPWSTR FullKeypath
Definition: msipriv.h:515
GLuint res
Definition: glext.h:9613
WCHAR * LPWSTR
Definition: xmlstorage.h:184
static WCHAR * build_full_keypath(MSIPACKAGE *package, MSICOMPONENT *comp)
Definition: action.c:3490
unsigned char need_rollback
Definition: msipriv.h:449
Definition: dsound.c:943
BOOL squash_guid(LPCWSTR in, LPWSTR out) DECLSPEC_HIDDEN
Definition: registry.c:225
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
Definition: fci.c:126

◆ ACTION_ProcessExecSequence()

static UINT ACTION_ProcessExecSequence ( MSIPACKAGE package)
static

Definition at line 560 of file action.c.

561 {
562  static const WCHAR query[] = {
563  'S','E','L','E','C','T',' ','*',' ', 'F','R','O','M',' ',
564  '`','I','n','s','t','a','l','l','E','x','e','c','u','t','e',
565  'S','e','q','u','e','n','c','e','`',' ', 'W','H','E','R','E',' ',
566  '`','S','e','q','u','e','n','c','e','`',' ', '>',' ','0',' ',
567  'O','R','D','E','R',' ', 'B','Y',' ','`','S','e','q','u','e','n','c','e','`',0};
568  MSIQUERY *view;
569  UINT rc;
570 
571  if (package->ExecuteSequenceRun)
572  {
573  TRACE("Execute Sequence already Run\n");
574  return ERROR_SUCCESS;
575  }
576 
577  package->ExecuteSequenceRun = TRUE;
578 
579  rc = MSI_OpenQuery(package->db, &view, query);
580  if (rc == ERROR_SUCCESS)
581  {
582  TRACE("Running the actions\n");
583 
584  msi_set_property( package->db, szSourceDir, NULL, -1 );
585  rc = MSI_IterateRecords(view, NULL, ITERATE_Actions, package);
586  msiobj_release(&view->hdr);
587  }
588  return rc;
589 }
#define TRUE
Definition: types.h:120
#define ERROR_SUCCESS
Definition: deptool.c:10
BOOL ExecuteSequenceRun
Definition: msipriv.h:419
UINT MSI_OpenQuery(MSIDATABASE *, MSIQUERY **, LPCWSTR,...) DECLSPEC_HIDDEN
Definition: msiquery.c:143
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
static UINT ITERATE_Actions(MSIRECORD *row, LPVOID param)
Definition: action.c:497
static const WCHAR szSourceDir[]
Definition: msipriv.h:1100
unsigned int UINT
Definition: ndis.h:50
UINT msi_set_property(MSIDATABASE *, const WCHAR *, const WCHAR *, int) DECLSPEC_HIDDEN
Definition: package.c:2149
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:168

Referenced by ACTION_ExecuteAction().

◆ ACTION_ProcessUISequence()

static UINT ACTION_ProcessUISequence ( MSIPACKAGE package)
static

Definition at line 591 of file action.c.

592 {
593  static const WCHAR query[] = {
594  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
595  '`','I','n','s','t','a','l','l','U','I','S','e','q','u','e','n','c','e','`',' ',
596  'W','H','E','R','E',' ','`','S','e','q','u','e','n','c','e','`',' ','>',' ','0',' ',
597  'O','R','D','E','R',' ','B','Y',' ','`','S','e','q','u','e','n','c','e','`',0};
598  MSIQUERY *view;
599  UINT rc;
600 
601  rc = MSI_DatabaseOpenViewW(package->db, query, &view);
602  if (rc == ERROR_SUCCESS)
603  {
604  TRACE("Running the actions\n");
605  rc = MSI_IterateRecords(view, NULL, ITERATE_Actions, package);
606  msiobj_release(&view->hdr);
607  }
608  return rc;
609 }
#define ERROR_SUCCESS
Definition: deptool.c:10
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
static UINT ITERATE_Actions(MSIRECORD *row, LPVOID param)
Definition: action.c:497
unsigned int UINT
Definition: ndis.h:50
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:168
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

Referenced by ACTION_INSTALL().

◆ ACTION_PublishComponents()

static UINT ACTION_PublishComponents ( MSIPACKAGE package)
static

Definition at line 5845 of file action.c.

5846 {
5847  static const WCHAR query[] = {
5848  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
5849  '`','P','u','b','l','i','s','h','C','o','m','p','o','n','e','n','t','`',0};
5850  MSIQUERY *view;
5851  UINT rc;
5852 
5853  rc = MSI_DatabaseOpenViewW(package->db, query, &view);
5854  if (rc != ERROR_SUCCESS)
5855  return ERROR_SUCCESS;
5856 
5858  msiobj_release(&view->hdr);
5859  return rc;
5860 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static UINT ITERATE_PublishComponent(MSIRECORD *rec, LPVOID param)
Definition: action.c:5741
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
unsigned int UINT
Definition: ndis.h:50
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:168
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

◆ ACTION_PublishFeatures()

static UINT ACTION_PublishFeatures ( MSIPACKAGE package)
static

Definition at line 4918 of file action.c.

4919 {
4921  UINT rc;
4922  HKEY hkey = NULL, userdata = NULL;
4923 
4924  if (!msi_check_publish(package))
4925  return ERROR_SUCCESS;
4926 
4927  rc = MSIREG_OpenFeaturesKey(package->ProductCode, NULL, package->Context,
4928  &hkey, TRUE);
4929  if (rc != ERROR_SUCCESS)
4930  goto end;
4931 
4932  rc = MSIREG_OpenUserDataFeaturesKey(package->ProductCode, NULL, package->Context,
4933  &userdata, TRUE);
4934  if (rc != ERROR_SUCCESS)
4935  goto end;
4936 
4937  /* here the guids are base 85 encoded */
4939  {
4940  ComponentList *cl;
4941  LPWSTR data = NULL;
4942  GUID clsid;
4943  INT size;
4944  BOOL absent = FALSE;
4945  MSIRECORD *uirow;
4946 
4947  if (feature->Level <= 0) continue;
4948 
4949  if (feature->Action != INSTALLSTATE_LOCAL &&
4950  feature->Action != INSTALLSTATE_SOURCE &&
4951  feature->Action != INSTALLSTATE_ADVERTISED) absent = TRUE;
4952 
4953  size = 1;
4954  LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry )
4955  {
4956  size += 21;
4957  }
4958  if (feature->Feature_Parent)
4959  size += strlenW( feature->Feature_Parent )+2;
4960 
4961  data = msi_alloc(size * sizeof(WCHAR));
4962 
4963  data[0] = 0;
4964  LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry )
4965  {
4966  MSICOMPONENT* component = cl->component;
4967  WCHAR buf[21];
4968 
4969  buf[0] = 0;
4970  if (component->ComponentId)
4971  {
4972  TRACE("From %s\n",debugstr_w(component->ComponentId));
4973  CLSIDFromString(component->ComponentId, &clsid);
4975  TRACE("to %s\n",debugstr_w(buf));
4976  strcatW(data,buf);
4977  }
4978  }
4979 
4980  if (feature->Feature_Parent)
4981  {
4982  static const WCHAR sep[] = {'\2',0};
4983  strcatW(data,sep);
4984  strcatW(data,feature->Feature_Parent);
4985  }
4986 
4987  msi_reg_set_val_str( userdata, feature->Feature, data );
4988  msi_free(data);
4989 
4990  size = 0;
4991  if (feature->Feature_Parent)
4992  size = strlenW(feature->Feature_Parent)*sizeof(WCHAR);
4993  if (!absent)
4994  {
4995  size += sizeof(WCHAR);
4996  RegSetValueExW(hkey,feature->Feature,0,REG_SZ,
4997  (const BYTE*)(feature->Feature_Parent ? feature->Feature_Parent : szEmpty),size);
4998  }
4999  else
5000  {
5001  size += 2*sizeof(WCHAR);
5002  data = msi_alloc(size);
5003  data[0] = 0x6;
5004  data[1] = 0;
5005  if (feature->Feature_Parent)
5006  strcpyW( &data[1], feature->Feature_Parent );
5007  RegSetValueExW(hkey,feature->Feature,0,REG_SZ,
5008  (LPBYTE)data,size);
5009  msi_free(data);
5010  }
5011 
5012  /* the UI chunk */
5013  uirow = MSI_CreateRecord( 1 );
5014  MSI_RecordSetStringW( uirow, 1, feature->Feature );
5016  msiobj_release( &uirow->hdr );
5017  /* FIXME: call msi_ui_progress? */
5018  }
5019 
5020 end:
5021  RegCloseKey(hkey);
5022  RegCloseKey(userdata);
5023  return rc;
5024 }
LPWSTR ProductCode
Definition: msipriv.h:426
INTERNETFEATURELIST feature
Definition: misc.c:1689
#define TRUE
Definition: types.h:120
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
Definition: record.c:649
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define ERROR_SUCCESS
Definition: deptool.c:10
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
MSIOBJECTHDR hdr
Definition: msipriv.h:141
GLuint GLuint end
Definition: gl.h:1545
int32_t INT
Definition: typedefs.h:56
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:622
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
unsigned int BOOL
Definition: ntddk_ex.h:94
#define debugstr_w
Definition: kernel32.h:32
INT MSI_ProcessMessage(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *) DECLSPEC_HIDDEN
Definition: package.c:1946
smooth NULL
Definition: ftsmooth.c:416
LONG msi_reg_set_val_str(HKEY hkey, LPCWSTR name, LPCWSTR value) DECLSPEC_HIDDEN
Definition: registry.c:360
static const WCHAR szEmpty[]
Definition: provider.c:47
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:4917
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
struct list features
Definition: msipriv.h:393
static BOOL msi_check_publish(MSIPACKAGE *package)
Definition: action.c:4325
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
Definition: record.c:79
REFCLSID clsid
Definition: msctf.c:84
uint32_t entry
Definition: isohybrid.c:63
unsigned char BYTE
Definition: mem.h:68
LPWSTR ComponentId
Definition: msipriv.h:503
WINE_UNICODE_INLINE WCHAR * strcpyW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:219
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
unsigned int UINT
Definition: ndis.h:50
UINT Context
Definition: msipriv.h:437
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static void * msi_alloc(size_t len) __WINE_ALLOC_SIZE(1)
Definition: msipriv.h:1204
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2247
UINT MSIREG_OpenFeaturesKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:556
WCHAR * LPWSTR
Definition: xmlstorage.h:184
MSICOMPONENT * component
Definition: msipriv.h:529
BOOL encode_base85_guid(GUID *, LPWSTR) DECLSPEC_HIDDEN
Definition: registry.c:316
#define REG_SZ
Definition: layer.c:22

◆ ACTION_PublishProduct()

static UINT ACTION_PublishProduct ( MSIPACKAGE package)
static

Definition at line 4456 of file action.c.

4457 {
4458  UINT rc;
4459  HKEY hukey = NULL, hudkey = NULL;
4460  MSIRECORD *uirow;
4461 
4462  if (!list_empty(&package->patches))
4463  {
4464  rc = msi_publish_patches(package);
4465  if (rc != ERROR_SUCCESS)
4466  goto end;
4467  }
4468 
4469  /* FIXME: also need to publish if the product is in advertise mode */
4470  if (!msi_check_publish(package))
4471  return ERROR_SUCCESS;
4472 
4473  rc = MSIREG_OpenProductKey(package->ProductCode, NULL, package->Context,
4474  &hukey, TRUE);
4475  if (rc != ERROR_SUCCESS)
4476  goto end;
4477 
4478  rc = MSIREG_OpenUserDataProductKey(package->ProductCode, package->Context,
4479  NULL, &hudkey, TRUE);
4480  if (rc != ERROR_SUCCESS)
4481  goto end;
4482 
4483  rc = msi_publish_upgrade_code(package);
4484  if (rc != ERROR_SUCCESS)
4485  goto end;
4486 
4487  rc = msi_publish_product_properties(package, hukey);
4488  if (rc != ERROR_SUCCESS)
4489  goto end;
4490 
4491  rc = msi_publish_sourcelist(package, hukey);
4492  if (rc != ERROR_SUCCESS)
4493  goto end;
4494 
4495  rc = msi_publish_icons(package);
4496 
4497 end:
4498  uirow = MSI_CreateRecord( 1 );
4499  MSI_RecordSetStringW( uirow, 1, package->ProductCode );
4501  msiobj_release( &uirow->hdr );
4502 
4503  RegCloseKey(hukey);
4504  RegCloseKey(hudkey);
4505  return rc;
4506 }
LPWSTR ProductCode
Definition: msipriv.h:426
#define TRUE
Definition: types.h:120
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
Definition: record.c:649
static UINT msi_publish_icons(MSIPACKAGE *package)
Definition: action.c:4151
#define ERROR_SUCCESS
Definition: deptool.c:10
MSIOBJECTHDR hdr
Definition: msipriv.h:141
GLuint GLuint end
Definition: gl.h:1545
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
INT MSI_ProcessMessage(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *) DECLSPEC_HIDDEN
Definition: package.c:1946
smooth NULL
Definition: ftsmooth.c:416
static UINT msi_publish_upgrade_code(MSIPACKAGE *package)
Definition: action.c:4297
UINT MSIREG_OpenProductKey(LPCWSTR szProduct, LPCWSTR szUserSid, MSIINSTALLCONTEXT context, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:492
static BOOL msi_check_publish(MSIPACKAGE *package)
Definition: action.c:4325
static UINT msi_publish_product_properties(MSIPACKAGE *package, HKEY hkey)
Definition: action.c:4224
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:728
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
Definition: record.c:79
static UINT msi_publish_patches(MSIPACKAGE *package)
Definition: action.c:4353
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
Definition: list.h:143
static UINT msi_publish_sourcelist(MSIPACKAGE *package, HKEY hkey)
Definition: action.c:4170
unsigned int UINT
Definition: ndis.h:50
UINT Context
Definition: msipriv.h:437
struct list patches
Definition: msipriv.h:391

◆ ACTION_RefCountComponent()

static void ACTION_RefCountComponent ( MSIPACKAGE package,
MSICOMPONENT comp 
)
static

Definition at line 3417 of file action.c.

3418 {
3420  INT count = 0;
3421  BOOL write = FALSE;
3422 
3423  /* only refcount DLLs */
3424  if (comp->KeyPath == NULL ||
3425  comp->assembly ||
3428  write = FALSE;
3429  else
3430  {
3432  write = (count > 0);
3433 
3435  write = TRUE;
3436  }
3437 
3438  /* increment counts */
3440  {
3441  ComponentList *cl;
3442 
3444  continue;
3445 
3446  LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry )
3447  {
3448  if ( cl->component == comp )
3449  count++;
3450  }
3451  }
3452 
3453  /* decrement counts */
3455  {
3456  ComponentList *cl;
3457 
3459  continue;
3460 
3461  LIST_FOR_EACH_ENTRY( cl, &feature->Components, ComponentList, entry )
3462  {
3463  if ( cl->component == comp )
3464  count--;
3465  }
3466  }
3467 
3468  /* ref count all the files in the component */
3469  if (write)
3470  {
3471  MSIFILE *file;
3472 
3473  LIST_FOR_EACH_ENTRY( file, &package->files, MSIFILE, entry )
3474  {
3475  if (file->Component == comp)
3476  ACTION_WriteSharedDLLsCount( file->TargetPath, count );
3477  }
3478  }
3479 
3480  /* add a count for permanent */
3482  count ++;
3483 
3484  comp->RefCount = count;
3485 
3486  if (write)
3488 }
INTERNETFEATURELIST feature
Definition: misc.c:1689
#define TRUE
Definition: types.h:120
INSTALLSTATE msi_get_feature_action(MSIPACKAGE *package, MSIFEATURE *feature)
Definition: action.c:771
MSIASSEMBLY * assembly
Definition: msipriv.h:517
GLuint GLuint GLsizei count
Definition: gl.h:1545
LPWSTR KeyPath
Definition: msipriv.h:507
int32_t INT
Definition: typedefs.h:56
struct list files
Definition: msipriv.h:394
#define write
Definition: acwin.h:73
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
struct list features
Definition: msipriv.h:393
const char file[]
Definition: icontest.c:11
static UINT ACTION_WriteSharedDLLsCount(LPCWSTR path, UINT count)
Definition: action.c:3404
uint32_t entry
Definition: isohybrid.c:63
LPWSTR FullKeypath
Definition: msipriv.h:515
static UINT ACTION_GetSharedDLLsCount(LPCWSTR dll)
Definition: action.c:3388
MSICOMPONENT * component
Definition: msipriv.h:529
Definition: fci.c:126

Referenced by ACTION_ProcessComponents().

◆ ACTION_RegisterComPlus()

static UINT ACTION_RegisterComPlus ( MSIPACKAGE package)
static

Definition at line 7763 of file action.c.

7764 {
7765  static const WCHAR table[] = { 'C','o','m','p','l','u','s',0 };
7766  return msi_unimplemented_action_stub( package, "RegisterComPlus", table );
7767 }
__wchar_t WCHAR
Definition: xmlstorage.h:180
static UINT msi_unimplemented_action_stub(MSIPACKAGE *package, LPCSTR action, LPCWSTR table)
Definition: action.c:7730

◆ ACTION_RegisterProduct()

static UINT ACTION_RegisterProduct ( MSIPACKAGE package)
static

Definition at line 5207 of file action.c.

5208 {
5209  WCHAR *upgrade_code, squashed_pc[SQUASHED_GUID_SIZE];
5210  MSIRECORD *uirow;
5211  HKEY hkey, props, upgrade_key;
5212  UINT rc;
5213 
5214  /* FIXME: also need to publish if the product is in advertise mode */
5215  if (!msi_check_publish(package))
5216  return ERROR_SUCCESS;
5217 
5218  rc = MSIREG_OpenUninstallKey(package->ProductCode, package->platform, &hkey, TRUE);
5219  if (rc != ERROR_SUCCESS)
5220  return rc;
5221 
5222  rc = MSIREG_OpenInstallProps(package->ProductCode, package->Context, NULL, &props, TRUE);
5223  if (rc != ERROR_SUCCESS)
5224  goto done;
5225 
5226  rc = msi_publish_install_properties(package, hkey);
5227  if (rc != ERROR_SUCCESS)
5228  goto done;
5229 
5230  rc = msi_publish_install_properties(package, props);
5231  if (rc != ERROR_SUCCESS)
5232  goto done;
5233 
5234  upgrade_code = msi_dup_property(package->db, szUpgradeCode);
5235  if (upgrade_code)
5236  {
5237  rc = MSIREG_OpenUpgradeCodesKey( upgrade_code, &upgrade_key, TRUE );
5238  if (rc == ERROR_SUCCESS)
5239  {
5240  squash_guid( package->ProductCode, squashed_pc );
5241  msi_reg_set_val_str( upgrade_key, squashed_pc, NULL );
5242  RegCloseKey( upgrade_key );
5243  }
5244  msi_free( upgrade_code );
5245  }
5247  package->delete_on_close = FALSE;
5248 
5249 done:
5250  uirow = MSI_CreateRecord( 1 );
5251  MSI_RecordSetStringW( uirow, 1, package->ProductCode );
5253  msiobj_release( &uirow->hdr );
5254 
5255  RegCloseKey(hkey);
5256  return ERROR_SUCCESS;
5257 }
LPWSTR ProductCode
Definition: msipriv.h:426
enum platform platform
Definition: msipriv.h:388
#define TRUE
Definition: types.h:120
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
Definition: record.c:649
#define ERROR_SUCCESS
Definition: deptool.c:10
MSIOBJECTHDR hdr
Definition: msipriv.h:141
static const WCHAR INSTALLPROPERTY_LOCALPACKAGEW[]
Definition: msi.h:343
UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:830
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
static const WCHAR szUpgradeCode[]
Definition: msipriv.h:1170
INT MSI_ProcessMessage(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *) DECLSPEC_HIDDEN
Definition: package.c:1946
smooth NULL
Definition: ftsmooth.c:416
LONG msi_reg_set_val_str(HKEY hkey, LPCWSTR name, LPCWSTR value) DECLSPEC_HIDDEN
Definition: registry.c:360
static UINT msi_publish_install_properties(MSIPACKAGE *package, HKEY hkey)
Definition: action.c:5073
static BOOL msi_check_publish(MSIPACKAGE *package)
Definition: action.c:4325
__wchar_t WCHAR
Definition: xmlstorage.h:180
LPWSTR localfile
Definition: msipriv.h:427
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
Definition: record.c:79
#define SQUASHED_GUID_SIZE
Definition: msipriv.h:711
unsigned int UINT
Definition: ndis.h:50
UINT Context
Definition: msipriv.h:437
UINT MSIREG_OpenUpgradeCodesKey(LPCWSTR szProduct, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:915
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
static const WCHAR props[]
Definition: wbemdisp.c:288
UINT MSIREG_OpenUninstallKey(const WCHAR *, enum platform, HKEY *, BOOL) DECLSPEC_HIDDEN
BOOL delete_on_close
Definition: msipriv.h:428
BOOL squash_guid(LPCWSTR in, LPWSTR out) DECLSPEC_HIDDEN
Definition: registry.c:225
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop) DECLSPEC_HIDDEN
Definition: package.c:2370

◆ ACTION_RegisterTypeLibraries()

static UINT ACTION_RegisterTypeLibraries ( MSIPACKAGE package)
static

Definition at line 3785 of file action.c.

3786 {
3787  static const WCHAR query[] = {
3788  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
3789  '`','T','y','p','e','L','i','b','`',0};
3790  MSIQUERY *view;
3791  UINT rc;
3792 
3793  rc = MSI_DatabaseOpenViewW(package->db, query, &view);
3794  if (rc != ERROR_SUCCESS)
3795  return ERROR_SUCCESS;
3796 
3798  msiobj_release(&view->hdr);
3799  return rc;
3800 }
#define ERROR_SUCCESS
Definition: deptool.c:10
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
static UINT ITERATE_RegisterTypeLibraries(MSIRECORD *row, LPVOID param)
Definition: action.c:3705
unsigned int UINT
Definition: ndis.h:50
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:168
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

◆ ACTION_RegisterUser()

static UINT ACTION_RegisterUser ( MSIPACKAGE package)
static

Definition at line 5508 of file action.c.

5509 {
5510  HKEY hkey = 0;
5511  LPWSTR buffer, productid = NULL;
5512  UINT i, rc = ERROR_SUCCESS;
5513  MSIRECORD *uirow;
5514 
5515  static const WCHAR szPropKeys[][80] =
5516  {
5517  {'P','r','o','d','u','c','t','I','D',0},
5518  {'U','S','E','R','N','A','M','E',0},
5519  {'C','O','M','P','A','N','Y','N','A','M','E',0},
5520  {0},
5521  };
5522 
5523  static const WCHAR szRegKeys[][80] =
5524  {
5525  {'P','r','o','d','u','c','t','I','D',0},
5526  {'R','e','g','O','w','n','e','r',0},
5527  {'R','e','g','C','o','m','p','a','n','y',0},
5528  {0},
5529  };
5530 
5531  if (msi_check_unpublish(package))
5532  {
5534  goto end;
5535  }
5536 
5537  productid = msi_dup_property( package->db, INSTALLPROPERTY_PRODUCTIDW );
5538  if (!productid)
5539  goto end;
5540 
5541  rc = MSIREG_OpenInstallProps(package->ProductCode, package->Context,
5542  NULL, &hkey, TRUE);
5543  if (rc != ERROR_SUCCESS)
5544  goto end;
5545 
5546  for( i = 0; szPropKeys[i][0]; i++ )
5547  {
5548  buffer = msi_dup_property( package->db, szPropKeys[i] );
5549  msi_reg_set_val_str( hkey, szRegKeys[i], buffer );
5550  msi_free( buffer );
5551  }
5552 
5553 end:
5554  uirow = MSI_CreateRecord( 1 );
5555  MSI_RecordSetStringW( uirow, 1, productid );
5557  msiobj_release( &uirow->hdr );
5558 
5559  msi_free(productid);
5560  RegCloseKey(hkey);
5561  return rc;
5562 }
LPWSTR ProductCode
Definition: msipriv.h:426
#define TRUE
Definition: types.h:120
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
Definition: record.c:649
#define ERROR_SUCCESS
Definition: deptool.c:10
MSIOBJECTHDR hdr
Definition: msipriv.h:141
GLuint buffer
Definition: glext.h:5915
GLuint GLuint end
Definition: gl.h:1545
UINT MSIREG_OpenInstallProps(LPCWSTR szProduct, MSIINSTALLCONTEXT dwContext, LPCWSTR szUserSid, HKEY *key, BOOL create) DECLSPEC_HIDDEN
Definition: registry.c:830
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
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
INT MSI_ProcessMessage(MSIPACKAGE *, INSTALLMESSAGE, MSIRECORD *) DECLSPEC_HIDDEN
Definition: package.c:1946
smooth NULL
Definition: ftsmooth.c:416
LONG msi_reg_set_val_str(HKEY hkey, LPCWSTR name, LPCWSTR value) DECLSPEC_HIDDEN
Definition: registry.c:360
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
MSIRECORD * MSI_CreateRecord(UINT) DECLSPEC_HIDDEN
Definition: record.c:79
static BOOL msi_check_unpublish(MSIPACKAGE *package)
Definition: action.c:4339
unsigned int UINT
Definition: ndis.h:50
UINT Context
Definition: msipriv.h:437
static BOOL msi_free(void *mem)
Definition: msipriv.h:1227
UINT MSIREG_DeleteUserDataProductKey(LPCWSTR, MSIINSTALLCONTEXT) DECLSPEC_HIDDEN
Definition: registry.c:856
static const WCHAR INSTALLPROPERTY_PRODUCTIDW[]
Definition: msi.h:363
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LPWSTR msi_dup_property(MSIDATABASE *db, LPCWSTR prop) DECLSPEC_HIDDEN
Definition: package.c:2370

◆ ACTION_RemoveEnvironmentStrings()

static UINT ACTION_RemoveEnvironmentStrings ( MSIPACKAGE package)
static

Definition at line 7418 of file action.c.

7419 {
7420  static const WCHAR query[] = {
7421  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
7422  '`','E','n','v','i','r','o','n','m','e','n','t','`',0};
7423  MSIQUERY *view;
7424  UINT rc;
7425 
7426  rc = MSI_DatabaseOpenViewW( package->db, query, &view );
7427  if (rc != ERROR_SUCCESS)
7428  return ERROR_SUCCESS;
7429 
7431  msiobj_release( &view->hdr );
7432  return rc;
7433 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static UINT ITERATE_RemoveEnvironmentString(MSIRECORD *rec, LPVOID param)
Definition: action.c:7293
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
unsigned int UINT
Definition: ndis.h:50
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:168
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

◆ ACTION_RemoveExistingProducts()

static UINT ACTION_RemoveExistingProducts ( MSIPACKAGE package)
static

Definition at line 7585 of file action.c.

7586 {
7587  static const WCHAR query[] = {
7588  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','U','p','g','r','a','d','e',0};
7589  MSIQUERY *view;
7590  UINT r;
7591 
7592  r = MSI_DatabaseOpenViewW( package->db, query, &view );
7593  if (r == ERROR_SUCCESS)
7594  {
7596  msiobj_release( &view->hdr );
7597  if (r != ERROR_SUCCESS)
7598  return r;
7599  }
7600  return ERROR_SUCCESS;
7601 }
#define ERROR_SUCCESS
Definition: deptool.c:10
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
static UINT ITERATE_RemoveExistingProducts(MSIRECORD *rec, LPVOID param)
Definition: action.c:7539
unsigned int UINT
Definition: ndis.h:50
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:168
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

◆ ACTION_RemoveFolders()

static UINT ACTION_RemoveFolders ( MSIPACKAGE package)
static

Definition at line 905 of file action.c.

906 {
907  static const WCHAR query[] = {
908  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
909  '`','C','r','e','a','t','e','F','o','l','d','e','r','`',0};
910  MSIQUERY *view;
911  UINT rc;
912 
913  rc = MSI_DatabaseOpenViewW( package->db, query, &view );
914  if (rc != ERROR_SUCCESS)
915  return ERROR_SUCCESS;
916 
918  msiobj_release( &view->hdr );
919  return rc;
920 }
#define ERROR_SUCCESS
Definition: deptool.c:10
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
unsigned int UINT
Definition: ndis.h:50
static UINT ITERATE_RemoveFolders(MSIRECORD *row, LPVOID param)
Definition: action.c:857
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:168
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

◆ ACTION_RemoveIniValues()

static UINT ACTION_RemoveIniValues ( MSIPACKAGE package)
static

Definition at line 4756 of file action.c.

4757 {
4758  static const WCHAR query[] = {
4759  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
4760  '`','I','n','i','F','i','l','e','`',0};
4761  static const WCHAR remove_query[] = {
4762  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
4763  '`','R','e','m','o','v','e','I','n','i','F','i','l','e','`',0};
4764  MSIQUERY *view;
4765  UINT rc;
4766 
4767  rc = MSI_DatabaseOpenViewW( package->db, query, &view );
4768  if (rc == ERROR_SUCCESS)
4769  {
4771  msiobj_release( &view->hdr );
4772  if (rc != ERROR_SUCCESS)
4773  return rc;
4774  }
4775  rc = MSI_DatabaseOpenViewW( package->db, remove_query, &view );
4776  if (rc == ERROR_SUCCESS)
4777  {
4779  msiobj_release( &view->hdr );
4780  if (rc != ERROR_SUCCESS)
4781  return rc;
4782  }
4783  return ERROR_SUCCESS;
4784 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static UINT ITERATE_RemoveIniValuesOnUninstall(MSIRECORD *row, LPVOID param)
Definition: action.c:4633
static UINT ITERATE_RemoveIniValuesOnInstall(MSIRECORD *row, LPVOID param)
Definition: action.c:4695
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
unsigned int UINT
Definition: ndis.h:50
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:168
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

◆ ACTION_RemoveODBC()

static UINT ACTION_RemoveODBC ( MSIPACKAGE package)
static

Definition at line 6924 of file action.c.

6925 {
6926  static const WCHAR driver_query[] = {
6927  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
6928  'O','D','B','C','D','r','i','v','e','r',0};
6929  static const WCHAR translator_query[] = {
6930  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
6931  'O','D','B','C','T','r','a','n','s','l','a','t','o','r',0};
6932  static const WCHAR source_query[] = {
6933  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
6934  'O','D','B','C','D','a','t','a','S','o','u','r','c','e',0};
6935  MSIQUERY *view;
6936  UINT rc;
6937 
6938  rc = MSI_DatabaseOpenViewW( package->db, driver_query, &view );
6939  if (rc == ERROR_SUCCESS)
6940  {
6942  msiobj_release( &view->hdr );
6943  if (rc != ERROR_SUCCESS)
6944  return rc;
6945  }
6946  rc = MSI_DatabaseOpenViewW( package->db, translator_query, &view );
6947  if (rc == ERROR_SUCCESS)
6948  {
6950  msiobj_release( &view->hdr );
6951  if (rc != ERROR_SUCCESS)
6952  return rc;
6953  }
6954  rc = MSI_DatabaseOpenViewW( package->db, source_query, &view );
6955  if (rc == ERROR_SUCCESS)
6956  {
6958  msiobj_release( &view->hdr );
6959  if (rc != ERROR_SUCCESS)
6960  return rc;
6961  }
6962  return ERROR_SUCCESS;
6963 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static UINT ITERATE_RemoveODBCDataSource(MSIRECORD *rec, LPVOID param)
Definition: action.c:6865
static UINT ITERATE_RemoveODBCTranslator(MSIRECORD *rec, LPVOID param)
Definition: action.c:6826
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
unsigned int UINT
Definition: ndis.h:50
static UINT ITERATE_RemoveODBCDriver(MSIRECORD *rec, LPVOID param)
Definition: action.c:6787
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:168
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

◆ ACTION_RemoveRegistryValues()

static UINT ACTION_RemoveRegistryValues ( MSIPACKAGE package)
static

Definition at line 3188 of file action.c.

3189 {
3190  static const WCHAR registry_query[] = {
3191  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
3192  '`','R','e','g','i','s','t','r','y','`',0};
3193  static const WCHAR remove_registry_query[] = {
3194  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
3195  '`','R','e','m','o','v','e','R','e','g','i','s','t','r','y','`',0};
3196  MSIQUERY *view;
3197  UINT rc;
3198 
3199  rc = MSI_DatabaseOpenViewW( package->db, registry_query, &view );
3200  if (rc == ERROR_SUCCESS)
3201  {
3203  msiobj_release( &view->hdr );
3204  if (rc != ERROR_SUCCESS)
3205  return rc;
3206  }
3207  rc = MSI_DatabaseOpenViewW( package->db, remove_registry_query, &view );
3208  if (rc == ERROR_SUCCESS)
3209  {
3211  msiobj_release( &view->hdr );
3212  if (rc != ERROR_SUCCESS)
3213  return rc;
3214  }
3215  return ERROR_SUCCESS;
3216 }
#define ERROR_SUCCESS
Definition: deptool.c:10
static UINT ITERATE_RemoveRegistryValuesOnUninstall(MSIRECORD *row, LPVOID param)
Definition: action.c:3057
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
static UINT ITERATE_RemoveRegistryValuesOnInstall(MSIRECORD *row, LPVOID param)
Definition: action.c:3125
unsigned int UINT
Definition: ndis.h:50
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:168
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

◆ ACTION_RemoveShortcuts()

static UINT ACTION_RemoveShortcuts ( MSIPACKAGE package)
static

Definition at line 4083 of file action.c.

4084 {
4085  static const WCHAR query[] = {
4086  'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',
4087  '`','S','h','o','r','t','c','u','t','`',0};
4088  MSIQUERY *view;
4089  UINT rc;
4090 
4091  rc = MSI_DatabaseOpenViewW( package->db, query, &view );
4092  if (rc != ERROR_SUCCESS)
4093  return ERROR_SUCCESS;
4094 
4096  msiobj_release( &view->hdr );
4097  return rc;
4098 }
#define ERROR_SUCCESS
Definition: deptool.c:10
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
MSIDATABASE * db
Definition: msipriv.h:386
int msiobj_release(MSIOBJECTHDR *info)
Definition: handle.c:242
static UINT ITERATE_RemoveShortcuts(MSIRECORD *row, LPVOID param)
Definition: action.c:4051
unsigned int UINT
Definition: ndis.h:50
static IOleDocumentView * view
Definition: activex.c:1749
UINT MSI_IterateRecords(MSIQUERY *, LPDWORD, record_func, LPVOID) DECLSPEC_HIDDEN
Definition: msiquery.c:168
UINT MSI_DatabaseOpenViewW(MSIDATABASE *, LPCWSTR, MSIQUERY **) DECLSPEC_HIDDEN
Definition: msiquery.c:111

◆ ACTION_ResolveSource()

static UINT ACTION_ResolveSource ( MSIPACKAGE package)
static

Definition at line 5454 of file action.c.

5455 {
5456  DWORD attrib;
5457  UINT rc;
5458 
5459  /*
5460  * We are currently doing what should be done here in the top level Install
5461  * however for Administrative and uninstalls this step will be needed
5462  */
5463  if (!package->PackagePath)
5464  return ERROR_SUCCESS;
5465 
5466  msi_set_sourcedir_props(package, TRUE);
5467 
5468  attrib = GetFileAttributesW(package->db->path);
5469  if (attrib == INVALID_FILE_ATTRIBUTES)
5470  {
5471  MSIRECORD *record;
5472  LPWSTR prompt;
5473  DWORD size = 0;
5474 
5475  rc = MsiSourceListGetInfoW(package->ProductCode, NULL,
5476  package->Context, MSICODE_PRODUCT,
5478  if (rc == ERROR_MORE_DATA)
5479  {
5480  prompt = msi_alloc(size * sizeof(WCHAR));
5482  package->Context, MSICODE_PRODUCT,
5484  }
5485  else
5486  prompt = strdupW(package->db->path);
5487 
5488  record = MSI_CreateRecord(2);
5490  MSI_RecordSetStringW(record, 2, prompt);
5491  msi_free(prompt);
5492  while(attrib == INVALID_FILE_ATTRIBUTES)
5493  {
5496  if (rc == IDCANCEL)
5497  return ERROR_INSTALL_USEREXIT;
5498  attrib = GetFileAttributesW(package->db->path);
5499  }
5500  rc = ERROR_SUCCESS;
5501  }
5502  else
5503  return ERROR_SUCCESS;
5504 
5505  return rc;
5506 }
LPWSTR ProductCode
Definition: msipriv.h:426
#define TRUE
Definition: types.h:120
UINT MSI_RecordSetStringW(MSIRECORD *, UINT, LPCWSTR) DECLSPEC_HIDDEN
Definition: record.c:649