msi: Add a length parameter to msi_set_property and use it where appropriate.
This commit is contained in:
parent
a7ff2818fe
commit
0f1d3474a8
|
@ -353,7 +353,7 @@ UINT msi_parse_command_line( MSIPACKAGE *package, LPCWSTR szCommandLine,
|
|||
remove_quotes( val );
|
||||
TRACE("Found commandline property %s = %s\n", debugstr_w(prop), debugstr_w(val));
|
||||
|
||||
r = msi_set_property( package->db, prop, val );
|
||||
r = msi_set_property( package->db, prop, val, -1 );
|
||||
if (r == ERROR_SUCCESS && !strcmpW( prop, szSourceDir ))
|
||||
msi_reset_folders( package, TRUE );
|
||||
|
||||
|
@ -462,7 +462,7 @@ UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace)
|
|||
check = msi_dup_property( package->db, szSourceDir );
|
||||
if (!check || replace)
|
||||
{
|
||||
UINT r = msi_set_property( package->db, szSourceDir, source );
|
||||
UINT r = msi_set_property( package->db, szSourceDir, source, -1 );
|
||||
if (r == ERROR_SUCCESS)
|
||||
msi_reset_folders( package, TRUE );
|
||||
}
|
||||
|
@ -470,7 +470,7 @@ UINT msi_set_sourcedir_props(MSIPACKAGE *package, BOOL replace)
|
|||
|
||||
check = msi_dup_property( package->db, szSOURCEDIR );
|
||||
if (!check || replace)
|
||||
msi_set_property( package->db, szSOURCEDIR, source );
|
||||
msi_set_property( package->db, szSOURCEDIR, source, -1 );
|
||||
|
||||
msi_free( check );
|
||||
msi_free( source );
|
||||
|
@ -605,7 +605,7 @@ static UINT ACTION_ProcessExecSequence(MSIPACKAGE *package, BOOL UIran)
|
|||
{
|
||||
TRACE("Running the actions\n");
|
||||
|
||||
msi_set_property(package->db, szSourceDir, NULL);
|
||||
msi_set_property( package->db, szSourceDir, NULL, -1 );
|
||||
rc = MSI_IterateRecords(view, NULL, ITERATE_Actions, package);
|
||||
msiobj_release(&view->hdr);
|
||||
}
|
||||
|
@ -1568,8 +1568,8 @@ static UINT load_all_folders( MSIPACKAGE *package )
|
|||
|
||||
static UINT ACTION_CostInitialize(MSIPACKAGE *package)
|
||||
{
|
||||
msi_set_property( package->db, szCostingComplete, szZero );
|
||||
msi_set_property( package->db, szRootDrive, szCRoot );
|
||||
msi_set_property( package->db, szCostingComplete, szZero, -1 );
|
||||
msi_set_property( package->db, szRootDrive, szCRoot, -1 );
|
||||
|
||||
load_all_folders( package );
|
||||
msi_load_all_components( package );
|
||||
|
@ -1785,7 +1785,7 @@ static BOOL process_overrides( MSIPACKAGE *package, int level )
|
|||
ret |= process_state_property( package, level, szAdvertise, INSTALLSTATE_ADVERTISED );
|
||||
|
||||
if (ret)
|
||||
msi_set_property( package->db, szPreselected, szOne );
|
||||
msi_set_property( package->db, szPreselected, szOne, -1 );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -2361,7 +2361,7 @@ void msi_resolve_target_folder( MSIPACKAGE *package, const WCHAR *name, BOOL loa
|
|||
msi_free( normalized_path );
|
||||
return;
|
||||
}
|
||||
msi_set_property( package->db, folder->Directory, normalized_path );
|
||||
msi_set_property( package->db, folder->Directory, normalized_path, -1 );
|
||||
msi_free( folder->ResolvedTarget );
|
||||
folder->ResolvedTarget = normalized_path;
|
||||
|
||||
|
@ -2422,15 +2422,15 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package)
|
|||
TRACE("Calculating file cost\n");
|
||||
calculate_file_cost( package );
|
||||
|
||||
msi_set_property( package->db, szCostingComplete, szOne );
|
||||
msi_set_property( package->db, szCostingComplete, szOne, -1 );
|
||||
/* set default run level if not set */
|
||||
level = msi_dup_property( package->db, szInstallLevel );
|
||||
if (!level)
|
||||
msi_set_property( package->db, szInstallLevel, szOne );
|
||||
msi_set_property( package->db, szInstallLevel, szOne, -1 );
|
||||
msi_free(level);
|
||||
|
||||
/* FIXME: check volume disk space */
|
||||
msi_set_property( package->db, szOutOfDiskSpace, szZero );
|
||||
msi_set_property( package->db, szOutOfDiskSpace, szZero, -1 );
|
||||
|
||||
return MSI_SetFeatureStates(package);
|
||||
}
|
||||
|
@ -7006,7 +7006,7 @@ UINT msi_validate_product_id( MSIPACKAGE *package )
|
|||
if (key && template)
|
||||
{
|
||||
FIXME( "partial stub: template %s key %s\n", debugstr_w(template), debugstr_w(key) );
|
||||
r = msi_set_property( package->db, szProductID, key );
|
||||
r = msi_set_property( package->db, szProductID, key, -1 );
|
||||
}
|
||||
msi_free( template );
|
||||
msi_free( key );
|
||||
|
@ -7046,7 +7046,7 @@ static UINT ACTION_DisableRollback( MSIPACKAGE *package )
|
|||
{
|
||||
TRACE("%p\n", package);
|
||||
|
||||
msi_set_property( package->db, szRollbackDisabled, szOne );
|
||||
msi_set_property( package->db, szRollbackDisabled, szOne, -1 );
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -7567,7 +7567,7 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
|
|||
BOOL ui_exists;
|
||||
UINT rc;
|
||||
|
||||
msi_set_property( package->db, szAction, szInstall );
|
||||
msi_set_property( package->db, szAction, szInstall, -1 );
|
||||
|
||||
package->script->InWhatSequence = SEQUENCE_INSTALL;
|
||||
|
||||
|
@ -7617,7 +7617,7 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
|
|||
if (!szCommandLine && msi_get_property_int( package->db, szInstalled, 0 ))
|
||||
{
|
||||
TRACE("setting reinstall property\n");
|
||||
msi_set_property( package->db, szReinstall, szAll );
|
||||
msi_set_property( package->db, szReinstall, szAll, -1 );
|
||||
}
|
||||
|
||||
/* properties may have been added by a transform */
|
||||
|
@ -7630,7 +7630,7 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
|
|||
if (msi_get_property_int( package->db, szDisableRollback, 0 ))
|
||||
{
|
||||
TRACE("disabling rollback\n");
|
||||
msi_set_property( package->db, szRollbackDisabled, szOne );
|
||||
msi_set_property( package->db, szRollbackDisabled, szOne, -1 );
|
||||
}
|
||||
|
||||
if (needs_ui_sequence( package))
|
||||
|
|
|
@ -1093,7 +1093,7 @@ static UINT iterate_appsearch(MSIRECORD *row, LPVOID param)
|
|||
r = ACTION_AppSearchSigName(package, sigName, &sig, &value);
|
||||
if (value)
|
||||
{
|
||||
r = msi_set_property( package->db, propName, value );
|
||||
r = msi_set_property( package->db, propName, value, -1 );
|
||||
if (r == ERROR_SUCCESS && !strcmpW( propName, szSourceDir ))
|
||||
msi_reset_folders( package, TRUE );
|
||||
|
||||
|
@ -1153,7 +1153,7 @@ static UINT ITERATE_CCPSearch(MSIRECORD *row, LPVOID param)
|
|||
if (value)
|
||||
{
|
||||
TRACE("Found signature %s\n", debugstr_w(signature));
|
||||
msi_set_property(package->db, success, szOne);
|
||||
msi_set_property( package->db, success, szOne, -1 );
|
||||
msi_free(value);
|
||||
r = ERROR_NO_MORE_ITEMS;
|
||||
}
|
||||
|
|
|
@ -184,25 +184,21 @@ static LPWSTR msi_get_deferred_action(LPCWSTR action, LPCWSTR actiondata,
|
|||
return deferred;
|
||||
}
|
||||
|
||||
static void set_deferred_action_props(MSIPACKAGE *package, LPWSTR deferred_data)
|
||||
static void set_deferred_action_props( MSIPACKAGE *package, const WCHAR *deferred_data )
|
||||
{
|
||||
LPWSTR end, beg = deferred_data + 1;
|
||||
|
||||
static const WCHAR sep[] = {'<','=','>',0};
|
||||
const WCHAR *end, *beg = deferred_data + 1;
|
||||
|
||||
end = strstrW(beg, sep);
|
||||
*end = '\0';
|
||||
msi_set_property(package->db, szCustomActionData, beg);
|
||||
msi_set_property( package->db, szCustomActionData, beg, end - beg );
|
||||
beg = end + 3;
|
||||
|
||||
end = strstrW(beg, sep);
|
||||
*end = '\0';
|
||||
msi_set_property(package->db, szUserSID, beg);
|
||||
msi_set_property( package->db, szUserSID, beg, end - beg );
|
||||
beg = end + 3;
|
||||
|
||||
end = strchrW(beg, ']');
|
||||
*end = '\0';
|
||||
msi_set_property(package->db, szProductCode, beg);
|
||||
msi_set_property( package->db, szProductCode, beg, end - beg );
|
||||
}
|
||||
|
||||
static MSIBINARY *create_temp_binary( MSIPACKAGE *package, LPCWSTR source, BOOL dll )
|
||||
|
@ -1284,9 +1280,9 @@ UINT ACTION_CustomAction(MSIPACKAGE *package, LPCWSTR action, UINT script, BOOL
|
|||
if (deferred_data)
|
||||
set_deferred_action_props(package, deferred_data);
|
||||
else if (actiondata)
|
||||
msi_set_property(package->db, szCustomActionData, actiondata);
|
||||
msi_set_property( package->db, szCustomActionData, actiondata, -1 );
|
||||
else
|
||||
msi_set_property(package->db, szCustomActionData, szEmpty);
|
||||
msi_set_property( package->db, szCustomActionData, szEmpty, -1 );
|
||||
|
||||
msi_free(actiondata);
|
||||
}
|
||||
|
@ -1335,7 +1331,7 @@ UINT ACTION_CustomAction(MSIPACKAGE *package, LPCWSTR action, UINT script, BOOL
|
|||
break;
|
||||
|
||||
deformat_string(package,target,&deformated);
|
||||
rc = msi_set_property( package->db, source, deformated );
|
||||
rc = msi_set_property( package->db, source, deformated, -1 );
|
||||
if (rc == ERROR_SUCCESS && !strcmpW( source, szSourceDir ))
|
||||
msi_reset_folders( package, TRUE );
|
||||
msi_free(deformated);
|
||||
|
|
|
@ -583,7 +583,7 @@ static void msi_dialog_update_controls( msi_dialog *dialog, LPCWSTR property )
|
|||
|
||||
static void msi_dialog_set_property( MSIPACKAGE *package, LPCWSTR property, LPCWSTR value )
|
||||
{
|
||||
UINT r = msi_set_property( package->db, property, value );
|
||||
UINT r = msi_set_property( package->db, property, value, -1 );
|
||||
if (r == ERROR_SUCCESS && !strcmpW( property, szSourceDir ))
|
||||
msi_reset_folders( package, TRUE );
|
||||
}
|
||||
|
@ -3939,7 +3939,7 @@ static UINT error_dialog_handler(MSIPACKAGE *package, LPCWSTR event,
|
|||
if ( !strcmpW( argument, error_abort ) || !strcmpW( argument, error_cancel ) ||
|
||||
!strcmpW( argument, error_no ) )
|
||||
{
|
||||
msi_set_property( package->db, result_prop, error_abort );
|
||||
msi_set_property( package->db, result_prop, error_abort, -1 );
|
||||
}
|
||||
|
||||
ControlEvent_CleanupSubscriptions(package);
|
||||
|
|
|
@ -173,7 +173,7 @@ static UINT ControlEvent_AddLocal( MSIPACKAGE *package, LPCWSTR argument, msi_di
|
|||
if (!strcmpW( argument, feature->Feature ) || !strcmpW( argument, szAll ))
|
||||
{
|
||||
if (feature->ActionRequest != INSTALLSTATE_LOCAL)
|
||||
msi_set_property( package->db, szPreselected, szOne );
|
||||
msi_set_property( package->db, szPreselected, szOne, -1 );
|
||||
MSI_SetFeatureStateW( package, feature->Feature, INSTALLSTATE_LOCAL );
|
||||
}
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ static UINT ControlEvent_Remove( MSIPACKAGE *package, LPCWSTR argument, msi_dial
|
|||
if (!strcmpW( argument, feature->Feature ) || !strcmpW( argument, szAll ))
|
||||
{
|
||||
if (feature->ActionRequest != INSTALLSTATE_ABSENT)
|
||||
msi_set_property( package->db, szPreselected, szOne );
|
||||
msi_set_property( package->db, szPreselected, szOne, -1 );
|
||||
MSI_SetFeatureStateW( package, feature->Feature, INSTALLSTATE_ABSENT );
|
||||
}
|
||||
}
|
||||
|
@ -205,7 +205,7 @@ static UINT ControlEvent_AddSource( MSIPACKAGE *package, LPCWSTR argument, msi_d
|
|||
if (!strcmpW( argument, feature->Feature ) || !strcmpW( argument, szAll ))
|
||||
{
|
||||
if (feature->ActionRequest != INSTALLSTATE_SOURCE)
|
||||
msi_set_property( package->db, szPreselected, szOne );
|
||||
msi_set_property( package->db, szPreselected, szOne, -1 );
|
||||
MSI_SetFeatureStateW( package, feature->Feature, INSTALLSTATE_SOURCE );
|
||||
}
|
||||
}
|
||||
|
@ -377,13 +377,13 @@ static UINT ControlEvent_DirectoryListUp(MSIPACKAGE *package, LPCWSTR argument,
|
|||
static UINT ControlEvent_ReinstallMode(MSIPACKAGE *package, LPCWSTR argument,
|
||||
msi_dialog *dialog)
|
||||
{
|
||||
return msi_set_property( package->db, szReinstallMode, argument );
|
||||
return msi_set_property( package->db, szReinstallMode, argument, -1 );
|
||||
}
|
||||
|
||||
static UINT ControlEvent_Reinstall( MSIPACKAGE *package, LPCWSTR argument,
|
||||
msi_dialog *dialog )
|
||||
{
|
||||
return msi_set_property( package->db, szReinstall, argument );
|
||||
return msi_set_property( package->db, szReinstall, argument, -1 );
|
||||
}
|
||||
|
||||
static UINT ControlEvent_ValidateProductID(MSIPACKAGE *package, LPCWSTR argument,
|
||||
|
|
|
@ -558,7 +558,7 @@ static void set_target_path( MSIPACKAGE *package, MSIFOLDER *folder, const WCHAR
|
|||
{
|
||||
msi_free( folder->ResolvedTarget );
|
||||
folder->ResolvedTarget = target_path;
|
||||
msi_set_property( package->db, folder->Directory, folder->ResolvedTarget );
|
||||
msi_set_property( package->db, folder->Directory, folder->ResolvedTarget, -1 );
|
||||
|
||||
LIST_FOR_EACH_ENTRY( fl, &folder->children, FolderList, entry )
|
||||
{
|
||||
|
@ -1650,6 +1650,7 @@ UINT MSI_SetInstallLevel( MSIPACKAGE *package, int iInstallLevel )
|
|||
{
|
||||
static const WCHAR fmt[] = { '%','d',0 };
|
||||
WCHAR level[6];
|
||||
int len;
|
||||
UINT r;
|
||||
|
||||
TRACE("%p %i\n", package, iInstallLevel);
|
||||
|
@ -1660,8 +1661,8 @@ UINT MSI_SetInstallLevel( MSIPACKAGE *package, int iInstallLevel )
|
|||
if (iInstallLevel < 1)
|
||||
return MSI_SetFeatureStates( package );
|
||||
|
||||
sprintfW( level, fmt, iInstallLevel );
|
||||
r = msi_set_property( package->db, szInstallLevel, level );
|
||||
len = sprintfW( level, fmt, iInstallLevel );
|
||||
r = msi_set_property( package->db, szInstallLevel, level, len );
|
||||
if ( r == ERROR_SUCCESS )
|
||||
r = MSI_SetFeatureStates( package );
|
||||
|
||||
|
|
|
@ -1003,7 +1003,7 @@ extern UINT ACTION_MsiUnpublishAssemblies(MSIPACKAGE *package) DECLSPEC_HIDDEN;
|
|||
extern DWORD deformat_string(MSIPACKAGE *package, LPCWSTR ptr, WCHAR** data ) DECLSPEC_HIDDEN;
|
||||
extern WCHAR *msi_dup_record_field(MSIRECORD *row, INT index) DECLSPEC_HIDDEN;
|
||||
extern LPWSTR msi_dup_property( MSIDATABASE *db, LPCWSTR prop ) DECLSPEC_HIDDEN;
|
||||
extern UINT msi_set_property( MSIDATABASE *, LPCWSTR, LPCWSTR ) DECLSPEC_HIDDEN;
|
||||
extern UINT msi_set_property( MSIDATABASE *, const WCHAR *, const WCHAR *, int ) DECLSPEC_HIDDEN;
|
||||
extern UINT msi_get_property( MSIDATABASE *, LPCWSTR, LPWSTR, LPDWORD ) DECLSPEC_HIDDEN;
|
||||
extern int msi_get_property_int( MSIDATABASE *package, LPCWSTR prop, int def ) DECLSPEC_HIDDEN;
|
||||
extern WCHAR *msi_resolve_source_folder(MSIPACKAGE *package, const WCHAR *name, MSIFOLDER **folder) DECLSPEC_HIDDEN;
|
||||
|
|
|
@ -483,7 +483,7 @@ static UINT set_installed_prop( MSIPACKAGE *package )
|
|||
if (r == ERROR_SUCCESS)
|
||||
{
|
||||
RegCloseKey( hkey );
|
||||
msi_set_property( package->db, szInstalled, szOne );
|
||||
msi_set_property( package->db, szInstalled, szOne, -1 );
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
@ -525,7 +525,7 @@ static UINT set_user_sid_prop( MSIPACKAGE *package )
|
|||
if (!ConvertSidToStringSidW( psid, &sid_str ))
|
||||
goto done;
|
||||
|
||||
r = msi_set_property( package->db, szUserSID, sid_str );
|
||||
r = msi_set_property( package->db, szUserSID, sid_str, -1 );
|
||||
|
||||
done:
|
||||
LocalFree( sid_str );
|
||||
|
@ -657,7 +657,7 @@ static void set_msi_assembly_prop(MSIPACKAGE *package)
|
|||
if (!val_len || !verstr)
|
||||
goto done;
|
||||
|
||||
msi_set_property(package->db, netasm, verstr);
|
||||
msi_set_property( package->db, netasm, verstr, -1 );
|
||||
|
||||
done:
|
||||
msi_free(fusion);
|
||||
|
@ -757,182 +757,182 @@ static VOID set_installer_properties(MSIPACKAGE *package)
|
|||
|
||||
SHGetFolderPathW(NULL, CSIDL_COMMON_APPDATA, NULL, 0, pth);
|
||||
strcatW(pth, szBackSlash);
|
||||
msi_set_property(package->db, szCommonAppDataFolder, pth);
|
||||
msi_set_property( package->db, szCommonAppDataFolder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW(NULL, CSIDL_FAVORITES, NULL, 0, pth);
|
||||
strcatW(pth, szBackSlash);
|
||||
msi_set_property(package->db, szFavoritesFolder, pth);
|
||||
msi_set_property( package->db, szFavoritesFolder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW(NULL, CSIDL_FONTS, NULL, 0, pth);
|
||||
strcatW(pth, szBackSlash);
|
||||
msi_set_property(package->db, szFontsFolder, pth);
|
||||
msi_set_property( package->db, szFontsFolder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW(NULL, CSIDL_SENDTO, NULL, 0, pth);
|
||||
strcatW(pth, szBackSlash);
|
||||
msi_set_property(package->db, szSendToFolder, pth);
|
||||
msi_set_property( package->db, szSendToFolder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW(NULL, CSIDL_STARTMENU, NULL, 0, pth);
|
||||
strcatW(pth, szBackSlash);
|
||||
msi_set_property(package->db, szStartMenuFolder, pth);
|
||||
msi_set_property( package->db, szStartMenuFolder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW(NULL, CSIDL_STARTUP, NULL, 0, pth);
|
||||
strcatW(pth, szBackSlash);
|
||||
msi_set_property(package->db, szStartupFolder, pth);
|
||||
msi_set_property( package->db, szStartupFolder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW(NULL, CSIDL_TEMPLATES, NULL, 0, pth);
|
||||
strcatW(pth, szBackSlash);
|
||||
msi_set_property(package->db, szTemplateFolder, pth);
|
||||
msi_set_property( package->db, szTemplateFolder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW(NULL, CSIDL_DESKTOP, NULL, 0, pth);
|
||||
strcatW(pth, szBackSlash);
|
||||
msi_set_property(package->db, szDesktopFolder, pth);
|
||||
msi_set_property( package->db, szDesktopFolder, pth, -1 );
|
||||
|
||||
/* FIXME: set to AllUsers profile path if ALLUSERS is set */
|
||||
SHGetFolderPathW(NULL, CSIDL_PROGRAMS, NULL, 0, pth);
|
||||
strcatW(pth, szBackSlash);
|
||||
msi_set_property(package->db, szProgramMenuFolder, pth);
|
||||
msi_set_property( package->db, szProgramMenuFolder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW(NULL, CSIDL_ADMINTOOLS, NULL, 0, pth);
|
||||
strcatW(pth, szBackSlash);
|
||||
msi_set_property(package->db, szAdminToolsFolder, pth);
|
||||
msi_set_property( package->db, szAdminToolsFolder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW(NULL, CSIDL_APPDATA, NULL, 0, pth);
|
||||
strcatW(pth, szBackSlash);
|
||||
msi_set_property(package->db, szAppDataFolder, pth);
|
||||
msi_set_property( package->db, szAppDataFolder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW(NULL, CSIDL_SYSTEM, NULL, 0, pth);
|
||||
strcatW(pth, szBackSlash);
|
||||
msi_set_property(package->db, szSystemFolder, pth);
|
||||
msi_set_property(package->db, szSystem16Folder, pth);
|
||||
msi_set_property( package->db, szSystemFolder, pth, -1 );
|
||||
msi_set_property( package->db, szSystem16Folder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW(NULL, CSIDL_LOCAL_APPDATA, NULL, 0, pth);
|
||||
strcatW(pth, szBackSlash);
|
||||
msi_set_property(package->db, szLocalAppDataFolder, pth);
|
||||
msi_set_property( package->db, szLocalAppDataFolder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW(NULL, CSIDL_MYPICTURES, NULL, 0, pth);
|
||||
strcatW(pth, szBackSlash);
|
||||
msi_set_property(package->db, szMyPicturesFolder, pth);
|
||||
msi_set_property( package->db, szMyPicturesFolder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW(NULL, CSIDL_PERSONAL, NULL, 0, pth);
|
||||
strcatW(pth, szBackSlash);
|
||||
msi_set_property(package->db, szPersonalFolder, pth);
|
||||
msi_set_property( package->db, szPersonalFolder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW(NULL, CSIDL_WINDOWS, NULL, 0, pth);
|
||||
strcatW(pth, szBackSlash);
|
||||
msi_set_property(package->db, szWindowsFolder, pth);
|
||||
msi_set_property( package->db, szWindowsFolder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW(NULL, CSIDL_PRINTHOOD, NULL, 0, pth);
|
||||
strcatW(pth, szBackSlash);
|
||||
msi_set_property(package->db, szPrintHoodFolder, pth);
|
||||
msi_set_property( package->db, szPrintHoodFolder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW(NULL, CSIDL_NETHOOD, NULL, 0, pth);
|
||||
strcatW(pth, szBackSlash);
|
||||
msi_set_property(package->db, szNetHoodFolder, pth);
|
||||
msi_set_property( package->db, szNetHoodFolder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW(NULL, CSIDL_RECENT, NULL, 0, pth);
|
||||
strcatW(pth, szBackSlash);
|
||||
msi_set_property(package->db, szRecentFolder, pth);
|
||||
msi_set_property( package->db, szRecentFolder, pth, -1 );
|
||||
|
||||
/* Physical Memory is specified in MB. Using total amount. */
|
||||
msex.dwLength = sizeof(msex);
|
||||
GlobalMemoryStatusEx( &msex );
|
||||
sprintfW( bufstr, szIntFormat, (int)(msex.ullTotalPhys / 1024 / 1024) );
|
||||
msi_set_property(package->db, szPhysicalMemory, bufstr);
|
||||
len = sprintfW( bufstr, szIntFormat, (int)(msex.ullTotalPhys / 1024 / 1024) );
|
||||
msi_set_property( package->db, szPhysicalMemory, bufstr, len );
|
||||
|
||||
SHGetFolderPathW(NULL, CSIDL_WINDOWS, NULL, 0, pth);
|
||||
ptr = strchrW(pth,'\\');
|
||||
if (ptr) *(ptr + 1) = 0;
|
||||
msi_set_property(package->db, szWindowsVolume, pth);
|
||||
msi_set_property( package->db, szWindowsVolume, pth, -1 );
|
||||
|
||||
GetTempPathW(MAX_PATH,pth);
|
||||
msi_set_property(package->db, szTempFolder, pth);
|
||||
len = GetTempPathW(MAX_PATH, pth);
|
||||
msi_set_property( package->db, szTempFolder, pth, len );
|
||||
|
||||
/* in a wine environment the user is always admin and privileged */
|
||||
msi_set_property(package->db, szAdminUser, szOne);
|
||||
msi_set_property(package->db, szPrivileged, szOne);
|
||||
msi_set_property( package->db, szAdminUser, szOne, -1 );
|
||||
msi_set_property( package->db, szPrivileged, szOne, -1 );
|
||||
|
||||
/* set the os things */
|
||||
OSVersion.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXW);
|
||||
GetVersionExW((OSVERSIONINFOW *)&OSVersion);
|
||||
verval = OSVersion.dwMinorVersion + OSVersion.dwMajorVersion * 100;
|
||||
sprintfW(verstr, szFormat, verval);
|
||||
len = sprintfW( verstr, szFormat, verval );
|
||||
switch (OSVersion.dwPlatformId)
|
||||
{
|
||||
case VER_PLATFORM_WIN32_WINDOWS:
|
||||
msi_set_property(package->db, szVersion9x, verstr);
|
||||
msi_set_property( package->db, szVersion9x, verstr, len );
|
||||
break;
|
||||
case VER_PLATFORM_WIN32_NT:
|
||||
msi_set_property(package->db, szVersionNT, verstr);
|
||||
sprintfW(verstr, szFormat,OSVersion.wProductType);
|
||||
msi_set_property(package->db, szMsiNTProductType, verstr);
|
||||
msi_set_property( package->db, szVersionNT, verstr, len );
|
||||
len = sprintfW( verstr, szFormat,OSVersion.wProductType );
|
||||
msi_set_property( package->db, szMsiNTProductType, verstr, len );
|
||||
break;
|
||||
}
|
||||
sprintfW(verstr, szFormat, OSVersion.dwBuildNumber);
|
||||
msi_set_property(package->db, szWindowsBuild, verstr);
|
||||
sprintfW(verstr, szFormat, OSVersion.wServicePackMajor);
|
||||
msi_set_property(package->db, szServicePackLevel, verstr);
|
||||
len = sprintfW( verstr, szFormat, OSVersion.dwBuildNumber );
|
||||
msi_set_property( package->db, szWindowsBuild, verstr, len );
|
||||
len = sprintfW( verstr, szFormat, OSVersion.wServicePackMajor );
|
||||
msi_set_property( package->db, szServicePackLevel, verstr, len );
|
||||
|
||||
sprintfW( bufstr, szFormat2, MSI_MAJORVERSION, MSI_MINORVERSION);
|
||||
msi_set_property( package->db, szVersionMsi, bufstr );
|
||||
sprintfW( bufstr, szFormat, MSI_MAJORVERSION * 100);
|
||||
msi_set_property( package->db, szVersionDatabase, bufstr );
|
||||
len = sprintfW( bufstr, szFormat2, MSI_MAJORVERSION, MSI_MINORVERSION );
|
||||
msi_set_property( package->db, szVersionMsi, bufstr, len );
|
||||
len = sprintfW( bufstr, szFormat, MSI_MAJORVERSION * 100 );
|
||||
msi_set_property( package->db, szVersionDatabase, bufstr, len );
|
||||
|
||||
GetNativeSystemInfo( &sys_info );
|
||||
sprintfW( bufstr, szIntFormat, sys_info.wProcessorLevel );
|
||||
msi_set_property( package->db, szIntel, bufstr );
|
||||
len = sprintfW( bufstr, szIntFormat, sys_info.wProcessorLevel );
|
||||
msi_set_property( package->db, szIntel, bufstr, len );
|
||||
if (sys_info.u.s.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL)
|
||||
{
|
||||
GetSystemDirectoryW( pth, MAX_PATH );
|
||||
PathAddBackslashW( pth );
|
||||
msi_set_property( package->db, szSystemFolder, pth );
|
||||
msi_set_property( package->db, szSystemFolder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW( NULL, CSIDL_PROGRAM_FILES, NULL, 0, pth );
|
||||
PathAddBackslashW( pth );
|
||||
msi_set_property( package->db, szProgramFilesFolder, pth );
|
||||
msi_set_property( package->db, szProgramFilesFolder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW( NULL, CSIDL_PROGRAM_FILES_COMMON, NULL, 0, pth );
|
||||
PathAddBackslashW( pth );
|
||||
msi_set_property( package->db, szCommonFilesFolder, pth );
|
||||
msi_set_property( package->db, szCommonFilesFolder, pth, -1 );
|
||||
}
|
||||
else if (sys_info.u.s.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64)
|
||||
{
|
||||
msi_set_property( package->db, szMsiAMD64, bufstr );
|
||||
msi_set_property( package->db, szMsix64, bufstr );
|
||||
msi_set_property( package->db, szVersionNT64, verstr );
|
||||
msi_set_property( package->db, szMsiAMD64, bufstr, -1 );
|
||||
msi_set_property( package->db, szMsix64, bufstr, -1 );
|
||||
msi_set_property( package->db, szVersionNT64, verstr, -1 );
|
||||
|
||||
GetSystemDirectoryW( pth, MAX_PATH );
|
||||
PathAddBackslashW( pth );
|
||||
msi_set_property( package->db, szSystem64Folder, pth );
|
||||
msi_set_property( package->db, szSystem64Folder, pth, -1 );
|
||||
|
||||
GetSystemWow64DirectoryW( pth, MAX_PATH );
|
||||
PathAddBackslashW( pth );
|
||||
msi_set_property( package->db, szSystemFolder, pth );
|
||||
msi_set_property( package->db, szSystemFolder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW( NULL, CSIDL_PROGRAM_FILES, NULL, 0, pth );
|
||||
PathAddBackslashW( pth );
|
||||
msi_set_property( package->db, szProgramFiles64Folder, pth );
|
||||
msi_set_property( package->db, szProgramFiles64Folder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW( NULL, CSIDL_PROGRAM_FILESX86, NULL, 0, pth );
|
||||
PathAddBackslashW( pth );
|
||||
msi_set_property( package->db, szProgramFilesFolder, pth );
|
||||
msi_set_property( package->db, szProgramFilesFolder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW( NULL, CSIDL_PROGRAM_FILES_COMMON, NULL, 0, pth );
|
||||
PathAddBackslashW( pth );
|
||||
msi_set_property( package->db, szCommonFiles64Folder, pth );
|
||||
msi_set_property( package->db, szCommonFiles64Folder, pth, -1 );
|
||||
|
||||
SHGetFolderPathW( NULL, CSIDL_PROGRAM_FILES_COMMONX86, NULL, 0, pth );
|
||||
PathAddBackslashW( pth );
|
||||
msi_set_property( package->db, szCommonFilesFolder, pth );
|
||||
msi_set_property( package->db, szCommonFilesFolder, pth, -1 );
|
||||
}
|
||||
|
||||
/* Screen properties. */
|
||||
dc = GetDC(0);
|
||||
sprintfW( bufstr, szIntFormat, GetDeviceCaps( dc, HORZRES ) );
|
||||
msi_set_property( package->db, szScreenX, bufstr );
|
||||
sprintfW( bufstr, szIntFormat, GetDeviceCaps( dc, VERTRES ));
|
||||
msi_set_property( package->db, szScreenY, bufstr );
|
||||
sprintfW( bufstr, szIntFormat, GetDeviceCaps( dc, BITSPIXEL ));
|
||||
msi_set_property( package->db, szColorBits, bufstr );
|
||||
len = sprintfW( bufstr, szIntFormat, GetDeviceCaps(dc, HORZRES) );
|
||||
msi_set_property( package->db, szScreenX, bufstr, len );
|
||||
len = sprintfW( bufstr, szIntFormat, GetDeviceCaps(dc, VERTRES) );
|
||||
msi_set_property( package->db, szScreenY, bufstr, len );
|
||||
len = sprintfW( bufstr, szIntFormat, GetDeviceCaps(dc, BITSPIXEL) );
|
||||
msi_set_property( package->db, szColorBits, bufstr, len );
|
||||
ReleaseDC(0, dc);
|
||||
|
||||
/* USERNAME and COMPANYNAME */
|
||||
|
@ -944,10 +944,10 @@ static VOID set_installer_properties(MSIPACKAGE *package)
|
|||
{
|
||||
if (!username &&
|
||||
(username = msi_reg_get_val_str( hkey, szDefName )))
|
||||
msi_set_property( package->db, szUSERNAME, username );
|
||||
msi_set_property( package->db, szUSERNAME, username, -1 );
|
||||
if (!companyname &&
|
||||
(companyname = msi_reg_get_val_str( hkey, szDefCompany )))
|
||||
msi_set_property( package->db, szCOMPANYNAME, companyname );
|
||||
msi_set_property( package->db, szCOMPANYNAME, companyname, -1 );
|
||||
CloseHandle( hkey );
|
||||
}
|
||||
if ((!username || !companyname) &&
|
||||
|
@ -955,10 +955,10 @@ static VOID set_installer_properties(MSIPACKAGE *package)
|
|||
{
|
||||
if (!username &&
|
||||
(username = msi_reg_get_val_str( hkey, szRegisteredUser )))
|
||||
msi_set_property( package->db, szUSERNAME, username );
|
||||
msi_set_property( package->db, szUSERNAME, username, -1 );
|
||||
if (!companyname &&
|
||||
(companyname = msi_reg_get_val_str( hkey, szRegisteredOrganization )))
|
||||
msi_set_property( package->db, szCOMPANYNAME, companyname );
|
||||
msi_set_property( package->db, szCOMPANYNAME, companyname, -1 );
|
||||
CloseHandle( hkey );
|
||||
}
|
||||
msi_free( username );
|
||||
|
@ -971,7 +971,7 @@ static VOID set_installer_properties(MSIPACKAGE *package)
|
|||
GetSystemTime( &systemtime );
|
||||
if (GetDateFormatW( LOCALE_USER_DEFAULT, DATE_SHORTDATE, &systemtime,
|
||||
NULL, bufstr, sizeof(bufstr)/sizeof(bufstr[0]) ))
|
||||
msi_set_property( package->db, szDate, bufstr );
|
||||
msi_set_property( package->db, szDate, bufstr, -1 );
|
||||
else
|
||||
ERR("Couldn't set Date property: GetDateFormat failed with error %d\n", GetLastError());
|
||||
|
||||
|
@ -979,22 +979,22 @@ static VOID set_installer_properties(MSIPACKAGE *package)
|
|||
TIME_FORCE24HOURFORMAT | TIME_NOTIMEMARKER,
|
||||
&systemtime, NULL, bufstr,
|
||||
sizeof(bufstr)/sizeof(bufstr[0]) ))
|
||||
msi_set_property( package->db, szTime, bufstr );
|
||||
msi_set_property( package->db, szTime, bufstr, -1 );
|
||||
else
|
||||
ERR("Couldn't set Time property: GetTimeFormat failed with error %d\n", GetLastError());
|
||||
|
||||
set_msi_assembly_prop( package );
|
||||
|
||||
langid = GetUserDefaultLangID();
|
||||
sprintfW(bufstr, szIntFormat, langid);
|
||||
msi_set_property( package->db, szUserLanguageID, bufstr );
|
||||
len = sprintfW( bufstr, szIntFormat, langid );
|
||||
msi_set_property( package->db, szUserLanguageID, bufstr, len );
|
||||
|
||||
langid = GetSystemDefaultLangID();
|
||||
sprintfW(bufstr, szIntFormat, langid);
|
||||
msi_set_property( package->db, szSystemLangID, bufstr );
|
||||
len = sprintfW( bufstr, szIntFormat, langid );
|
||||
msi_set_property( package->db, szSystemLangID, bufstr, len );
|
||||
|
||||
sprintfW(bufstr, szIntFormat, MsiQueryProductStateW(package->ProductCode));
|
||||
msi_set_property( package->db, szProductState, bufstr );
|
||||
len = sprintfW( bufstr, szIntFormat, MsiQueryProductStateW(package->ProductCode) );
|
||||
msi_set_property( package->db, szProductState, bufstr, len );
|
||||
|
||||
len = 0;
|
||||
if (!GetUserNameW( NULL, &len ) && GetLastError() == ERROR_INSUFFICIENT_BUFFER)
|
||||
|
@ -1003,7 +1003,7 @@ static VOID set_installer_properties(MSIPACKAGE *package)
|
|||
if ((username = msi_alloc( len * sizeof(WCHAR) )))
|
||||
{
|
||||
if (GetUserNameW( username, &len ))
|
||||
msi_set_property( package->db, szLogonUser, username );
|
||||
msi_set_property( package->db, szLogonUser, username, len - 1 );
|
||||
msi_free( username );
|
||||
}
|
||||
}
|
||||
|
@ -1014,7 +1014,7 @@ static VOID set_installer_properties(MSIPACKAGE *package)
|
|||
if ((computername = msi_alloc( len * sizeof(WCHAR) )))
|
||||
{
|
||||
if (GetComputerNameW( computername, &len ))
|
||||
msi_set_property( package->db, szComputerName, computername );
|
||||
msi_set_property( package->db, szComputerName, computername, len - 1 );
|
||||
msi_free( computername );
|
||||
}
|
||||
}
|
||||
|
@ -1073,7 +1073,7 @@ static UINT msi_load_summary_properties( MSIPACKAGE *package )
|
|||
goto done;
|
||||
}
|
||||
|
||||
msi_set_property( package->db, szPackageCode, package_code );
|
||||
msi_set_property( package->db, szPackageCode, package_code, len );
|
||||
msi_free( package_code );
|
||||
|
||||
/* load package attributes */
|
||||
|
@ -1141,9 +1141,9 @@ void msi_adjust_privilege_properties( MSIPACKAGE *package )
|
|||
if (msi_get_property_int( package->db, szAllUsers, 0 ) == 2)
|
||||
{
|
||||
TRACE("resetting ALLUSERS property from 2 to 1\n");
|
||||
msi_set_property( package->db, szAllUsers, szOne );
|
||||
msi_set_property( package->db, szAllUsers, szOne, -1 );
|
||||
}
|
||||
msi_set_property( package->db, szAdminUser, szOne );
|
||||
msi_set_property( package->db, szAdminUser, szOne, -1 );
|
||||
}
|
||||
|
||||
MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPCWSTR base_url )
|
||||
|
@ -1151,6 +1151,7 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPCWSTR base_url )
|
|||
static const WCHAR fmtW[] = {'%','u',0};
|
||||
MSIPACKAGE *package;
|
||||
WCHAR uilevel[11];
|
||||
int len;
|
||||
UINT r;
|
||||
|
||||
TRACE("%p\n", db);
|
||||
|
@ -1176,8 +1177,8 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPCWSTR base_url )
|
|||
set_installer_properties( package );
|
||||
|
||||
package->ui_level = gUILevel;
|
||||
sprintfW( uilevel, fmtW, gUILevel & INSTALLUILEVEL_MASK );
|
||||
msi_set_property(package->db, szUILevel, uilevel);
|
||||
len = sprintfW( uilevel, fmtW, gUILevel & INSTALLUILEVEL_MASK );
|
||||
msi_set_property( package->db, szUILevel, uilevel, len );
|
||||
|
||||
r = msi_load_summary_properties( package );
|
||||
if (r != ERROR_SUCCESS)
|
||||
|
@ -1608,18 +1609,17 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage)
|
|||
msiobj_release( &package->hdr );
|
||||
return r;
|
||||
}
|
||||
msi_set_property( package->db, szDatabase, db->path );
|
||||
msi_set_property( package->db, szDatabase, db->path, -1 );
|
||||
|
||||
if( UrlIsW( szPackage, URLIS_URL ) )
|
||||
msi_set_property( package->db, szOriginalDatabase, szPackage );
|
||||
msi_set_property( package->db, szOriginalDatabase, szPackage, -1 );
|
||||
else if( szPackage[0] == '#' )
|
||||
msi_set_property( package->db, szOriginalDatabase, db->path );
|
||||
msi_set_property( package->db, szOriginalDatabase, db->path, -1 );
|
||||
else
|
||||
{
|
||||
WCHAR fullpath[MAX_PATH];
|
||||
|
||||
GetFullPathNameW( szPackage, MAX_PATH, fullpath, NULL );
|
||||
msi_set_property( package->db, szOriginalDatabase, fullpath );
|
||||
DWORD len = GetFullPathNameW( szPackage, MAX_PATH, fullpath, NULL );
|
||||
msi_set_property( package->db, szOriginalDatabase, fullpath, len );
|
||||
}
|
||||
msi_set_context( package );
|
||||
|
||||
|
@ -2018,7 +2018,7 @@ void msi_reset_folders( MSIPACKAGE *package, BOOL source )
|
|||
}
|
||||
}
|
||||
|
||||
UINT msi_set_property( MSIDATABASE *db, LPCWSTR szName, LPCWSTR szValue )
|
||||
UINT msi_set_property( MSIDATABASE *db, const WCHAR *name, const WCHAR *value, int len )
|
||||
{
|
||||
static const WCHAR insert_query[] = {
|
||||
'I','N','S','E','R','T',' ','I','N','T','O',' ',
|
||||
|
@ -2039,34 +2039,34 @@ UINT msi_set_property( MSIDATABASE *db, LPCWSTR szName, LPCWSTR szValue )
|
|||
WCHAR query[1024];
|
||||
UINT rc;
|
||||
|
||||
TRACE("%p %s %s\n", db, debugstr_w(szName), debugstr_w(szValue));
|
||||
TRACE("%p %s %s %d\n", db, debugstr_w(name), debugstr_wn(value, len), len);
|
||||
|
||||
if (!szName)
|
||||
if (!name)
|
||||
return ERROR_INVALID_PARAMETER;
|
||||
|
||||
/* this one is weird... */
|
||||
if (!szName[0])
|
||||
return szValue ? ERROR_FUNCTION_FAILED : ERROR_SUCCESS;
|
||||
if (!name[0])
|
||||
return value ? ERROR_FUNCTION_FAILED : ERROR_SUCCESS;
|
||||
|
||||
rc = msi_get_property(db, szName, 0, &sz);
|
||||
if (!szValue || !*szValue)
|
||||
if (value && len < 0) len = strlenW( value );
|
||||
|
||||
rc = msi_get_property( db, name, 0, &sz );
|
||||
if (!value || (!*value && !len))
|
||||
{
|
||||
sprintfW(query, delete_query, szName);
|
||||
sprintfW( query, delete_query, name );
|
||||
}
|
||||
else if (rc == ERROR_MORE_DATA || rc == ERROR_SUCCESS)
|
||||
{
|
||||
sprintfW(query, update_query, szName);
|
||||
|
||||
sprintfW( query, update_query, name );
|
||||
row = MSI_CreateRecord(1);
|
||||
MSI_RecordSetStringW(row, 1, szValue);
|
||||
msi_record_set_string( row, 1, value, len );
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpyW(query, insert_query);
|
||||
|
||||
strcpyW( query, insert_query );
|
||||
row = MSI_CreateRecord(2);
|
||||
MSI_RecordSetStringW(row, 1, szName);
|
||||
MSI_RecordSetStringW(row, 2, szValue);
|
||||
msi_record_set_string( row, 1, name, -1 );
|
||||
msi_record_set_string( row, 2, value, len );
|
||||
}
|
||||
|
||||
rc = MSI_DatabaseOpenViewW(db, query, &view);
|
||||
|
@ -2123,7 +2123,7 @@ UINT WINAPI MsiSetPropertyW( MSIHANDLE hInstall, LPCWSTR szName, LPCWSTR szValue
|
|||
return ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
ret = msi_set_property( package->db, szName, szValue );
|
||||
ret = msi_set_property( package->db, szName, szValue, -1 );
|
||||
if (ret == ERROR_SUCCESS && !strcmpW( szName, szSourceDir ))
|
||||
msi_reset_folders( package, TRUE );
|
||||
|
||||
|
|
|
@ -225,7 +225,7 @@ static UINT patch_set_media_source_prop( MSIPACKAGE *package )
|
|||
{
|
||||
property = MSI_RecordGetString( rec, 1 );
|
||||
patch = msi_dup_property( package->db, szPatch );
|
||||
msi_set_property( package->db, property, patch );
|
||||
msi_set_property( package->db, property, patch, -1 );
|
||||
msi_free( patch );
|
||||
msiobj_release( &rec->hdr );
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ static void append_productcode(MSIPACKAGE* package, LPCWSTR action_property,
|
|||
newprop[0] = 0;
|
||||
strcatW(newprop,productid);
|
||||
|
||||
r = msi_set_property( package->db, action_property, newprop );
|
||||
r = msi_set_property( package->db, action_property, newprop, -1 );
|
||||
if (r == ERROR_SUCCESS && !strcmpW( action_property, szSourceDir ))
|
||||
msi_reset_folders( package, TRUE );
|
||||
|
||||
|
|
Loading…
Reference in New Issue