2010-10-14 11:06:13 +02:00
/*
* Copyright ( C ) 2006 James Hawkins
* Copyright 2010 Hans Leidekker for CodeWeavers
*
* Tests concentrating on standard actions
*
* This library is free software ; you can redistribute it and / or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation ; either
* version 2.1 of the License , or ( at your option ) any later version .
*
* This library is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the GNU
* Lesser General Public License for more details .
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library ; if not , write to the Free Software
* Foundation , Inc . , 51 Franklin St , Fifth Floor , Boston , MA 02110 - 1301 , USA
*/
# define _WIN32_MSI 300
# include <stdio.h>
2014-02-24 22:00:55 +01:00
# include <stdlib.h>
2010-10-14 11:06:13 +02:00
2018-05-30 10:22:24 +02:00
# define COBJMACROS
2010-10-14 11:06:13 +02:00
# include <windows.h>
# include <msiquery.h>
# include <msidefs.h>
# include <msi.h>
# include <fci.h>
# include <srrestoreptapi.h>
2013-10-15 13:04:45 +02:00
# include <wtypes.h>
# include <shellapi.h>
# include <winsvc.h>
2018-05-19 05:00:57 +02:00
# include <odbcinst.h>
2018-09-26 15:17:18 +02:00
# include <sddl.h>
2010-10-14 11:06:13 +02:00
# include "wine/test.h"
2018-05-14 07:28:58 +02:00
# include "utils.h"
2018-05-30 10:22:24 +02:00
# include "typelib.h"
2010-10-14 11:06:13 +02:00
static UINT ( WINAPI * pMsiQueryComponentStateA )
( LPCSTR , LPCSTR , MSIINSTALLCONTEXT , LPCSTR , INSTALLSTATE * ) ;
static UINT ( WINAPI * pMsiSourceListEnumSourcesA )
( LPCSTR , LPCSTR , MSIINSTALLCONTEXT , DWORD , DWORD , LPSTR , LPDWORD ) ;
static UINT ( WINAPI * pMsiSourceListGetInfoA )
( LPCSTR , LPCSTR , MSIINSTALLCONTEXT , DWORD , LPCSTR , LPSTR , LPDWORD ) ;
static INSTALLSTATE ( WINAPI * pMsiGetComponentPathExA )
( LPCSTR , LPCSTR , LPCSTR , MSIINSTALLCONTEXT , LPSTR , LPDWORD ) ;
2013-01-09 11:44:19 +01:00
static UINT ( WINAPI * pMsiQueryFeatureStateExA )
( LPCSTR , LPCSTR , MSIINSTALLCONTEXT , LPCSTR , INSTALLSTATE * ) ;
2010-10-14 11:06:13 +02:00
static LONG ( WINAPI * pRegDeleteKeyExA ) ( HKEY , LPCSTR , REGSAM , DWORD ) ;
static BOOL ( WINAPI * pIsWow64Process ) ( HANDLE , PBOOL ) ;
static BOOL ( WINAPI * pSRRemoveRestorePoint ) ( DWORD ) ;
static BOOL ( WINAPI * pSRSetRestorePointA ) ( RESTOREPOINTINFOA * , STATEMGRSTATUS * ) ;
static BOOL is_wow64 ;
static const BOOL is_64bit = sizeof ( void * ) > sizeof ( int ) ;
static const char * msifile = " msitest.msi " ;
/* msi database data */
static const char component_dat [ ] =
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
" Five \t {8CC92E9D-14B2-4CA4-B2AA-B11D02078087} \t NEWDIR \t 2 \t \t five.txt \n "
" Four \t {FD37B4EA-7209-45C0-8917-535F35A2F080} \t CABOUTDIR \t 2 \t \t four.txt \n "
" One \t {783B242E-E185-4A56-AF86-C09815EC053C} \t MSITESTDIR \t 2 \t NOT REINSTALL \t one.txt \n "
" Three \t {010B6ADD-B27D-4EDD-9B3D-34C4F7D61684} \t CHANGEDDIR \t 2 \t \t three.txt \n "
" Two \t {BF03D1A6-20DA-4A65-82F3-6CAC995915CE} \t FIRSTDIR \t 2 \t \t two.txt \n "
" dangler \t {6091DF25-EF96-45F1-B8E9-A9B1420C7A3C} \t TARGETDIR \t 4 \t \t regdata \n "
" component \t \t MSITESTDIR \t 0 \t 1 \t file \n "
2012-03-13 12:51:26 +01:00
" service_comp \t {935A0A91-22A3-4F87-BCA8-928FFDFE2353} \t MSITESTDIR \t 0 \t \t service_file \n "
2014-02-21 16:52:12 +01:00
" service_comp2 \t {3F7B04A4-9521-4649-BDC9-0C8722740A49} \t MSITESTDIR \t 0 \t \t service_file2 \n "
" service_comp3 \t {DBCD1502-20E3-423F-B53E-F37E263CDC7E} \t MSITESTDIR \t 0 \t \t \n " ;
2010-10-14 11:06:13 +02:00
static const char directory_dat [ ] =
" Directory \t Directory_Parent \t DefaultDir \n "
" s72 \t S72 \t l255 \n "
" Directory \t Directory \n "
" CABOUTDIR \t MSITESTDIR \t cabout \n "
" CHANGEDDIR \t MSITESTDIR \t changed:second \n "
" FIRSTDIR \t MSITESTDIR \t first \n "
" MSITESTDIR \t ProgramFilesFolder \t msitest \n "
" NEWDIR \t CABOUTDIR \t new \n "
" ProgramFilesFolder \t TARGETDIR \t . \n "
" TARGETDIR \t \t SourceDir " ;
static const char feature_dat [ ] =
" Feature \t Feature_Parent \t Title \t Description \t Display \t Level \t Directory_ \t Attributes \n "
" s38 \t S38 \t L64 \t L255 \t I2 \t i2 \t S72 \t i2 \n "
" Feature \t Feature \n "
" Five \t \t Five \t The Five Feature \t 5 \t 3 \t NEWDIR \t 0 \n "
" Four \t \t Four \t The Four Feature \t 4 \t 3 \t CABOUTDIR \t 0 \n "
" One \t \t One \t The One Feature \t 1 \t 3 \t MSITESTDIR \t 0 \n "
" Three \t \t Three \t The Three Feature \t 3 \t 3 \t CHANGEDDIR \t 0 \n "
" Two \t \t Two \t The Two Feature \t 2 \t 3 \t FIRSTDIR \t 0 \n "
" feature \t \t \t \t 2 \t 1 \t TARGETDIR \t 0 \n "
" service_feature \t \t \t \t 2 \t 1 \t TARGETDIR \t 0 " ;
static const char feature_comp_dat [ ] =
" Feature_ \t Component_ \n "
" s38 \t s72 \n "
" FeatureComponents \t Feature_ \t Component_ \n "
" Five \t Five \n "
" Four \t Four \n "
" One \t One \n "
" Three \t Three \n "
" Two \t Two \n "
" feature \t component \n "
2012-03-13 12:51:26 +01:00
" service_feature \t service_comp \n "
2014-02-21 16:52:12 +01:00
" service_feature \t service_comp2 \n "
" service_feature \t service_comp3 " ;
2010-10-14 11:06:13 +02:00
static const char file_dat [ ] =
" File \t Component_ \t FileName \t FileSize \t Version \t Language \t Attributes \t Sequence \n "
" s72 \t s72 \t l255 \t i4 \t S72 \t S20 \t I2 \t i2 \n "
" File \t File \n "
" five.txt \t Five \t five.txt \t 1000 \t \t \t 16384 \t 5 \n "
" four.txt \t Four \t four.txt \t 1000 \t \t \t 16384 \t 4 \n "
" one.txt \t One \t one.txt \t 1000 \t \t \t 0 \t 1 \n "
" three.txt \t Three \t three.txt \t 1000 \t \t \t 0 \t 3 \n "
" two.txt \t Two \t two.txt \t 1000 \t \t \t 0 \t 2 \n "
" file \t component \t filename \t 100 \t \t \t 8192 \t 1 \n "
2012-03-13 12:51:26 +01:00
" service_file \t service_comp \t service.exe \t 100 \t \t \t 8192 \t 6 \n "
" service_file2 \t service_comp2 \t service2.exe \t 100 \t \t \t 8192 \t 7 " ;
2010-10-14 11:06:13 +02:00
static const char install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" AllocateRegistrySpace \t NOT Installed \t 1550 \n "
" CostFinalize \t \t 1000 \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" ResolveSource \t \t 950 \n "
" MoveFiles \t \t 1700 \n "
" InstallFiles \t \t 4000 \n "
" DuplicateFiles \t \t 4500 \n "
" CreateShortcuts \t \t 4600 \n "
" InstallServices \t \t 5000 \n "
" InstallFinalize \t \t 6600 \n "
" InstallInitialize \t \t 1500 \n "
" InstallValidate \t \t 1400 \n "
" LaunchConditions \t \t 100 \n "
" WriteRegistryValues \t SourceDir And SOURCEDIR \t 5000 " ;
static const char media_dat [ ] =
" DiskId \t LastSequence \t DiskPrompt \t Cabinet \t VolumeLabel \t Source \n "
" i2 \t i4 \t L64 \t S255 \t S32 \t S72 \n "
" Media \t DiskId \n "
" 1 \t 3 \t \t \t DISK1 \t \n "
2012-03-13 12:51:26 +01:00
" 2 \t 7 \t \t msitest.cab \t DISK2 \t \n " ;
2010-10-14 11:06:13 +02:00
static const char property_dat [ ] =
" Property \t Value \n "
" s72 \t l0 \n "
" Property \t Property \n "
" DefaultUIFont \t DlgFont8 \n "
" HASUIRUN \t 0 \n "
" INSTALLLEVEL \t 3 \n "
" InstallMode \t Typical \n "
" Manufacturer \t Wine \n "
" PIDTemplate \t 12345<###-%%%%%%%>@@@@@ \n "
" ProductCode \t {7DF88A48-996F-4EC8-A022-BF956F9B2CBB} \n "
" ProductID \t none \n "
" ProductLanguage \t 1033 \n "
" ProductName \t MSITEST \n "
" ProductVersion \t 1.1.1 \n "
" PROMPTROLLBACKCOST \t P \n "
" Setup \t Setup \n "
" UpgradeCode \t {4C0EAA15-0264-4E5A-8758-609EF142B92D} \n "
" AdminProperties \t POSTADMIN \n "
" ROOTDRIVE \t C: \\ \n "
" SERVNAME \t TestService \n "
2012-03-13 12:51:26 +01:00
" SERVNAME2 \t TestService2 \n "
2010-10-14 11:06:13 +02:00
" SERVDISP \t TestServiceDisp \n "
2012-03-13 12:51:26 +01:00
" SERVDISP2 \t TestServiceDisp2 \n "
2014-10-30 14:09:06 +01:00
" MSIFASTINSTALL \t 1 \n "
2018-09-27 15:00:31 +02:00
" ARPNOMODIFY \t 1 \n "
2018-06-02 04:48:21 +02:00
" regdata17 \t #1 \n " ;
2010-10-14 11:06:13 +02:00
2018-05-31 03:47:33 +02:00
static const char env_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" CostInitialize \t \t 100 \n "
" FileCost \t \t 200 \n "
" CostFinalize \t \t 300 \n "
" InstallValidate \t \t 400 \n "
" InstallInitialize \t \t 500 \n "
" ProcessComponents \t \t 600 \n "
" WriteEnvironmentStrings \t \t 700 \n "
2018-05-31 03:47:34 +02:00
" wes_immediate \t NOT REMOVE \t 701 \n "
" wes_deferred \t NOT REMOVE \t 702 \n "
2018-05-31 03:47:33 +02:00
" RemoveEnvironmentStrings \t \t 800 \n "
2018-05-31 03:47:34 +02:00
" res_immediate \t REMOVE \t 801 \n "
" res_deferred \t REMOVE \t 802 \n "
2018-05-31 03:47:33 +02:00
" RegisterProduct \t \t 900 \n "
" PublishFeatures \t \t 1000 \n "
" PublishProduct \t \t 1100 \n "
" InstallFinalize \t \t 1200 \n " ;
2018-05-31 03:47:34 +02:00
static const char env_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \n "
" s72 \t i2 \t S64 \t S0 \n "
" CustomAction \t Action \n "
" wes_immediate \t 1 \t custom.dll \t env_absent \n "
" wes_deferred \t 1025 \t custom.dll \t env_present \n "
" res_immediate \t 1 \t custom.dll \t env_present \n "
" res_deferred \t 1025 \t custom.dll \t env_absent \n " ;
2018-05-31 03:47:33 +02:00
static const char env_environment_dat [ ] =
2010-10-14 11:06:13 +02:00
" Environment \t Name \t Value \t Component_ \n "
" s72 \t l255 \t L255 \t s72 \n "
" Environment \t Environment \n "
" Var1 \t =-MSITESTVAR1 \t 1 \t One \n "
" Var2 \t MSITESTVAR2 \t 1 \t One \n "
" Var3 \t =-MSITESTVAR3 \t 1 \t One \n "
" Var4 \t MSITESTVAR4 \t 1 \t One \n "
" Var5 \t -MSITESTVAR5 \t \t One \n "
" Var6 \t MSITESTVAR6 \t \t One \n "
" Var7 \t !-MSITESTVAR7 \t \t One \n "
" Var8 \t !-*MSITESTVAR8 \t \t One \n "
" Var9 \t =-MSITESTVAR9 \t \t One \n "
" Var10 \t =MSITESTVAR10 \t \t One \n "
" Var11 \t +-MSITESTVAR11 \t [~];1 \t One \n "
" Var12 \t +-MSITESTVAR11 \t [~];2 \t One \n "
" Var13 \t +-MSITESTVAR12 \t [~];1 \t One \n "
" Var14 \t =MSITESTVAR13 \t [~];1 \t One \n "
" Var15 \t =MSITESTVAR13 \t [~];2 \t One \n "
" Var16 \t =MSITESTVAR14 \t ;1; \t One \n "
" Var17 \t =MSITESTVAR15 \t ;;1;; \t One \n "
" Var18 \t =MSITESTVAR16 \t 1 \t One \n "
" Var19 \t +-MSITESTVAR17 \t 1 \t One \n "
" Var20 \t +-MSITESTVAR17 \t ;;2;;[~] \t One \n "
" Var21 \t +-MSITESTVAR18 \t 1 \t One \n "
" Var22 \t +-MSITESTVAR18 \t [~];;2;; \t One \n "
" Var23 \t +-MSITESTVAR19 \t 1 \t One \n "
" Var24 \t +-MSITESTVAR19 \t [~]2 \t One \n "
" Var25 \t +-MSITESTVAR20 \t 1 \t One \n "
2015-08-26 08:45:31 +02:00
" Var26 \t +-MSITESTVAR20 \t 2[~] \t One \n "
2018-05-31 03:47:33 +02:00
" Var27 \t +-MSITESTVAR21 \t [~];1 \t One \n "
" Var28 \t -MSITESTVAR22 \t 1 \t One \n "
" Var29 \t -MSITESTVAR23 \t 2 \t One \n " ;
2010-10-14 11:06:13 +02:00
static const char service_install_dat [ ] =
" ServiceInstall \t Name \t DisplayName \t ServiceType \t StartType \t ErrorControl \t "
" LoadOrderGroup \t Dependencies \t StartName \t Password \t Arguments \t Component_ \t Description \n "
" s72 \t s255 \t L255 \t i4 \t i4 \t i4 \t S255 \t S255 \t S255 \t S255 \t S255 \t s72 \t L255 \n "
" ServiceInstall \t ServiceInstall \n "
2012-03-13 12:51:26 +01:00
" TestService \t [SERVNAME] \t [SERVDISP] \t 2 \t 3 \t 0 \t \t service1[~]+group1[~]service2[~]+group2[~][~] \t TestService \t \t -a arg \t service_comp \t description \n "
2016-11-04 13:28:06 +01:00
" TestService2 \t [SERVNAME2] \t [SERVDISP2] \t 2 \t 3 \t 0 \t \t service1[~]+group1[~]service2[~]+group2[~][~] \t TestService2 \t \t -a arg \t service_comp2 \t description \n " ;
2010-10-14 11:06:13 +02:00
2014-02-21 16:52:12 +01:00
static const char service_install2_dat [ ] =
" ServiceInstall \t Name \t DisplayName \t ServiceType \t StartType \t ErrorControl \t "
" LoadOrderGroup \t Dependencies \t StartName \t Password \t Arguments \t Component_ \t Description \n "
" s72 \t s255 \t L255 \t i4 \t i4 \t i4 \t S255 \t S255 \t S255 \t S255 \t S255 \t s72 \t L255 \n "
" ServiceInstall \t ServiceInstall \n "
2016-06-06 23:35:54 +02:00
" TestService \t TestService \t TestService \t 2 \t 3 \t 32768 \t \t \t TestService \t \t \t service_comp \t \n "
2014-02-21 16:52:12 +01:00
" TestService4 \t TestService4 \t TestService4 \t 2 \t 3 \t 0 \t \t \t TestService4 \t \t \t service_comp3 \t \n " ;
2010-10-14 11:06:13 +02:00
static const char service_control_dat [ ] =
" ServiceControl \t Name \t Event \t Arguments \t Wait \t Component_ \n "
" s72 \t l255 \t i2 \t L255 \t I2 \t s72 \n "
" ServiceControl \t ServiceControl \n "
2012-03-13 12:51:26 +01:00
" ServiceControl \t TestService3 \t 8 \t \t 0 \t service_comp \n "
" ServiceControl2 \t TestService3 \t 128 \t \t 0 \t service_comp2 " ;
2010-10-14 11:06:13 +02:00
static const char sss_service_control_dat [ ] =
" ServiceControl \t Name \t Event \t Arguments \t Wait \t Component_ \n "
" s72 \t l255 \t i2 \t L255 \t I2 \t s72 \n "
" ServiceControl \t ServiceControl \n "
2014-12-02 12:41:26 +01:00
" ServiceControl \t Spooler \t 1 \t \t 1 \t service_comp \n "
" ServiceControl2 \t Spooler \t 2 \t \t 1 \t service_comp \n "
" ServiceControl3 \t Spooler \t 16 \t \t 1 \t service_comp \n "
" ServiceControl4 \t Spooler \t 32 \t \t 1 \t service_comp \n " ;
2010-10-14 11:06:13 +02:00
static const char sss_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" LaunchConditions \t \t 100 \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" ResolveSource \t \t 950 \n "
" CostFinalize \t \t 1000 \n "
" InstallValidate \t \t 1400 \n "
" InstallInitialize \t \t 1500 \n "
2014-12-02 12:41:26 +01:00
" StopServices \t \t 4000 \n "
2018-05-18 05:26:12 +02:00
" stop_immediate \t NOT REMOVE \t 4001 \n "
" stop_deferred \t NOT REMOVE \t 4002 \n "
2010-10-14 11:06:13 +02:00
" DeleteServices \t \t 5000 \n "
" MoveFiles \t \t 5100 \n "
" InstallFiles \t \t 5200 \n "
" DuplicateFiles \t \t 5300 \n "
" StartServices \t \t 5400 \n "
2018-05-18 05:26:12 +02:00
" start_deferred \t NOT REMOVE \t 5401 \n "
2014-12-02 12:41:26 +01:00
" RegisterProduct \t \t 5500 \n "
" PublishFeatures \t \t 5600 \n "
" PublishProduct \t \t 5700 \n "
2010-10-14 11:06:13 +02:00
" InstallFinalize \t \t 6000 \n " ;
2018-05-18 05:26:12 +02:00
static const char sss_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \n "
" s72 \t i2 \t S64 \t S0 \n "
" CustomAction \t Action \n "
" stop_immediate \t 1 \t custom.dll \t sss_started \n "
" stop_deferred \t 1025 \t custom.dll \t sss_stopped \n "
" start_deferred \t 1025 \t custom.dll \t sss_started \n " ;
2010-10-14 11:06:13 +02:00
static const char sds_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" LaunchConditions \t \t 100 \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" ResolveSource \t \t 950 \n "
" CostFinalize \t \t 1000 \n "
" InstallValidate \t \t 1400 \n "
" InstallInitialize \t \t 1500 \n "
2012-03-13 12:51:26 +01:00
" StopServices \t \t 5000 \n "
" DeleteServices \t \t 5050 \n "
2018-05-18 05:26:10 +02:00
" sds_immediate \t NOT REMOVE \t 5051 \n "
" sds_deferred \t NOT REMOVE \t 5052 \n "
2010-10-14 11:06:13 +02:00
" MoveFiles \t \t 5100 \n "
" InstallFiles \t \t 5200 \n "
" DuplicateFiles \t \t 5300 \n "
2012-03-13 12:51:26 +01:00
" InstallServices \t \t 5400 \n "
" StartServices \t \t 5450 \n "
2010-10-14 11:06:13 +02:00
" RegisterProduct \t \t 5500 \n "
" PublishFeatures \t \t 5600 \n "
" PublishProduct \t \t 5700 \n "
" InstallFinalize \t \t 6000 \n " ;
2018-05-18 05:26:10 +02:00
static const char sds_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \n "
" s72 \t i2 \t S64 \t S0 \n "
" CustomAction \t Action \n "
" sds_immediate \t 1 \t custom.dll \t sds_present \n "
" sds_deferred \t 1025 \t custom.dll \t sds_absent \n " ;
2018-05-18 05:26:11 +02:00
static const char sis_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" CostFinalize \t \t 1000 \n "
" InstallValidate \t \t 1400 \n "
" InstallInitialize \t \t 1500 \n "
" StopServices \t \t 5000 \n "
" DeleteServices \t \t 5050 \n "
" InstallFiles \t \t 5200 \n "
" InstallServices \t \t 5400 \n "
" sis_immediate \t NOT REMOVE \t 5401 \n "
" sis_deferred \t NOT REMOVE \t 5402 \n "
" StartServices \t \t 5450 \n "
" RegisterProduct \t \t 5500 \n "
" PublishFeatures \t \t 5600 \n "
" PublishProduct \t \t 5700 \n "
" InstallFinalize \t \t 6000 \n " ;
static const char sis_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \n "
" s72 \t i2 \t S64 \t S0 \n "
" CustomAction \t Action \n "
" sis_immediate \t 1 \t custom.dll \t sis_absent \n "
" sis_deferred \t 1025 \t custom.dll \t sis_present \n " ;
2010-10-14 11:06:13 +02:00
static const char rof_component_dat [ ] =
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
" maximus \t \t MSITESTDIR \t 0 \t 1 \t maximus \n " ;
static const char rof_feature_dat [ ] =
" Feature \t Feature_Parent \t Title \t Description \t Display \t Level \t Directory_ \t Attributes \n "
" s38 \t S38 \t L64 \t L255 \t I2 \t i2 \t S72 \t i2 \n "
" Feature \t Feature \n "
" feature \t \t Feature \t Feature \t 2 \t 1 \t TARGETDIR \t 0 \n "
" montecristo \t \t Feature \t Feature \t 2 \t 1 \t TARGETDIR \t 0 " ;
static const char rof_feature_comp_dat [ ] =
" Feature_ \t Component_ \n "
" s38 \t s72 \n "
" FeatureComponents \t Feature_ \t Component_ \n "
" feature \t maximus \n "
" montecristo \t maximus " ;
static const char rof_file_dat [ ] =
" File \t Component_ \t FileName \t FileSize \t Version \t Language \t Attributes \t Sequence \n "
" s72 \t s72 \t l255 \t i4 \t S72 \t S20 \t I2 \t i2 \n "
" File \t File \n "
" maximus \t maximus \t maximus \t 500 \t \t \t 8192 \t 1 " ;
static const char rof_media_dat [ ] =
" DiskId \t LastSequence \t DiskPrompt \t Cabinet \t VolumeLabel \t Source \n "
" i2 \t i4 \t L64 \t S255 \t S32 \t S72 \n "
" Media \t DiskId \n "
" 1 \t 1 \t \t \t DISK1 \t \n " ;
static const char ci2_feature_comp_dat [ ] =
" Feature_ \t Component_ \n "
" s38 \t s72 \n "
" FeatureComponents \t Feature_ \t Component_ \n "
" feature \t augustus " ;
static const char ci2_file_dat [ ] =
" File \t Component_ \t FileName \t FileSize \t Version \t Language \t Attributes \t Sequence \n "
" s72 \t s72 \t l255 \t i4 \t S72 \t S20 \t I2 \t i2 \n "
" File \t File \n "
" augustus \t augustus \t augustus \t 500 \t \t \t 8192 \t 1 " ;
static const char pp_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" ValidateProductID \t \t 700 \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" CostFinalize \t \t 1000 \n "
" InstallValidate \t \t 1400 \n "
" InstallInitialize \t \t 1500 \n "
" ProcessComponents \t PROCESS_COMPONENTS=1 Or FULL=1 \t 1600 \n "
2018-05-25 02:14:11 +02:00
" ppc_immediate \t PROCESS_COMPONENTS AND ALLUSERS \t 1601 \n "
" ppc_deferred \t PROCESS_COMPONENTS AND ALLUSERS \t 1602 \n "
2010-10-14 11:06:13 +02:00
" UnpublishFeatures \t UNPUBLISH_FEATURES=1 Or FULL=1 \t 1800 \n "
2018-05-25 02:14:13 +02:00
" uf_immediate \t UNPUBLISH_FEATURES AND ALLUSERS \t 1801 \n "
" uf_deferred \t UNPUBLISH_FEATURES AND ALLUSERS \t 1802 \n "
2010-10-14 11:06:13 +02:00
" RemoveFiles \t \t 3500 \n "
" InstallFiles \t \t 4000 \n "
" RegisterUser \t REGISTER_USER=1 Or FULL=1 \t 6000 \n "
2018-05-29 04:07:53 +02:00
" ru_immediate \t REGISTER_USER AND ALLUSERS \t 6001 \n "
" ru_deferred \t REGISTER_USER AND ALLUSERS \t 6002 \n "
2010-10-14 11:06:13 +02:00
" RegisterProduct \t REGISTER_PRODUCT=1 Or FULL=1 \t 6100 \n "
2018-05-29 04:07:51 +02:00
" rp_immediate \t REGISTER_PRODUCT AND ALLUSERS \t 6101 \n "
" rp_deferred \t REGISTER_PRODUCT AND ALLUSERS \t 6102 \n "
2010-10-14 11:06:13 +02:00
" PublishFeatures \t PUBLISH_FEATURES=1 Or FULL=1 \t 6300 \n "
2018-05-25 02:14:13 +02:00
" pf_immediate \t PUBLISH_FEATURES AND ALLUSERS \t 6301 \n "
" pf_deferred \t PUBLISH_FEATURES AND ALLUSERS \t 6302 \n "
2010-10-14 11:06:13 +02:00
" PublishProduct \t PUBLISH_PRODUCT=1 Or FULL=1 \t 6400 \n "
2018-05-25 02:14:14 +02:00
" pp_immediate \t PUBLISH_PRODUCT AND ALLUSERS \t 6401 \n "
" pp_deferred \t PUBLISH_PRODUCT AND ALLUSERS \t 6402 \n "
2010-10-14 11:06:13 +02:00
" InstallFinalize \t \t 6600 " ;
2018-05-25 02:14:11 +02:00
static const char pp_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \n "
" s72 \t i2 \t S64 \t S0 \n "
" CustomAction \t Action \n "
2018-05-25 02:14:13 +02:00
" pf_immediate \t 1 \t custom.dll \t pf_absent \n "
" pf_deferred \t 1025 \t custom.dll \t pf_present \n "
" uf_immediate \t 1 \t custom.dll \t pf_present \n "
" uf_deferred \t 1025 \t custom.dll \t pf_absent \n "
2018-05-25 02:14:14 +02:00
" pp_immediate \t 1 \t custom.dll \t pp_absent \n "
" pp_deferred \t 1025 \t custom.dll \t pp_present \n "
2018-05-29 04:07:51 +02:00
" rp_immediate \t 1 \t custom.dll \t rp_absent \n "
" rp_deferred \t 1025 \t custom.dll \t rp_present \n "
2018-05-29 04:07:53 +02:00
" ru_immediate \t 1 \t custom.dll \t ru_absent \n "
" ru_deferred \t 1025 \t custom.dll \t ru_present \n "
2018-05-25 02:14:11 +02:00
" ppc_immediate \t 1 \t custom.dll \t ppc_absent \n "
" ppc_deferred \t 1025 \t custom.dll \t ppc_present \n " ;
2010-10-14 11:06:13 +02:00
static const char pp_component_dat [ ] =
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
" maximus \t {DF2CBABC-3BCC-47E5-A998-448D1C0C895B} \t MSITESTDIR \t 0 \t \t maximus \n " ;
static const char ppc_component_dat [ ] =
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
" maximus \t {DF2CBABC-3BCC-47E5-A998-448D1C0C895B} \t MSITESTDIR \t 0 \t \t maximus \n "
" augustus \t {5AD3C142-CEF8-490D-B569-784D80670685} \t MSITESTDIR \t 1 \t \t augustus \n " ;
static const char ppc_file_dat [ ] =
" File \t Component_ \t FileName \t FileSize \t Version \t Language \t Attributes \t Sequence \n "
" s72 \t s72 \t l255 \t i4 \t S72 \t S20 \t I2 \t i2 \n "
" File \t File \n "
" maximus \t maximus \t maximus \t 500 \t \t \t 8192 \t 1 \n "
" augustus \t augustus \t augustus \t 500 \t \t \t 8192 \t 2 " ;
static const char ppc_media_dat [ ] =
" DiskId \t LastSequence \t DiskPrompt \t Cabinet \t VolumeLabel \t Source \n "
" i2 \t i4 \t L64 \t S255 \t S32 \t S72 \n "
" Media \t DiskId \n "
" 1 \t 2 \t \t \t DISK1 \t \n " ;
static const char ppc_feature_comp_dat [ ] =
" Feature_ \t Component_ \n "
" s38 \t s72 \n "
" FeatureComponents \t Feature_ \t Component_ \n "
" feature \t maximus \n "
" feature \t augustus \n "
" montecristo \t maximus " ;
static const char cwd_component_dat [ ] =
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
" augustus \t \t MSITESTDIR \t 0 \t \t augustus \n " ;
static const char rem_component_dat [ ] =
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
" hydrogen \t {C844BD1E-1907-4C00-8BC9-150BD70DF0A1} \t MSITESTDIR \t 0 \t \t hydrogen \n "
" helium \t {5AD3C142-CEF8-490D-B569-784D80670685} \t MSITESTDIR \t 1 \t \t helium \n "
" lithium \t \t MSITESTDIR \t 2 \t \t lithium \n " ;
static const char rem_feature_comp_dat [ ] =
" Feature_ \t Component_ \n "
" s38 \t s72 \n "
" FeatureComponents \t Feature_ \t Component_ \n "
" feature \t hydrogen \n "
" feature \t helium \n "
" feature \t lithium " ;
static const char rem_file_dat [ ] =
" File \t Component_ \t FileName \t FileSize \t Version \t Language \t Attributes \t Sequence \n "
" s72 \t s72 \t l255 \t i4 \t S72 \t S20 \t I2 \t i2 \n "
" File \t File \n "
" hydrogen \t hydrogen \t hydrogen \t 0 \t \t \t 8192 \t 1 \n "
" helium \t helium \t helium \t 0 \t \t \t 8192 \t 1 \n "
" lithium \t lithium \t lithium \t 0 \t \t \t 8192 \t 1 " ;
static const char rem_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" ValidateProductID \t \t 700 \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" CostFinalize \t \t 1000 \n "
" InstallValidate \t \t 1400 \n "
" InstallInitialize \t \t 1500 \n "
" ProcessComponents \t \t 1600 \n "
" UnpublishFeatures \t \t 1800 \n "
" RemoveFiles \t \t 3500 \n "
" InstallFiles \t \t 4000 \n "
" RegisterProduct \t \t 6100 \n "
" PublishFeatures \t \t 6300 \n "
" PublishProduct \t \t 6400 \n "
" InstallFinalize \t \t 6600 " ;
static const char rem_remove_files_dat [ ] =
" FileKey \t Component_ \t FileName \t DirProperty \t InstallMode \n "
" s72 \t s72 \t S255 \t s72 \t I2 \n "
" RemoveFile \t FileKey \n "
" furlong \t hydrogen \t furlong \t MSITESTDIR \t 1 \n "
" firkin \t helium \t firkin \t MSITESTDIR \t 1 \n "
" fortnight \t lithium \t fortnight \t MSITESTDIR \t 1 \n "
" becquerel \t hydrogen \t becquerel \t MSITESTDIR \t 2 \n "
" dioptre \t helium \t dioptre \t MSITESTDIR \t 2 \n "
" attoparsec \t lithium \t attoparsec \t MSITESTDIR \t 2 \n "
" storeys \t hydrogen \t storeys \t MSITESTDIR \t 3 \n "
" block \t helium \t block \t MSITESTDIR \t 3 \n "
" siriometer \t lithium \t siriometer \t MSITESTDIR \t 3 \n "
" nanoacre \t hydrogen \t \t CABOUTDIR \t 3 \n " ;
static const char mov_move_file_dat [ ] =
" FileKey \t Component_ \t SourceName \t DestName \t SourceFolder \t DestFolder \t Options \n "
" s72 \t s72 \t S255 \t S255 \t S72 \t s72 \t i2 \n "
" MoveFile \t FileKey \n "
" abkhazia \t augustus \t nonexistent \t dest \t SourceDir \t MSITESTDIR \t 0 \n "
" bahamas \t augustus \t nonexistent \t dest \t SourceDir \t MSITESTDIR \t 1 \n "
" cambodia \t augustus \t cameroon \t canada \t SourceDir \t MSITESTDIR \t 0 \n "
" denmark \t augustus \t djibouti \t dominica \t SourceDir \t MSITESTDIR \t 1 \n "
" ecuador \t augustus \t egypt \t elsalvador \t NotAProp \t MSITESTDIR \t 1 \n "
" fiji \t augustus \t finland \t france \t SourceDir \t NotAProp \t 1 \n "
" gabon \t augustus \t gambia \t georgia \t SOURCEFULL \t MSITESTDIR \t 1 \n "
" haiti \t augustus \t honduras \t hungary \t SourceDir \t DESTFULL \t 1 \n "
" iceland \t augustus \t india \t indonesia \t MSITESTDIR \t MSITESTDIR \t 1 \n "
" jamaica \t augustus \t japan \t jordan \t FILEPATHBAD \t MSITESTDIR \t 1 \n "
" kazakhstan \t augustus \t \t kiribati \t FILEPATHGOOD \t MSITESTDIR \t 1 \n "
" laos \t augustus \t latvia \t lebanon \t SourceDir \t MSITESTDIR \t 1 \n "
" namibia \t augustus \t nauru \t kiribati \t SourceDir \t MSITESTDIR \t 1 \n "
" pakistan \t augustus \t peru \t sfn|poland \t SourceDir \t MSITESTDIR \t 1 \n "
" wildcard \t augustus \t app* \t wildcard \t SourceDir \t MSITESTDIR \t 1 \n "
" single \t augustus \t f?o \t single \t SourceDir \t MSITESTDIR \t 1 \n "
" wildcardnodest \t augustus \t budd* \t \t SourceDir \t MSITESTDIR \t 1 \n "
" singlenodest \t augustus \t b?r \t \t SourceDir \t MSITESTDIR \t 1 \n " ;
2018-05-23 01:39:24 +02:00
static const char mov_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" CostInitialize \t \t 100 \n "
" FileCost \t \t 200 \n "
" ResolveSource \t \t 300 \n "
" CostFinalize \t \t 400 \n "
" InstallValidate \t \t 500 \n "
" InstallInitialize \t \t 600 \n "
" MoveFiles \t \t 700 \n "
" mov_immediate \t \t 701 \n "
" mov_deferred \t \t 702 \n "
" InstallFiles \t \t 800 \n "
" InstallFinalize \t \t 900 \n " ;
static const char mov_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \n "
" s72 \t i2 \t S64 \t S0 \n "
" CustomAction \t Action \n "
" mov_immediate \t 1 \t custom.dll \t mov_absent \n "
" mov_deferred \t 1025 \t custom.dll \t mov_present \n " ;
2010-10-14 11:06:13 +02:00
static const char df_directory_dat [ ] =
" Directory \t Directory_Parent \t DefaultDir \n "
" s72 \t S72 \t l255 \n "
" Directory \t Directory \n "
" THIS \t MSITESTDIR \t this \n "
" DOESNOT \t THIS \t doesnot \n "
" NONEXISTENT \t DOESNOT \t exist \n "
" MSITESTDIR \t ProgramFilesFolder \t msitest \n "
" ProgramFilesFolder \t TARGETDIR \t . \n "
" TARGETDIR \t \t SourceDir " ;
static const char df_duplicate_file_dat [ ] =
" FileKey \t Component_ \t File_ \t DestName \t DestFolder \n "
" s72 \t s72 \t s72 \t S255 \t S72 \n "
" DuplicateFile \t FileKey \n "
" maximus \t maximus \t maximus \t augustus \t \n "
" caesar \t maximus \t maximus \t \t NONEXISTENT \n "
" augustus \t nosuchcomponent \t maximus \t \t MSITESTDIR \n " ;
static const char wrv_component_dat [ ] =
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
2018-06-02 04:48:21 +02:00
" augustus \t {bafe0297-cbcc-4e08-8a78-7e9b83456eef} \t MSITESTDIR \t 0 \t \t \n "
" caesar \t {bafe0298-cbcc-4e08-8a78-7e9b83456eef} \t MSITESTDIR \t 1 \t \t \n " ;
2018-01-22 10:19:06 +01:00
static const char wrv_feature_dat [ ] =
" Feature \t Feature_Parent \t Title \t Description \t Display \t Level \t Directory_ \t Attributes \n "
" s38 \t S38 \t L64 \t L255 \t I2 \t i2 \t S72 \t i2 \n "
" Feature \t Feature \n "
" feature \t \t Feature \t Feature \t 2 \t 1 \t TARGETDIR \t 0 \n "
" feature2 \t \t Feature2 \t Feature2 \t 2 \t 1 \t TARGETDIR \t 1 " ;
static const char wrv_feature_comp_dat [ ] =
" Feature_ \t Component_ \n "
" s38 \t s72 \n "
" FeatureComponents \t Feature_ \t Component_ \n "
" feature \t augustus \n "
" feature2 \t caesar " ;
2010-10-14 11:06:13 +02:00
static const char wrv_registry_dat [ ] =
" Registry \t Root \t Key \t Name \t Value \t Component_ \n "
" s72 \t i2 \t l255 \t L255 \t L0 \t s72 \n "
" Registry \t Registry \n "
2018-06-02 04:48:21 +02:00
" regdata0 \t 1 \t msitest \t sz \t string \t augustus \n "
" regdata1 \t 1 \t msitest \t multisz \t one[~]two[~]three \t augustus \n "
" regdata2 \t 1 \t msitest \t expandsz \t #%string \t augustus \n "
" regdata3 \t 1 \t msitest \t dword \t #123 \t augustus \n "
" regdata4 \t 1 \t msitest \t binary \t #x01234567 \t augustus \n "
" regdata5 \t 1 \t msitest \t \t default \t augustus \n "
" regdata6 \t 1 \t msitest \\ subkey \t * \t \t augustus \n "
" regdata7 \t 1 \t msitest \\ subkey \t * \t #% \t augustus \n "
" regdata8 \t 1 \t msitest \\ subkey \t * \t #x \t augustus \n "
" regdata9 \t 1 \t msitest \\ VisualStudio \\ 10.0 \\ AD7Metrics \\ Exception \\ {049EC4CC-30D2-4032-9256-EE18EB41B62B} \\ Common Language Runtime Exceptions \\ System.Workflow.ComponentModel.Serialization \\ System.Workflow.ComponentModel.Serialization.WorkflowMarkupSerializationException \t long \t key \t augustus \n "
" regdata10 \t 1 \t msitest \t Value1 \t [~]one[~] \t augustus \n "
" regdata11 \t 1 \t msitest \t Value2 \t [~]two \t augustus \n "
" regdata12 \t 1 \t msitest \t Value3 \t one[~] \t augustus \n "
" regdata13 \t 1 \t msitest \t Value4 \t one[~]two \t augustus \n "
" regdata14 \t 1 \t msitest \t Value5 \t [~]one[~]two[~]three \t augustus \n "
" regdata15 \t 1 \t msitest \t Value6 \t [~] \t augustus \n "
" regdata16 \t 1 \t msitest \t Value7 \t [~]two \t augustus \n "
" regdata17 \t 1 \t msitest \t format \t [regdata17] \t augustus \n "
" regdata18 \t 1 \t msitest \t source \t #1 \t caesar \n "
" regdata19 \t 1 \t msitest \\ create \t + \t \t augustus \n "
" regdata20 \t 1 \t msitest \\ delete \t - \t \t augustus \n " ;
static const char wrv_remove_registry_dat [ ] =
" RemoveRegistry \t Root \t Key \t Name \t Component_ \n "
" s72 \t i2 \t l255 \t L255 \t s72 \n "
" RemoveRegistry \t RemoveRegistry \n "
" regdata0 \t 1 \t msitest \t instremove \t augustus \n "
" regdata1 \t 1 \t msitest \\ instremove \t - \t augustus \n " ;
static const char wrv_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" CostFinalize \t \t 1000 \n "
" InstallValidate \t \t 1400 \n "
" InstallInitialize \t \t 1500 \n "
" ProcessComponents \t \t 1600 \n "
" RemoveRegistryValues \t \t 4900 \n "
2018-06-02 04:48:22 +02:00
" rrv_immediate \t REMOVE \t 4901 \n "
" rrv_deferred \t REMOVE \t 4902 \n "
2018-06-02 04:48:21 +02:00
" WriteRegistryValues \t \t 5000 \n "
2018-06-02 04:48:22 +02:00
" wrv_immediate \t NOT REMOVE \t 5001 \n "
" wrv_deferred \t NOT REMOVE \t 5002 \n "
2018-06-02 04:48:21 +02:00
" RegisterProduct \t \t 6100 \n "
" PublishFeatures \t \t 6200 \n "
" PublishProduct \t \t 6300 \n "
" InstallFinalize \t \t 6600 \n " ;
2010-10-14 11:06:13 +02:00
2018-06-02 04:48:22 +02:00
static const char wrv_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \n "
" s72 \t i2 \t S64 \t S0 \n "
" CustomAction \t Action \n "
" wrv_immediate \t 1 \t custom.dll \t wrv_absent \n "
" wrv_deferred \t 1025 \t custom.dll \t wrv_present \n "
" rrv_immediate \t 1 \t custom.dll \t wrv_present \n "
" rrv_deferred \t 1025 \t custom.dll \t wrv_absent \n " ;
2010-11-26 14:03:31 +01:00
static const char cf_directory_dat [ ] =
" Directory \t Directory_Parent \t DefaultDir \n "
" s72 \t S72 \t l255 \n "
" Directory \t Directory \n "
" FIRSTDIR \t MSITESTDIR \t first \n "
" SECONDDIR \t MSITESTDIR \t second \n "
" THIRDDIR \t MSITESTDIR \t third \n "
" MSITESTDIR \t ProgramFilesFolder \t msitest \n "
" ProgramFilesFolder \t TARGETDIR \t . \n "
" TARGETDIR \t \t SourceDir " ;
static const char cf_component_dat [ ] =
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
" One \t {F8CD42AC-9C38-48FE-8664-B35FD121012A} \t FIRSTDIR \t 0 \t \t one.txt \n "
" Two \t {DE2DB02E-2DDF-4E34-8CF6-DCA13E29DF52} \t SECONDDIR \t 0 \t \t two.txt \n " ;
static const char cf_feature_dat [ ] =
" Feature \t Feature_Parent \t Title \t Description \t Display \t Level \t Directory_ \t Attributes \n "
" s38 \t S38 \t L64 \t L255 \t I2 \t i2 \t S72 \t i2 \n "
" Feature \t Feature \n "
" One \t \t One \t The One Feature \t 1 \t 3 \t FIRSTDIR \t 0 \n "
" Two \t \t Two \t The Two Feature \t 1 \t 3 \t SECONDDIR \t 0 \n " ;
static const char cf_feature_comp_dat [ ] =
" Feature_ \t Component_ \n "
" s38 \t s72 \n "
" FeatureComponents \t Feature_ \t Component_ \n "
" One \t One \n "
" Two \t Two \n " ;
static const char cf_file_dat [ ] =
" File \t Component_ \t FileName \t FileSize \t Version \t Language \t Attributes \t Sequence \n "
" s72 \t s72 \t l255 \t i4 \t S72 \t S20 \t I2 \t i2 \n "
" File \t File \n "
" one.txt \t One \t one.txt \t 0 \t \t \t 0 \t 1 \n "
" two.txt \t Two \t two.txt \t 0 \t \t \t 0 \t 2 \n " ;
2010-10-14 11:06:13 +02:00
static const char cf_create_folders_dat [ ] =
" Directory_ \t Component_ \n "
" s72 \t s72 \n "
" CreateFolder \t Directory_ \t Component_ \n "
2010-11-26 14:03:31 +01:00
" FIRSTDIR \t One \n "
" SECONDDIR \t Two \n "
" THIRDDIR \t Two \n " ;
2010-10-14 11:06:13 +02:00
static const char cf_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" CostFinalize \t \t 1000 \n "
" ValidateProductID \t \t 700 \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" RemoveFiles \t \t 3500 \n "
2018-05-19 05:00:54 +02:00
" rfi_immediate \t REMOVE \t 3501 \n "
" rfi_deferred \t REMOVE \t 3502 \n "
2010-10-14 11:06:13 +02:00
" CreateFolders \t \t 3700 \n "
2018-05-18 05:26:08 +02:00
" cf_immediate \t NOT REMOVE \t 3701 \n "
" cf_deferred \t NOT REMOVE \t 3702 \n "
2010-11-26 14:03:31 +01:00
" RemoveFolders \t \t 3800 \n "
2018-05-18 05:26:08 +02:00
" rf_immediate \t REMOVE \t 3801 \n "
" rf_deferred \t REMOVE \t 3802 \n "
2010-10-14 11:06:13 +02:00
" InstallFiles \t \t 4000 \n "
2018-05-19 05:00:54 +02:00
" ifi_immediate \t NOT REMOVE \t 4001 \n "
" ifi_deferred \t NOT REMOVE \t 4002 \n "
2010-10-14 11:06:13 +02:00
" RegisterUser \t \t 6000 \n "
" RegisterProduct \t \t 6100 \n "
" PublishFeatures \t \t 6300 \n "
" PublishProduct \t \t 6400 \n "
" InstallFinalize \t \t 6600 \n "
" InstallInitialize \t \t 1500 \n "
" ProcessComponents \t \t 1600 \n "
" UnpublishFeatures \t \t 1800 \n "
" InstallValidate \t \t 1400 \n "
" LaunchConditions \t \t 100 \n " ;
2018-05-18 05:26:08 +02:00
static const char cf_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \n "
" s72 \t i2 \t S64 \t S0 \n "
" CustomAction \t Action \n "
2018-05-19 05:00:54 +02:00
" ifi_immediate \t 1 \t custom.dll \t file_absent \n "
" ifi_deferred \t 1025 \t custom.dll \t file_present \n "
" rfi_immediate \t 1 \t custom.dll \t file_present \n "
" rfi_deferred \t 1025 \t custom.dll \t file_absent \n "
2018-05-18 05:26:08 +02:00
" cf_immediate \t 1 \t custom.dll \t cf_absent \n "
" cf_deferred \t 1025 \t custom.dll \t cf_present \n "
" rf_immediate \t 1 \t custom.dll \t cf_present \n "
" rf_deferred \t 1025 \t custom.dll \t cf_absent \n " ;
2018-05-30 10:22:26 +02:00
static const char sr_file_dat [ ] =
" File \t Component_ \t FileName \t FileSize \t Version \t Language \t Attributes \t Sequence \n "
" s72 \t s72 \t l255 \t i4 \t S72 \t S20 \t I2 \t i2 \n "
" File \t File \n "
" selfreg.dll \t selfreg \t selfreg.dll \t 1000 \t \t \t 8192 \t 1 \n " ;
static const char sr_feature_dat [ ] =
" Feature \t Feature_Parent \t Title \t Description \t Display \t Level \t Directory_ \t Attributes \n "
" s38 \t S38 \t L64 \t L255 \t I2 \t i2 \t S72 \t i2 \n "
" Feature \t Feature \n "
" selfreg \t \t \t selfreg feature \t 1 \t 2 \t MSITESTDIR \t 0 \n " ;
static const char sr_feature_comp_dat [ ] =
" Feature_ \t Component_ \n "
" s38 \t s72 \n "
" FeatureComponents \t Feature_ \t Component_ \n "
" selfreg \t selfreg \n " ;
static const char sr_component_dat [ ] =
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
" selfreg \t {BB4C26FD-89D8-4E49-AF1C-DB4DCB5BF1B0} \t MSITESTDIR \t 0 \t \t selfreg.dll \n " ;
2010-10-14 11:06:13 +02:00
static const char sr_selfreg_dat [ ] =
" File_ \t Cost \n "
" s72 \t I2 \n "
" SelfReg \t File_ \n "
2018-05-30 10:22:26 +02:00
" selfreg.dll \t \n " ;
2010-10-14 11:06:13 +02:00
static const char sr_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
2018-05-30 10:22:26 +02:00
" CostFinalize \t \t 1000 \n "
" InstallValidate \t \t 1400 \n "
" InstallInitialize \t \t 1500 \n "
" ProcessComponents \t \t 1600 \n "
" SelfUnregModules \t \t 3800 \n "
2018-05-30 10:22:27 +02:00
" su_immediate \t REMOVE \t 3801 \n "
" su_deferred \t REMOVE \t 3802 \n "
2018-05-30 10:22:26 +02:00
" RemoveFiles \t \t 3900 \n "
2010-10-14 11:06:13 +02:00
" InstallFiles \t \t 4000 \n "
2018-05-30 10:22:26 +02:00
" SelfRegModules \t \t 4100 \n "
2018-05-30 10:22:27 +02:00
" sr_immediate \t NOT REMOVE \t 4101 \n "
" sr_deferred \t NOT REMOVE \t 4102 \n "
2010-10-14 11:06:13 +02:00
" CreateShortcuts \t \t 4600 \n "
2018-05-30 10:22:26 +02:00
" RegisterProduct \t \t 5100 \n "
" PublishFeatures \t \t 5200 \n "
" PublishProduct \t \t 5300 \n "
" InstallFinalize \t \t 6600 \n " ;
2010-10-14 11:06:13 +02:00
2018-05-30 10:22:27 +02:00
static const char sr_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \n "
" s72 \t i2 \t S64 \t S0 \n "
" CustomAction \t Action \n "
" sr_immediate \t 1 \t custom.dll \t sr_absent \n "
" sr_deferred \t 1025 \t custom.dll \t sr_present \n "
" su_immediate \t 1 \t custom.dll \t sr_present \n "
" su_deferred \t 1025 \t custom.dll \t sr_absent \n " ;
2010-10-14 11:06:13 +02:00
static const char font_media_dat [ ] =
" DiskId \t LastSequence \t DiskPrompt \t Cabinet \t VolumeLabel \t Source \n "
" i2 \t i4 \t L64 \t S255 \t S32 \t S72 \n "
" Media \t DiskId \n "
" 1 \t 3 \t \t \t DISK1 \t \n " ;
static const char font_file_dat [ ] =
" File \t Component_ \t FileName \t FileSize \t Version \t Language \t Attributes \t Sequence \n "
" s72 \t s72 \t l255 \t i4 \t S72 \t S20 \t I2 \t i2 \n "
" File \t File \n "
" font.ttf \t fonts \t font.ttf \t 1000 \t \t \t 8192 \t 1 \n " ;
static const char font_feature_dat [ ] =
" Feature \t Feature_Parent \t Title \t Description \t Display \t Level \t Directory_ \t Attributes \n "
" s38 \t S38 \t L64 \t L255 \t I2 \t i2 \t S72 \t i2 \n "
" Feature \t Feature \n "
" fonts \t \t \t font feature \t 1 \t 2 \t MSITESTDIR \t 0 \n " ;
static const char font_component_dat [ ] =
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
" fonts \t {F5920ED0-1183-4B8F-9330-86CE56557C05} \t MSITESTDIR \t 0 \t \t font.ttf \n " ;
static const char font_feature_comp_dat [ ] =
" Feature_ \t Component_ \n "
" s38 \t s72 \n "
" FeatureComponents \t Feature_ \t Component_ \n "
" fonts \t fonts \n " ;
static const char font_dat [ ] =
" File_ \t FontTitle \n "
" s72 \t S128 \n "
" Font \t File_ \n "
" font.ttf \t msi test font \n " ;
static const char font_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" ValidateProductID \t \t 700 \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" CostFinalize \t \t 1000 \n "
" InstallValidate \t \t 1400 \n "
" InstallInitialize \t \t 1500 \n "
" ProcessComponents \t \t 1600 \n "
" UnpublishFeatures \t \t 1800 \n "
" RemoveFiles \t \t 3500 \n "
" InstallFiles \t \t 4000 \n "
" RegisterFonts \t \t 4100 \n "
2018-05-26 04:18:14 +02:00
" rf_immediate \t NOT REMOVE \t 4101 \n "
" rf_deferred \t NOT REMOVE \t 4102 \n "
2010-10-14 11:06:13 +02:00
" UnregisterFonts \t \t 4200 \n "
2018-05-26 04:18:14 +02:00
" uf_immediate \t REMOVE \t 4201 \n "
" uf_deferred \t REMOVE \t 4202 \n "
2010-10-14 11:06:13 +02:00
" RegisterUser \t \t 6000 \n "
" RegisterProduct \t \t 6100 \n "
" PublishFeatures \t \t 6300 \n "
" PublishProduct \t \t 6400 \n "
" InstallFinalize \t \t 6600 " ;
2018-05-26 04:18:14 +02:00
static const char font_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \n "
" s72 \t i2 \t S64 \t S0 \n "
" CustomAction \t Action \n "
" rf_immediate \t 1 \t custom.dll \t font_absent \n "
" rf_deferred \t 1025 \t custom.dll \t font_present \n "
" uf_immediate \t 1 \t custom.dll \t font_present \n "
" uf_deferred \t 1025 \t custom.dll \t font_absent \n " ;
2010-10-14 11:06:13 +02:00
static const char vp_property_dat [ ] =
" Property \t Value \n "
" s72 \t l0 \n "
" Property \t Property \n "
" HASUIRUN \t 0 \n "
" INSTALLLEVEL \t 3 \n "
" InstallMode \t Typical \n "
" Manufacturer \t Wine \n "
" PIDTemplate \t ###-####### \n "
" ProductCode \t {7DF88A48-996F-4EC8-A022-BF956F9B2CBB} \n "
" ProductLanguage \t 1033 \n "
" ProductName \t MSITEST \n "
" ProductVersion \t 1.1.1 \n "
" UpgradeCode \t {4C0EAA15-0264-4E5A-8758-609EF142B92D} \n "
" MSIFASTINSTALL \t 1 \n " ;
static const char vp_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \t ISComments \n "
" s72 \t i2 \t S64 \t S0 \t S255 \n "
" CustomAction \t Action \n "
" SetProductID1 \t 51 \t ProductID \t 1 \t \n "
" SetProductID2 \t 51 \t ProductID \t 2 \t \n "
" TestProductID1 \t 19 \t \t \t Halts installation \n "
" TestProductID2 \t 19 \t \t \t Halts installation \n " ;
static const char vp_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" LaunchConditions \t \t 100 \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" CostFinalize \t \t 1000 \n "
" InstallValidate \t \t 1400 \n "
" InstallInitialize \t \t 1500 \n "
" SetProductID1 \t SET_PRODUCT_ID=1 \t 3000 \n "
" SetProductID2 \t SET_PRODUCT_ID=2 \t 3100 \n "
" ValidateProductID \t \t 3200 \n "
" InstallExecute \t \t 3300 \n "
" TestProductID1 \t ProductID=1 \t 3400 \n "
" TestProductID2 \t ProductID= \" 123-1234567 \" \t 3500 \n "
" InstallFiles \t \t 4000 \n "
" InstallFinalize \t \t 6000 \n " ;
static const char odbc_file_dat [ ] =
" File \t Component_ \t FileName \t FileSize \t Version \t Language \t Attributes \t Sequence \n "
" s72 \t s72 \t l255 \t i4 \t S72 \t S20 \t I2 \t i2 \n "
" File \t File \n "
" ODBCdriver.dll \t odbc \t ODBCdriver.dll \t 1000 \t \t \t 8192 \t 1 \n "
" ODBCdriver2.dll \t odbc \t ODBCdriver2.dll \t 1000 \t \t \t 8192 \t 2 \n "
" ODBCtranslator.dll \t odbc \t ODBCtranslator.dll \t 1000 \t \t \t 8192 \t 3 \n "
" ODBCtranslator2.dll \t odbc \t ODBCtranslator2.dll \t 1000 \t \t \t 8192 \t 4 \n "
" ODBCsetup.dll \t odbc \t ODBCsetup.dll \t 1000 \t \t \t 8192 \t 5 \n " ;
static const char odbc_feature_dat [ ] =
" Feature \t Feature_Parent \t Title \t Description \t Display \t Level \t Directory_ \t Attributes \n "
" s38 \t S38 \t L64 \t L255 \t I2 \t i2 \t S72 \t i2 \n "
" Feature \t Feature \n "
" odbc \t \t \t odbc feature \t 1 \t 2 \t MSITESTDIR \t 0 \n " ;
static const char odbc_feature_comp_dat [ ] =
" Feature_ \t Component_ \n "
" s38 \t s72 \n "
" FeatureComponents \t Feature_ \t Component_ \n "
2018-05-19 05:00:57 +02:00
" odbc \t odbc64 \n "
2010-10-14 11:06:13 +02:00
" odbc \t odbc \n " ;
static const char odbc_component_dat [ ] =
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
2018-05-19 05:00:57 +02:00
" odbc64 \t {B6F3E4AF-35D1-4B72-9044-989F03E20A43} \t MSITESTDIR \t 256 \t Msix64 \t ODBCdriver.dll \n "
2010-10-14 11:06:13 +02:00
" odbc \t {B6F3E4AE-35D1-4B72-9044-989F03E20A43} \t MSITESTDIR \t 0 \t \t ODBCdriver.dll \n " ;
static const char odbc_driver_dat [ ] =
" Driver \t Component_ \t Description \t File_ \t File_Setup \n "
" s72 \t s72 \t s255 \t s72 \t S72 \n "
" ODBCDriver \t Driver \n "
2018-05-19 05:00:57 +02:00
" 64-bit driver \t odbc64 \t ODBC test driver \t ODBCdriver.dll \t \n "
" 64-bit driver2 \t odbc64 \t ODBC test driver2 \t ODBCdriver2.dll \t ODBCsetup.dll \n "
2010-10-14 11:06:13 +02:00
" ODBC test driver \t odbc \t ODBC test driver \t ODBCdriver.dll \t \n "
" ODBC test driver2 \t odbc \t ODBC test driver2 \t ODBCdriver2.dll \t ODBCsetup.dll \n " ;
static const char odbc_translator_dat [ ] =
" Translator \t Component_ \t Description \t File_ \t File_Setup \n "
" s72 \t s72 \t s255 \t s72 \t S72 \n "
" ODBCTranslator \t Translator \n "
" ODBC test translator \t odbc \t ODBC test translator \t ODBCtranslator.dll \t \n "
" ODBC test translator2 \t odbc \t ODBC test translator2 \t ODBCtranslator2.dll \t ODBCsetup.dll \n " ;
static const char odbc_datasource_dat [ ] =
" DataSource \t Component_ \t Description \t DriverDescription \t Registration \n "
" s72 \t s72 \t s255 \t s255 \t i2 \n "
" ODBCDataSource \t DataSource \n "
" ODBC data source \t odbc \t ODBC data source \t ODBC driver \t 0 \n " ;
static const char odbc_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" LaunchConditions \t \t 100 \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" CostFinalize \t \t 1000 \n "
" InstallValidate \t \t 1400 \n "
" InstallInitialize \t \t 1500 \n "
" ProcessComponents \t \t 1600 \n "
" InstallODBC \t \t 3000 \n "
2018-05-19 05:00:58 +02:00
" io_immediate \t NOT REMOVE \t 3001 \n "
" io_deferred \t NOT REMOVE \t 3002 \n "
2010-10-14 11:06:13 +02:00
" RemoveODBC \t \t 3100 \n "
2018-05-19 05:00:58 +02:00
" ro_immediate \t REMOVE \t 3101 \n "
" ro_deferred \t REMOVE \t 3102 \n "
2010-10-14 11:06:13 +02:00
" RemoveFiles \t \t 3900 \n "
" InstallFiles \t \t 4000 \n "
" RegisterProduct \t \t 5000 \n "
" PublishFeatures \t \t 5100 \n "
" PublishProduct \t \t 5200 \n "
" InstallFinalize \t \t 6000 \n " ;
2018-05-19 05:00:58 +02:00
static const char odbc_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \n "
" s72 \t i2 \t S64 \t S0 \n "
" CustomAction \t Action \n "
" io_immediate \t 1 \t custom.dll \t odbc_absent \n "
" io_deferred \t 1025 \t custom.dll \t odbc_present \n "
" ro_immediate \t 1 \t custom.dll \t odbc_present \n "
" ro_deferred \t 1025 \t custom.dll \t odbc_absent \n " ;
2010-10-14 11:06:13 +02:00
static const char odbc_media_dat [ ] =
" DiskId \t LastSequence \t DiskPrompt \t Cabinet \t VolumeLabel \t Source \n "
" i2 \t i4 \t L64 \t S255 \t S32 \t S72 \n "
" Media \t DiskId \n "
" 1 \t 5 \t \t \t DISK1 \t \n " ;
static const char tl_file_dat [ ] =
" File \t Component_ \t FileName \t FileSize \t Version \t Language \t Attributes \t Sequence \n "
" s72 \t s72 \t l255 \t i4 \t S72 \t S20 \t I2 \t i2 \n "
" File \t File \n "
" typelib.dll \t typelib \t typelib.dll \t 1000 \t \t \t 8192 \t 1 \n " ;
static const char tl_feature_dat [ ] =
" Feature \t Feature_Parent \t Title \t Description \t Display \t Level \t Directory_ \t Attributes \n "
" s38 \t S38 \t L64 \t L255 \t I2 \t i2 \t S72 \t i2 \n "
" Feature \t Feature \n "
" typelib \t \t \t typelib feature \t 1 \t 2 \t MSITESTDIR \t 0 \n " ;
static const char tl_feature_comp_dat [ ] =
" Feature_ \t Component_ \n "
" s38 \t s72 \n "
" FeatureComponents \t Feature_ \t Component_ \n "
" typelib \t typelib \n " ;
static const char tl_component_dat [ ] =
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
" typelib \t {BB4C26FD-89D8-4E49-AF1C-DB4DCB5BF1B0} \t MSITESTDIR \t 0 \t \t typelib.dll \n " ;
static const char tl_typelib_dat [ ] =
" LibID \t Language \t Component_ \t Version \t Description \t Directory_ \t Feature_ \t Cost \n "
" s38 \t i2 \t s72 \t I4 \t L128 \t S72 \t s38 \t I4 \n "
" TypeLib \t LibID \t Language \t Component_ \n "
" {EAC5166A-9734-4D91-878F-1DD02304C66C} \t 0 \t typelib \t 1793 \t \t MSITESTDIR \t typelib \t \n " ;
static const char tl_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" LaunchConditions \t \t 100 \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" CostFinalize \t \t 1000 \n "
" InstallValidate \t \t 1400 \n "
" InstallInitialize \t \t 1500 \n "
" ProcessComponents \t \t 1600 \n "
" UnregisterTypeLibraries \t \t 3100 \n "
2018-05-30 10:22:25 +02:00
" ut_immediate \t REMOVE \t 3101 \n "
" ut_deferred \t REMOVE \t 3102 \n "
2018-05-30 10:22:24 +02:00
" RemoveFiles \t \t 3200 \n "
" InstallFiles \t \t 3300 \n "
" RegisterTypeLibraries \t \t 3400 \n "
2018-05-30 10:22:25 +02:00
" rt_immediate \t NOT REMOVE \t 3401 \n "
" rt_deferred \t NOT REMOVE \t 3402 \n "
2010-10-14 11:06:13 +02:00
" RegisterProduct \t \t 5100 \n "
" PublishFeatures \t \t 5200 \n "
" PublishProduct \t \t 5300 \n "
" InstallFinalize \t \t 6000 \n " ;
2018-05-30 10:22:25 +02:00
static const char tl_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \n "
" s72 \t i2 \t S64 \t S0 \n "
" CustomAction \t Action \n "
" rt_immediate \t 1 \t custom.dll \t tl_absent \n "
" rt_deferred \t 1025 \t custom.dll \t tl_present \n "
" ut_immediate \t 1 \t custom.dll \t tl_present \n "
" ut_deferred \t 1025 \t custom.dll \t tl_absent \n " ;
2010-10-14 11:06:13 +02:00
static const char crs_file_dat [ ] =
" File \t Component_ \t FileName \t FileSize \t Version \t Language \t Attributes \t Sequence \n "
" s72 \t s72 \t l255 \t i4 \t S72 \t S20 \t I2 \t i2 \n "
" File \t File \n "
" target.txt \t shortcut \t target.txt \t 1000 \t \t \t 8192 \t 1 \n " ;
static const char crs_feature_dat [ ] =
" Feature \t Feature_Parent \t Title \t Description \t Display \t Level \t Directory_ \t Attributes \n "
" s38 \t S38 \t L64 \t L255 \t I2 \t i2 \t S72 \t i2 \n "
" Feature \t Feature \n "
" shortcut \t \t \t shortcut feature \t 1 \t 2 \t MSITESTDIR \t 0 \n " ;
static const char crs_feature_comp_dat [ ] =
" Feature_ \t Component_ \n "
" s38 \t s72 \n "
" FeatureComponents \t Feature_ \t Component_ \n "
" shortcut \t shortcut \n " ;
static const char crs_component_dat [ ] =
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
" shortcut \t {5D20E3C6-7206-498F-AC28-87AF2F9AD4CC} \t MSITESTDIR \t 0 \t \t target.txt \n " ;
static const char crs_shortcut_dat [ ] =
" Shortcut \t Directory_ \t Name \t Component_ \t Target \t Arguments \t Description \t Hotkey \t Icon_ \t IconIndex \t ShowCmd \t WkDir \n "
" s72 \t s72 \t l128 \t s72 \t s72 \t L255 \t L255 \t I2 \t S72 \t I2 \t I2 \t S72 \n "
" Shortcut \t Shortcut \n "
" shortcut \t MSITESTDIR \t shortcut \t shortcut \t [MSITESTDIR]target.txt \t \t \t \t \t \t \t \n " ;
static const char crs_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" LaunchConditions \t \t 100 \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" CostFinalize \t \t 1000 \n "
" InstallValidate \t \t 1400 \n "
" InstallInitialize \t \t 1500 \n "
" ProcessComponents \t \t 1600 \n "
" RemoveFiles \t \t 1700 \n "
" InstallFiles \t \t 2000 \n "
" RemoveShortcuts \t \t 3000 \n "
2018-05-18 05:26:09 +02:00
" rs_immediate \t REMOVE \t 3001 \n "
" rs_deferred \t REMOVE \t 3002 \n "
2010-10-14 11:06:13 +02:00
" CreateShortcuts \t \t 3100 \n "
2018-05-18 05:26:09 +02:00
" cs_immediate \t NOT REMOVE \t 3101 \n "
" cs_deferred \t NOT REMOVE \t 3102 \n "
2010-10-14 11:06:13 +02:00
" RegisterProduct \t \t 5000 \n "
" PublishFeatures \t \t 5100 \n "
" PublishProduct \t \t 5200 \n "
" InstallFinalize \t \t 6000 \n " ;
2018-05-18 05:26:09 +02:00
static const char crs_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \n "
" s72 \t i2 \t S64 \t S0 \n "
" CustomAction \t Action \n "
" cs_immediate \t 1 \t custom.dll \t crs_absent \n "
" cs_deferred \t 1025 \t custom.dll \t crs_present \n "
" rs_immediate \t 1 \t custom.dll \t crs_present \n "
" rs_deferred \t 1025 \t custom.dll \t crs_absent \n " ;
2010-10-14 11:06:13 +02:00
static const char pub_file_dat [ ] =
" File \t Component_ \t FileName \t FileSize \t Version \t Language \t Attributes \t Sequence \n "
" s72 \t s72 \t l255 \t i4 \t S72 \t S20 \t I2 \t i2 \n "
" File \t File \n "
" english.txt \t publish \t english.txt \t 1000 \t \t \t 8192 \t 1 \n " ;
static const char pub_feature_dat [ ] =
" Feature \t Feature_Parent \t Title \t Description \t Display \t Level \t Directory_ \t Attributes \n "
" s38 \t S38 \t L64 \t L255 \t I2 \t i2 \t S72 \t i2 \n "
" Feature \t Feature \n "
" publish \t \t \t publish feature \t 1 \t 2 \t MSITESTDIR \t 0 \n " ;
static const char pub_feature_comp_dat [ ] =
" Feature_ \t Component_ \n "
" s38 \t s72 \n "
" FeatureComponents \t Feature_ \t Component_ \n "
" publish \t publish \n " ;
static const char pub_component_dat [ ] =
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
" publish \t {B4EA0ACF-6238-426E-9C6D-7869F0F9C768} \t MSITESTDIR \t 0 \t \t english.txt \n " ;
static const char pub_publish_component_dat [ ] =
" ComponentId \t Qualifier \t Component_ \t AppData \t Feature_ \n "
" s38 \t s255 \t s72 \t L255 \t s38 \n "
" PublishComponent \t ComponentId \t Qualifier \t Component_ \n "
" {92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA} \t english.txt \t publish \t \t publish \n " ;
static const char pub_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" LaunchConditions \t \t 100 \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" CostFinalize \t \t 1000 \n "
" InstallValidate \t \t 1400 \n "
" InstallInitialize \t \t 1500 \n "
" ProcessComponents \t \t 1600 \n "
" RemoveFiles \t \t 1700 \n "
" InstallFiles \t \t 2000 \n "
" PublishComponents \t \t 3000 \n "
2018-05-25 02:14:12 +02:00
" pub_immediate \t NOT REMOVE \t 3001 \n "
" pub_deferred \t NOT REMOVE \t 3002 \n "
2010-10-14 11:06:13 +02:00
" UnpublishComponents \t \t 3100 \n "
2018-05-25 02:14:12 +02:00
" unp_immediate \t REMOVE \t 3101 \n "
" unp_deferred \t REMOVE \t 3102 \n "
2010-10-14 11:06:13 +02:00
" RegisterProduct \t \t 5000 \n "
" PublishFeatures \t \t 5100 \n "
" PublishProduct \t \t 5200 \n "
" InstallFinalize \t \t 6000 \n " ;
2018-05-25 02:14:12 +02:00
static const char pub_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \n "
" s72 \t i2 \t S64 \t S0 \n "
" CustomAction \t Action \n "
" pub_immediate \t 1 \t custom.dll \t pub_absent \n "
" pub_deferred \t 1025 \t custom.dll \t pub_present \n "
" unp_immediate \t 1 \t custom.dll \t pub_present \n "
" unp_deferred \t 1025 \t custom.dll \t pub_absent \n " ;
2010-10-14 11:06:13 +02:00
static const char rd_file_dat [ ] =
" File \t Component_ \t FileName \t FileSize \t Version \t Language \t Attributes \t Sequence \n "
" s72 \t s72 \t l255 \t i4 \t S72 \t S20 \t I2 \t i2 \n "
" File \t File \n "
" original.txt \t duplicate \t original.txt \t 1000 \t \t \t 8192 \t 1 \n "
" original2.txt \t duplicate \t original2.txt \t 1000 \t \t \t 8192 \t 2 \n "
" original3.txt \t duplicate2 \t original3.txt \t 1000 \t \t \t 8192 \t 3 \n " ;
static const char rd_feature_dat [ ] =
" Feature \t Feature_Parent \t Title \t Description \t Display \t Level \t Directory_ \t Attributes \n "
" s38 \t S38 \t L64 \t L255 \t I2 \t i2 \t S72 \t i2 \n "
" Feature \t Feature \n "
" duplicate \t \t \t duplicate feature \t 1 \t 2 \t MSITESTDIR \t 0 \n " ;
static const char rd_feature_comp_dat [ ] =
" Feature_ \t Component_ \n "
" s38 \t s72 \n "
" FeatureComponents \t Feature_ \t Component_ \n "
" duplicate \t duplicate \n " ;
static const char rd_component_dat [ ] =
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
" duplicate \t {EB45D06A-ADFE-44E3-8D41-B7DE150E41AD} \t MSITESTDIR \t 0 \t \t original.txt \n "
" duplicate2 \t {B8BA60E0-B2E9-488E-9D0E-E60F25F04F97} \t MSITESTDIR \t 0 \t DUPLICATE2=1 \t original3.txt \n " ;
static const char rd_duplicate_file_dat [ ] =
" FileKey \t Component_ \t File_ \t DestName \t DestFolder \n "
" s72 \t s72 \t s72 \t S255 \t S72 \n "
" DuplicateFile \t FileKey \n "
" duplicate \t duplicate \t original.txt \t duplicate.txt \t \n "
" duplicate2 \t duplicate \t original2.txt \t \t MSITESTDIR \n "
" duplicate3 \t duplicate2 \t original3.txt \t duplicate2.txt \t \n " ;
static const char rd_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" LaunchConditions \t \t 100 \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" CostFinalize \t \t 1000 \n "
" InstallValidate \t \t 1400 \n "
" InstallInitialize \t \t 1500 \n "
" ProcessComponents \t \t 1600 \n "
" RemoveDuplicateFiles \t \t 1900 \n "
2018-05-19 05:00:53 +02:00
" rd_immediate \t REMOVE \t 1901 \n "
" rd_deferred \t REMOVE \t 1902 \n "
2010-10-14 11:06:13 +02:00
" InstallFiles \t \t 2000 \n "
" DuplicateFiles \t \t 2100 \n "
2018-05-19 05:00:53 +02:00
" df_immediate \t NOT REMOVE \t 2101 \n "
" df_deferred \t NOT REMOVE \t 2102 \n "
2010-10-14 11:06:13 +02:00
" RegisterProduct \t \t 5000 \n "
" PublishFeatures \t \t 5100 \n "
" PublishProduct \t \t 5200 \n "
" InstallFinalize \t \t 6000 \n " ;
2018-05-19 05:00:53 +02:00
static const char rd_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \n "
" s72 \t i2 \t S64 \t S0 \n "
" CustomAction \t Action \n "
" df_immediate \t 1 \t custom.dll \t rd_absent \n "
" df_deferred \t 1025 \t custom.dll \t rd_present \n "
" rd_immediate \t 1 \t custom.dll \t rd_present \n "
" rd_deferred \t 1025 \t custom.dll \t rd_absent \n " ;
2010-10-14 11:06:13 +02:00
static const char frp_file_dat [ ] =
" File \t Component_ \t FileName \t FileSize \t Version \t Language \t Attributes \t Sequence \n "
" s72 \t s72 \t l255 \t i4 \t S72 \t S20 \t I2 \t i2 \n "
" File \t File \n "
" product.txt \t product \t product.txt \t 1000 \t \t \t 8192 \t 1 \n " ;
static const char frp_feature_dat [ ] =
" Feature \t Feature_Parent \t Title \t Description \t Display \t Level \t Directory_ \t Attributes \n "
" s38 \t S38 \t L64 \t L255 \t I2 \t i2 \t S72 \t i2 \n "
" Feature \t Feature \n "
" product \t \t \t product feature \t 1 \t 2 \t MSITESTDIR \t 0 \n " ;
static const char frp_feature_comp_dat [ ] =
" Feature_ \t Component_ \n "
" s38 \t s72 \n "
" FeatureComponents \t Feature_ \t Component_ \n "
" product \t product \n " ;
static const char frp_component_dat [ ] =
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
" product \t {44725EE0-EEA8-40BD-8162-A48224A2FEA1} \t MSITESTDIR \t 0 \t \t product.txt \n " ;
static const char frp_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \t ISComments \n "
" s72 \t i2 \t S64 \t S0 \t S255 \n "
" CustomAction \t Action \n "
" TestProp \t 19 \t \t \t PROP set \n " ;
static const char frp_upgrade_dat [ ] =
" UpgradeCode \t VersionMin \t VersionMax \t Language \t Attributes \t Remove \t ActionProperty \n "
" s38 \t S20 \t S20 \t S255 \t i4 \t S255 \t s72 \n "
" Upgrade \t UpgradeCode \t VersionMin \t VersionMax \t Language \t Attributes \n "
" {4C0EAA15-0264-4E5A-8758-609EF142B92D} \t 1.1.1 \t 2.2.2 \t \t 768 \t \t PROP \n " ;
static const char frp_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" FindRelatedProducts \t \t 50 \n "
" TestProp \t PROP AND NOT REMOVE \t 51 \n "
" LaunchConditions \t \t 100 \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" CostFinalize \t \t 1000 \n "
" InstallValidate \t \t 1400 \n "
" InstallInitialize \t \t 1500 \n "
" ProcessComponents \t \t 1600 \n "
" RemoveFiles \t \t 1700 \n "
" InstallFiles \t \t 2000 \n "
" RegisterProduct \t \t 5000 \n "
" PublishFeatures \t \t 5100 \n "
" PublishProduct \t \t 5200 \n "
" InstallFinalize \t \t 6000 \n " ;
2018-05-31 03:47:35 +02:00
static const char ini_file_dat [ ] =
2010-10-14 11:06:13 +02:00
" File \t Component_ \t FileName \t FileSize \t Version \t Language \t Attributes \t Sequence \n "
" s72 \t s72 \t l255 \t i4 \t S72 \t S20 \t I2 \t i2 \n "
" File \t File \n "
" inifile.txt \t inifile \t inifile.txt \t 1000 \t \t \t 8192 \t 1 \n " ;
2018-05-31 03:47:35 +02:00
static const char ini_feature_dat [ ] =
2010-10-14 11:06:13 +02:00
" Feature \t Feature_Parent \t Title \t Description \t Display \t Level \t Directory_ \t Attributes \n "
" s38 \t S38 \t L64 \t L255 \t I2 \t i2 \t S72 \t i2 \n "
" Feature \t Feature \n "
" inifile \t \t \t inifile feature \t 1 \t 2 \t MSITESTDIR \t 0 \n " ;
2018-05-31 03:47:35 +02:00
static const char ini_feature_comp_dat [ ] =
2010-10-14 11:06:13 +02:00
" Feature_ \t Component_ \n "
" s38 \t s72 \n "
" FeatureComponents \t Feature_ \t Component_ \n "
" inifile \t inifile \n " ;
2018-05-31 03:47:35 +02:00
static const char ini_component_dat [ ] =
2010-10-14 11:06:13 +02:00
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
" inifile \t {A0F15705-4F57-4437-88C4-6C8B37ACC6DE} \t MSITESTDIR \t 0 \t \t inifile.txt \n " ;
2018-05-31 03:47:35 +02:00
static const char ini_ini_file_dat [ ] =
2010-10-14 11:06:13 +02:00
" IniFile \t FileName \t DirProperty \t Section \t Key \t Value \t Action \t Component_ \n "
" s72 \t l255 \t S72 \t l96 \t l128 \t l255 \t i2 \t s72 \n "
" IniFile \t IniFile \n "
" inifile1 \t test.ini \t MSITESTDIR \t section1 \t key1 \t value1 \t 0 \t inifile \n " ;
2018-05-31 03:47:35 +02:00
static const char ini_remove_ini_file_dat [ ] =
2010-10-14 11:06:13 +02:00
" RemoveIniFile \t FileName \t DirProperty \t Section \t Key \t Value \t Action \t Component_ \n "
" s72 \t l255 \t S72 \t l96 \t l128 \t L255 \t i2 \t s72 \n "
" RemoveIniFile \t RemoveIniFile \n "
" inifile1 \t test.ini \t MSITESTDIR \t sectionA \t keyA \t valueA \t 2 \t inifile \n " ;
2018-05-31 03:47:35 +02:00
static const char ini_install_exec_seq_dat [ ] =
2010-10-14 11:06:13 +02:00
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" LaunchConditions \t \t 100 \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" CostFinalize \t \t 1000 \n "
" InstallValidate \t \t 1400 \n "
" InstallInitialize \t \t 1500 \n "
" ProcessComponents \t \t 1600 \n "
" RemoveFiles \t \t 1700 \n "
" InstallFiles \t \t 2000 \n "
" RemoveIniValues \t \t 3000 \n "
2018-05-31 03:47:36 +02:00
" riv_immediate \t REMOVE \t 3001 \n "
" riv_deferred \t REMOVE \t 3002 \n "
2018-05-31 03:47:35 +02:00
" WriteIniValues \t \t 3100 \n "
2018-05-31 03:47:36 +02:00
" wiv_immediate \t NOT REMOVE \t 3101 \n "
" wiv_deferred \t NOT REMOVE \t 3102 \n "
2010-10-14 11:06:13 +02:00
" RegisterProduct \t \t 5000 \n "
" PublishFeatures \t \t 5100 \n "
" PublishProduct \t \t 5200 \n "
" InstallFinalize \t \t 6000 \n " ;
2018-05-31 03:47:36 +02:00
static const char ini_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \n "
" s72 \t i2 \t S64 \t S0 \n "
" CustomAction \t Action \n "
" wiv_immediate \t 1 \t custom.dll \t ini_absent \n "
" wiv_deferred \t 1025 \t custom.dll \t ini_present \n "
" riv_immediate \t 1 \t custom.dll \t ini_present \n "
" riv_deferred \t 1025 \t custom.dll \t ini_absent \n " ;
2010-10-14 11:06:13 +02:00
static const char rci_file_dat [ ] =
" File \t Component_ \t FileName \t FileSize \t Version \t Language \t Attributes \t Sequence \n "
" s72 \t s72 \t l255 \t i4 \t S72 \t S20 \t I2 \t i2 \n "
" File \t File \n "
" class.txt \t class \t class.txt \t 1000 \t \t \t 8192 \t 1 \n " ;
static const char rci_feature_dat [ ] =
" Feature \t Feature_Parent \t Title \t Description \t Display \t Level \t Directory_ \t Attributes \n "
" s38 \t S38 \t L64 \t L255 \t I2 \t i2 \t S72 \t i2 \n "
" Feature \t Feature \n "
" class \t \t \t class feature \t 1 \t 2 \t MSITESTDIR \t 0 \n " ;
static const char rci_feature_comp_dat [ ] =
" Feature_ \t Component_ \n "
" s38 \t s72 \n "
" FeatureComponents \t Feature_ \t Component_ \n "
" class \t class \n " ;
static const char rci_component_dat [ ] =
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
" class \t {89A98345-F8A1-422E-A48B-0250B5809F2D} \t MSITESTDIR \t 0 \t \t class.txt \n " ;
static const char rci_appid_dat [ ] =
" AppId \t RemoteServerName \t LocalService \t ServiceParameters \t DllSurrogate \t ActivateAtStorage \t RunAsInteractiveUser \n "
" s38 \t S255 \t S255 \t S255 \t S255 \t I2 \t I2 \n "
" AppId \t AppId \n "
" {CFCC3B38-E683-497D-9AB4-CB40AAFE307F} \t \t \t \t \t \t \n " ;
static const char rci_class_dat [ ] =
" CLSID \t Context \t Component_ \t ProgId_Default \t Description \t AppId_ \t FileTypeMask \t Icon_ \t IconIndex \t DefInprocHandler \t Argument \t Feature_ \t Attributes \n "
" s38 \t s32 \t s72 \t S255 \t L255 \t S38 \t S255 \t S72 \t I2 \t S32 \t S255 \t s38 \t I2 \n "
" Class \t CLSID \t Context \t Component_ \n "
" {110913E7-86D1-4BF3-9922-BA103FCDDDFA} \t LocalServer \t class \t \t description \t {CFCC3B38-E683-497D-9AB4-CB40AAFE307F} \t mask1;mask2 \t \t \t 2 \t \t class \t \n " ;
static const char rci_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" LaunchConditions \t \t 100 \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" CostFinalize \t \t 1000 \n "
" InstallValidate \t \t 1400 \n "
" InstallInitialize \t \t 1500 \n "
" ProcessComponents \t \t 1600 \n "
" RemoveFiles \t \t 1700 \n "
" InstallFiles \t \t 2000 \n "
" UnregisterClassInfo \t \t 3000 \n "
2018-05-26 04:18:12 +02:00
" uci_immediate \t REMOVE \t 3001 \n "
" uci_deferred \t REMOVE \t 3002 \n "
2010-10-14 11:06:13 +02:00
" RegisterClassInfo \t \t 4000 \n "
2018-05-26 04:18:12 +02:00
" rci_immediate \t NOT REMOVE \t 4001 \n "
" rci_deferred \t NOT REMOVE \t 4002 \n "
2010-10-14 11:06:13 +02:00
" RegisterProduct \t \t 5000 \n "
" PublishFeatures \t \t 5100 \n "
" PublishProduct \t \t 5200 \n "
" InstallFinalize \t \t 6000 \n " ;
2018-05-26 04:18:12 +02:00
static const char rci_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \n "
" s72 \t i2 \t S64 \t S0 \n "
" CustomAction \t Action \n "
" rci_immediate \t 1 \t custom.dll \t rci_absent \n "
" rci_deferred \t 1025 \t custom.dll \t rci_present \n "
" uci_immediate \t 1 \t custom.dll \t rci_present \n "
" uci_deferred \t 1025 \t custom.dll \t rci_absent \n " ;
2010-10-14 11:06:13 +02:00
static const char rei_file_dat [ ] =
" File \t Component_ \t FileName \t FileSize \t Version \t Language \t Attributes \t Sequence \n "
" s72 \t s72 \t l255 \t i4 \t S72 \t S20 \t I2 \t i2 \n "
" File \t File \n "
" extension.txt \t extension \t extension.txt \t 1000 \t \t \t 8192 \t 1 \n " ;
static const char rei_feature_dat [ ] =
" Feature \t Feature_Parent \t Title \t Description \t Display \t Level \t Directory_ \t Attributes \n "
" s38 \t S38 \t L64 \t L255 \t I2 \t i2 \t S72 \t i2 \n "
" Feature \t Feature \n "
" extension \t \t \t extension feature \t 1 \t 2 \t MSITESTDIR \t 0 \n " ;
static const char rei_feature_comp_dat [ ] =
" Feature_ \t Component_ \n "
" s38 \t s72 \n "
" FeatureComponents \t Feature_ \t Component_ \n "
" extension \t extension \n " ;
static const char rei_component_dat [ ] =
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
" extension \t {9A3060D4-60BA-4A82-AB55-9FB148AD013C} \t MSITESTDIR \t 0 \t \t extension.txt \n " ;
static const char rei_extension_dat [ ] =
" Extension \t Component_ \t ProgId_ \t MIME_ \t Feature_ \n "
" s255 \t s72 \t S255 \t S64 \t s38 \n "
" Extension \t Extension \t Component_ \n "
" extension \t extension \t Prog.Id.1 \t \t extension \n " ;
static const char rei_verb_dat [ ] =
" Extension_ \t Verb \t Sequence \t Command \t Argument \n "
" s255 \t s32 \t I2 \t L255 \t L255 \n "
" Verb \t Extension_ \t Verb \n "
" extension \t Open \t 1 \t &Open \t /argument \n " ;
static const char rei_progid_dat [ ] =
" ProgId \t ProgId_Parent \t Class_ \t Description \t Icon_ \t IconIndex \n "
" s255 \t S255 \t S38 \t L255 \t S72 \t I2 \n "
" ProgId \t ProgId \n "
" Prog.Id.1 \t \t \t description \t \t \n " ;
static const char rei_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" LaunchConditions \t \t 100 \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" CostFinalize \t \t 1000 \n "
" InstallValidate \t \t 1400 \n "
" InstallInitialize \t \t 1500 \n "
" ProcessComponents \t \t 1600 \n "
" RemoveFiles \t \t 1700 \n "
" InstallFiles \t \t 2000 \n "
" UnregisterExtensionInfo \t \t 3000 \n "
2018-05-26 04:18:13 +02:00
" uei_immediate \t REMOVE \t 3001 \n "
" uei_deferred \t REMOVE \t 3002 \n "
2010-10-14 11:06:13 +02:00
" RegisterExtensionInfo \t \t 4000 \n "
2018-05-26 04:18:13 +02:00
" rei_immediate \t NOT REMOVE \t 4001 \n "
" rei_deferred \t NOT REMOVE \t 4002 \n "
2010-10-14 11:06:13 +02:00
" RegisterProduct \t \t 5000 \n "
" PublishFeatures \t \t 5100 \n "
" PublishProduct \t \t 5200 \n "
" InstallFinalize \t \t 6000 \n " ;
2018-05-26 04:18:13 +02:00
static const char rei_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \n "
" s72 \t i2 \t S64 \t S0 \n "
" CustomAction \t Action \n "
" rei_immediate \t 1 \t custom.dll \t rei_absent \n "
" rei_deferred \t 1025 \t custom.dll \t rei_present \n "
" uei_immediate \t 1 \t custom.dll \t rei_present \n "
" uei_deferred \t 1025 \t custom.dll \t rei_absent \n " ;
2014-02-24 22:00:55 +01:00
static const char rpi_file_dat [ ] =
" File \t Component_ \t FileName \t FileSize \t Version \t Language \t Attributes \t Sequence \n "
" s72 \t s72 \t l255 \t i4 \t S72 \t S20 \t I2 \t i2 \n "
" File \t File \n "
" progid.txt \t progid \t progid.txt \t 1000 \t \t \t 8192 \t 1 \n " ;
static const char rpi_feature_dat [ ] =
" Feature \t Feature_Parent \t Title \t Description \t Display \t Level \t Directory_ \t Attributes \n "
" s38 \t S38 \t L64 \t L255 \t I2 \t i2 \t S72 \t i2 \n "
" Feature \t Feature \n "
" progid \t \t \t progid feature \t 1 \t 2 \t MSITESTDIR \t 0 \n " ;
static const char rpi_feature_comp_dat [ ] =
" Feature_ \t Component_ \n "
" s38 \t s72 \n "
" FeatureComponents \t Feature_ \t Component_ \n "
" progid \t progid \n " ;
static const char rpi_component_dat [ ] =
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
" progid \t {89A98345-F8A1-422E-A48B-0250B5809F2D} \t MSITESTDIR \t 0 \t \t progid.txt \n " ;
static const char rpi_appid_dat [ ] =
" AppId \t RemoteServerName \t LocalService \t ServiceParameters \t DllSurrogate \t ActivateAtStorage \t RunAsInteractiveUser \n "
" s38 \t S255 \t S255 \t S255 \t S255 \t I2 \t I2 \n "
" AppId \t AppId \n "
" {CFCC3B38-E683-497D-9AB4-CB40AAFE307F} \t \t \t \t \t \t \n " ;
static const char rpi_class_dat [ ] =
" CLSID \t Context \t Component_ \t ProgId_Default \t Description \t AppId_ \t FileTypeMask \t Icon_ \t IconIndex \t DefInprocHandler \t Argument \t Feature_ \t Attributes \n "
" s38 \t s32 \t s72 \t S255 \t L255 \t S38 \t S255 \t S72 \t I2 \t S32 \t S255 \t s38 \t I2 \n "
" Class \t CLSID \t Context \t Component_ \n "
" {110913E7-86D1-4BF3-9922-BA103FCDDDFA} \t LocalServer \t progid \t Winetest.Class.1 \t description \t {CFCC3B38-E683-497D-9AB4-CB40AAFE307F} \t mask1;mask2 \t \t \t 2 \t \t progid \t \n "
" {904E6BC9-F57F-4412-B460-D40DE2F256E2} \t LocalServer \t progid \t Winetest.VerClass \t description \t {CFCC3B38-E683-497D-9AB4-CB40AAFE307F} \t mask1;mask2 \t \t \t 2 \t \t progid \t \n "
" {57C413FB-CA02-498A-81F6-7E769BDB7C97} \t LocalServer \t progid \t \t description \t {CFCC3B38-E683-497D-9AB4-CB40AAFE307F} \t mask1;mask2 \t \t \t 2 \t \t progid \t \n " ;
static const char rpi_extension_dat [ ] =
" Extension \t Component_ \t ProgId_ \t MIME_ \t Feature_ \n "
" s255 \t s72 \t S255 \t S64 \t s38 \n "
2014-02-27 11:03:48 +01:00
" Extension \t Extension \t Component_ \n "
" winetest \t progid \t Winetest.Extension \t \t progid \n " ;
static const char rpi_verb_dat [ ] =
" Extension_ \t Verb \t Sequence \t Command \t Argument \n "
" s255 \t s32 \t I2 \t L255 \t L255 \n "
" Verb \t Extension_ \t Verb \n "
" winetest \t Open \t 1 \t &Open \t /argument \n " ;
2014-02-24 22:00:55 +01:00
static const char rpi_progid_dat [ ] =
" ProgId \t ProgId_Parent \t Class_ \t Description \t Icon_ \t IconIndex \n "
" s255 \t S255 \t S38 \t L255 \t S72 \t I2 \n "
" ProgId \t ProgId \n "
" Winetest.Class.1 \t \t {110913E7-86D1-4BF3-9922-BA103FCDDDFA} \t description \t \t \n "
" Winetest.Class \t Winetest.Class.1 \t \t description \t \t \n "
" Winetest.Class.2 \t \t {110913E7-86D1-4BF3-9922-BA103FCDDDFA} \t description \t \t \n "
" Winetest.VerClass.1 \t \t {904E6BC9-F57F-4412-B460-D40DE2F256E2} \t description \t \t \n "
" Winetest.VerClass \t Winetest.VerClass.1 \t \t description \t \t \n "
" Winetest.NoProgIdClass.1 \t \t {57C413FB-CA02-498A-81F6-7E769BDB7C97} \t description \t \t \n "
" Winetest.NoProgIdClass \t Winetest.NoProgIdClass.1 \t \t description \t \t \n "
" Winetest.Orphaned \t \t \t description \t \t \n "
2014-02-27 11:03:48 +01:00
" Winetest.Orphaned2 \t \t \t description \t \t \n "
" Winetest.Extension \t \t \t description \t \t \n " ;
2014-02-24 22:00:55 +01:00
static const char rpi_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" LaunchConditions \t \t 100 \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" CostFinalize \t \t 1000 \n "
" InstallValidate \t \t 1400 \n "
" InstallInitialize \t \t 1500 \n "
" ProcessComponents \t \t 1600 \n "
" RemoveFiles \t \t 1700 \n "
" UnregisterClassInfo \t \t 3000 \n "
2014-02-27 11:03:48 +01:00
" UnregisterExtensionInfo \t \t 3200 \n "
2014-02-24 22:00:55 +01:00
" UnregisterProgIdInfo \t \t 3400 \n "
2018-05-29 04:07:52 +02:00
" upi_immediate \t REMOVE \t 3401 \n "
" upi_deferred \t REMOVE \t 3402 \n "
2014-02-27 11:03:48 +01:00
" InstallFiles \t \t 3600 \n "
2014-02-24 22:00:55 +01:00
" RegisterClassInfo \t \t 4000 \n "
2014-02-27 11:03:48 +01:00
" RegisterExtensionInfo \t \t 4200 \n "
2014-02-24 22:00:55 +01:00
" RegisterProgIdInfo \t \t 4400 \n "
2018-05-29 04:07:52 +02:00
" rpi_immediate \t NOT REMOVE \t 4401 \n "
" rpi_deferred \t NOT REMOVE \t 4402 \n "
2014-02-24 22:00:55 +01:00
" RegisterProduct \t \t 5000 \n "
" PublishFeatures \t \t 5100 \n "
" PublishProduct \t \t 5200 \n "
" InstallFinalize \t \t 6000 \n " ;
2018-05-29 04:07:52 +02:00
static const char rpi_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \n "
" s72 \t i2 \t S64 \t S0 \n "
" CustomAction \t Action \n "
" rpi_immediate \t 1 \t custom.dll \t rpi_absent \n "
" rpi_deferred \t 1025 \t custom.dll \t rpi_present \n "
" upi_immediate \t 1 \t custom.dll \t rpi_present \n "
" upi_deferred \t 1025 \t custom.dll \t rpi_absent \n " ;
2010-10-14 11:06:13 +02:00
static const char rmi_file_dat [ ] =
" File \t Component_ \t FileName \t FileSize \t Version \t Language \t Attributes \t Sequence \n "
" s72 \t s72 \t l255 \t i4 \t S72 \t S20 \t I2 \t i2 \n "
" File \t File \n "
" mime.txt \t mime \t mime.txt \t 1000 \t \t \t 8192 \t 1 \n " ;
static const char rmi_feature_dat [ ] =
" Feature \t Feature_Parent \t Title \t Description \t Display \t Level \t Directory_ \t Attributes \n "
" s38 \t S38 \t L64 \t L255 \t I2 \t i2 \t S72 \t i2 \n "
" Feature \t Feature \n "
" mime \t \t \t mime feature \t 1 \t 2 \t MSITESTDIR \t 0 \n " ;
static const char rmi_feature_comp_dat [ ] =
" Feature_ \t Component_ \n "
" s38 \t s72 \n "
" FeatureComponents \t Feature_ \t Component_ \n "
" mime \t mime \n " ;
static const char rmi_component_dat [ ] =
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
" mime \t {A1D630CE-13A7-4882-AFDD-148E2BBAFC6D} \t MSITESTDIR \t 0 \t \t mime.txt \n " ;
static const char rmi_extension_dat [ ] =
" Extension \t Component_ \t ProgId_ \t MIME_ \t Feature_ \n "
" s255 \t s72 \t S255 \t S64 \t s38 \n "
" Extension \t Extension \t Component_ \n "
" mime \t mime \t \t mime/type \t mime \n " ;
static const char rmi_verb_dat [ ] =
" Extension_ \t Verb \t Sequence \t Command \t Argument \n "
" s255 \t s32 \t I2 \t L255 \t L255 \n "
" Verb \t Extension_ \t Verb \n "
" mime \t Open \t 1 \t &Open \t /argument \n " ;
static const char rmi_mime_dat [ ] =
" ContentType \t Extension_ \t CLSID \n "
" s64 \t s255 \t S38 \n "
" MIME \t ContentType \n "
" mime/type \t mime \t \n " ;
static const char rmi_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" LaunchConditions \t \t 100 \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" CostFinalize \t \t 1000 \n "
" InstallValidate \t \t 1400 \n "
" InstallInitialize \t \t 1500 \n "
" ProcessComponents \t \t 1600 \n "
" RemoveFiles \t \t 1700 \n "
" InstallFiles \t \t 2000 \n "
" UnregisterExtensionInfo \t \t 3000 \n "
" UnregisterMIMEInfo \t \t 3500 \n "
2018-05-26 04:18:15 +02:00
" umi_immediate \t REMOVE \t 3501 \n "
" umi_deferred \t REMOVE \t 3502 \n "
2010-10-14 11:06:13 +02:00
" RegisterExtensionInfo \t \t 4000 \n "
" RegisterMIMEInfo \t \t 4500 \n "
2018-05-26 04:18:15 +02:00
" rmi_immediate \t NOT REMOVE \t 4501 \n "
" rmi_deferred \t NOT REMOVE \t 4502 \n "
2010-10-14 11:06:13 +02:00
" RegisterProduct \t \t 5000 \n "
" PublishFeatures \t \t 5100 \n "
" PublishProduct \t \t 5200 \n "
" InstallFinalize \t \t 6000 \n " ;
2018-05-26 04:18:15 +02:00
static const char rmi_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \n "
" s72 \t i2 \t S64 \t S0 \n "
" CustomAction \t Action \n "
" rmi_immediate \t 1 \t custom.dll \t rmi_absent \n "
" rmi_deferred \t 1025 \t custom.dll \t rmi_present \n "
" umi_immediate \t 1 \t custom.dll \t rmi_present \n "
" umi_deferred \t 1025 \t custom.dll \t rmi_absent \n " ;
2011-01-10 09:43:34 +01:00
static const char pa_file_dat [ ] =
" File \t Component_ \t FileName \t FileSize \t Version \t Language \t Attributes \t Sequence \n "
" s72 \t s72 \t l255 \t i4 \t S72 \t S20 \t I2 \t i2 \n "
" File \t File \n "
2018-09-04 02:17:56 +02:00
" fake_local.txt \t fake_local \t fake_local.txt \t 1000 \t \t \t 8192 \t 1 \n "
2011-01-10 09:43:34 +01:00
" win32.txt \t win32 \t win32.txt \t 1000 \t \t \t 8192 \t 1 \n "
" manifest.txt \t win32 \t manifest.txt \t 1000 \t \t \t 8192 \t 1 \n "
" win32_local.txt \t win32_local \t win32_local.txt \t 1000 \t \t \t 8192 \t 1 \n "
" manifest_local.txt \t win32_local \t manifest_local.txt \t 1000 \t \t \t 8192 \t 1 \n "
" dotnet.txt \t dotnet \t dotnet.txt \t 1000 \t \t \t 8192 \t 1 \n "
" dotnet_local.txt \t dotnet_local \t dotnet_local.txt \t 1000 \t \t \t 8192 \t 1 \n "
" application_win32.txt \t win32_local \t application_win32.txt \t 1000 \t \t \t 8192 \t 1 \n "
" application_dotnet.txt \t dotnet_local \t application_dotnet.txt \t 1000 \t \t \t 8192 \t 1 \n " ;
static const char pa_feature_dat [ ] =
" Feature \t Feature_Parent \t Title \t Description \t Display \t Level \t Directory_ \t Attributes \n "
" s38 \t S38 \t L64 \t L255 \t I2 \t i2 \t S72 \t i2 \n "
" Feature \t Feature \n "
" assembly \t \t \t assembly feature \t 1 \t 2 \t MSITESTDIR \t 0 \n " ;
static const char pa_feature_comp_dat [ ] =
" Feature_ \t Component_ \n "
" s38 \t s72 \n "
" FeatureComponents \t Feature_ \t Component_ \n "
2018-09-04 02:17:56 +02:00
" assembly \t fake_local \n "
2011-01-10 09:43:34 +01:00
" assembly \t win32 \n "
" assembly \t win32_local \n "
" assembly \t dotnet \n "
" assembly \t dotnet_local \n " ;
static const char pa_component_dat [ ] =
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
2018-09-04 02:17:56 +02:00
" fake_local \t {F515549D-7E61-425D-AAC1-9BEF2E066D06} \t MSITESTDIR \t 0 \t \t fake_local.txt \n "
2011-01-10 09:43:34 +01:00
" win32 \t {F515549E-7E61-425D-AAC1-9BEF2E066D06} \t MSITESTDIR \t 0 \t \t win32.txt \n "
" win32_local \t {D34D3FBA-6789-4E57-AD1A-1281297DC201} \t MSITESTDIR \t 0 \t \t win32_local.txt \n "
" dotnet \t {8943164F-2B31-4C09-A894-493A8CBDE0A4} \t MSITESTDIR \t 0 \t \t dotnet.txt \n "
" dotnet_local \t {4E8567E8-8EAE-4E36-90F1-B99D33C663F8} \t MSITESTDIR \t 0 \t \t dotnet_local.txt \n " ;
static const char pa_msi_assembly_dat [ ] =
" Component_ \t Feature_ \t File_Manifest \t File_Application \t Attributes \n "
" s72 \t s38 \t S72 \t S72 \t I2 \n "
" MsiAssembly \t Component_ \n "
2018-09-04 02:17:56 +02:00
" fake_local \t assembly \t \t nonexistent.txt \t 0 \n "
2011-01-10 09:43:34 +01:00
" win32 \t assembly \t manifest.txt \t \t 1 \n "
" win32_local \t assembly \t manifest_local.txt \t application_win32.txt \t 1 \n "
" dotnet \t assembly \t \t \t 0 \n "
" dotnet_local \t assembly \t \t application_dotnet.txt \t 0 \n " ;
static const char pa_msi_assembly_name_dat [ ] =
" Component_ \t Name \t Value \n "
" s72 \t s255 \t s255 \n "
" MsiAssemblyName \t Component_ \t Name \n "
2018-09-04 02:17:56 +02:00
" fake_local \t Name \t Wine.Fake.Application.Assembly \n "
" fake_local \t processorArchitecture \t x86 \n "
" fake_local \t publicKeyToken \t abcdef0123456789 \n "
" fake_local \t type \t win32 \n "
" fake_local \t version \t 1.0.0.0 \n "
2011-01-10 09:43:34 +01:00
" win32 \t Name \t Wine.Win32.Assembly \n "
" win32 \t processorArchitecture \t x86 \n "
" win32 \t publicKeyToken \t abcdef0123456789 \n "
" win32 \t type \t win32 \n "
" win32 \t version \t 1.0.0.0 \n "
" win32_local \t Name \t Wine.Win32.Local.Assembly \n "
" win32_local \t processorArchitecture \t x86 \n "
" win32_local \t publicKeyToken \t abcdef0123456789 \n "
" win32_local \t type \t win32 \n "
" win32_local \t version \t 1.0.0.0 \n "
" dotnet \t Name \t Wine.Dotnet.Assembly \n "
" dotnet \t processorArchitecture \t MSIL \n "
" dotnet \t publicKeyToken \t abcdef0123456789 \n "
" dotnet \t culture \t neutral \n "
" dotnet \t version \t 1.0.0.0 \n "
" dotnet_local \t Name \t Wine.Dotnet.Local.Assembly \n "
" dotnet_local \t processorArchitecture \t MSIL \n "
" dotnet_local \t publicKeyToken \t abcdef0123456789 \n "
" dotnet_local \t culture \t neutral \n "
" dotnet_local \t version \t 1.0.0.0 \n " ;
static const char pa_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" LaunchConditions \t \t 100 \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" CostFinalize \t \t 1000 \n "
" InstallValidate \t \t 1400 \n "
" InstallInitialize \t \t 1500 \n "
" ProcessComponents \t \t 1600 \n "
" MsiPublishAssemblies \t \t 3000 \n "
2018-05-25 02:14:10 +02:00
" pa_immediate \t NOT REMOVE AND NOT ALLUSERS \t 3001 \n "
" pa_deferred \t NOT REMOVE AND NOT ALLUSERS \t 3002 \n "
2011-01-10 09:43:34 +01:00
" MsiUnpublishAssemblies \t \t 4000 \n "
2018-05-25 02:14:10 +02:00
" ua_immediate \t REMOVE AND NOT ALLUSERS \t 4001 \n "
" ua_deferred \t REMOVE AND NOT ALLUSERS \t 4002 \n "
2011-01-10 09:43:34 +01:00
" RegisterProduct \t \t 5000 \n "
" PublishFeatures \t \t 5100 \n "
" PublishProduct \t \t 5200 \n "
2018-05-25 02:14:13 +02:00
" UnpublishFeatures \t \t 5300 \n "
2011-01-10 09:43:34 +01:00
" InstallFinalize \t \t 6000 \n " ;
2018-05-25 02:14:10 +02:00
static const char pa_custom_action_dat [ ] =
" Action \t Type \t Source \t Target \n "
" s72 \t i2 \t S64 \t S0 \n "
" CustomAction \t Action \n "
" pa_immediate \t 1 \t custom.dll \t pa_absent \n "
" pa_deferred \t 1025 \t custom.dll \t pa_present \n "
" ua_immediate \t 1 \t custom.dll \t pa_present \n "
" ua_deferred \t 1025 \t custom.dll \t pa_absent \n " ;
2012-07-31 12:25:42 +02:00
static const char rep_file_dat [ ] =
" File \t Component_ \t FileName \t FileSize \t Version \t Language \t Attributes \t Sequence \n "
" s72 \t s72 \t l255 \t i4 \t S72 \t S20 \t I2 \t i2 \n "
" File \t File \n "
" rep.txt \t rep \t rep.txt \t 1000 \t \t \t 8192 \t 1 \n " ;
static const char rep_feature_dat [ ] =
" Feature \t Feature_Parent \t Title \t Description \t Display \t Level \t Directory_ \t Attributes \n "
" s38 \t S38 \t L64 \t L255 \t I2 \t i2 \t S72 \t i2 \n "
" Feature \t Feature \n "
" rep \t \t \t rep feature \t 1 \t 2 \t MSITESTDIR \t 0 \n " ;
static const char rep_feature_comp_dat [ ] =
" Feature_ \t Component_ \n "
" s38 \t s72 \n "
" FeatureComponents \t Feature_ \t Component_ \n "
" rep \t rep \n " ;
static const char rep_component_dat [ ] =
" Component \t ComponentId \t Directory_ \t Attributes \t Condition \t KeyPath \n "
" s72 \t S38 \t s72 \t i2 \t S255 \t S72 \n "
" Component \t Component \n "
" rep \t {A24FAF2A-3B2E-41EF-AA78-331542E1A29D} \t MSITESTDIR \t 0 \t \t rep.txt \n " ;
static const char rep_upgrade_dat [ ] =
" UpgradeCode \t VersionMin \t VersionMax \t Language \t Attributes \t Remove \t ActionProperty \n "
" s38 \t S20 \t S20 \t S255 \t i4 \t S255 \t s72 \n "
" Upgrade \t UpgradeCode \t VersionMin \t VersionMax \t Language \t Attributes \n "
" {2967C1CC-34D4-42EE-8D96-CD6836F192BF} \t \t \t \t 256 \t \t PRODUCT \n " ;
static const char rep_property_dat [ ] =
" Property \t Value \n "
" s72 \t l0 \n "
" Property \t Property \n "
" HASUIRUN \t 0 \n "
" INSTALLLEVEL \t 3 \n "
" InstallMode \t Typical \n "
" Manufacturer \t Wine \n "
" PIDTemplate \t ###-####### \n "
" ProductCode \t {1699F0BB-0B61-4A89-AFE4-CFD60DFD76F3} \n "
" ProductLanguage \t 1033 \n "
" ProductName \t MSITEST \n "
" ProductVersion \t 1.1.1 \n "
" UpgradeCode \t {2967C1CC-34D4-42EE-8D96-CD6836F192BF} \n "
" PRODUCT \t 2F41860D-7B4C-4DA7-BED9-B64F26594C56 \n "
" MSIFASTINSTALL \t 1 \n " ;
static const char rep_install_exec_seq_dat [ ] =
" Action \t Condition \t Sequence \n "
" s72 \t S255 \t I2 \n "
" InstallExecuteSequence \t Action \n "
" FindRelatedProducts \t \t 100 \n "
" CostInitialize \t \t 800 \n "
" FileCost \t \t 900 \n "
" CostFinalize \t \t 1000 \n "
" InstallValidate \t \t 1400 \n "
" RemoveExistingProducts \t \t 1499 \n "
" InstallInitialize \t \t 1500 \n "
" ProcessComponents \t \t 1600 \n "
" RemoveFiles \t \t 1700 \n "
" InstallFiles \t \t 2000 \n "
" UnregisterExtensionInfo \t \t 3000 \n "
" UnregisterMIMEInfo \t \t 3500 \n "
" RegisterExtensionInfo \t \t 4000 \n "
" RegisterMIMEInfo \t \t 4500 \n "
" RegisterProduct \t \t 5000 \n "
" PublishFeatures \t \t 5100 \n "
" PublishProduct \t \t 5200 \n "
" InstallFinalize \t \t 6000 \n " ;
2010-10-14 11:06:13 +02:00
static const msi_table env_tables [ ] =
{
ADD_TABLE ( component ) ,
ADD_TABLE ( directory ) ,
ADD_TABLE ( feature ) ,
ADD_TABLE ( feature_comp ) ,
ADD_TABLE ( file ) ,
2018-05-31 03:47:33 +02:00
ADD_TABLE ( env_install_exec_seq ) ,
2018-05-31 03:47:34 +02:00
ADD_TABLE ( env_custom_action ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( media ) ,
ADD_TABLE ( property ) ,
2018-05-31 03:47:33 +02:00
ADD_TABLE ( env_environment )
2010-10-14 11:06:13 +02:00
} ;
static const msi_table pp_tables [ ] =
{
ADD_TABLE ( pp_component ) ,
ADD_TABLE ( directory ) ,
ADD_TABLE ( rof_feature ) ,
ADD_TABLE ( rof_feature_comp ) ,
ADD_TABLE ( rof_file ) ,
ADD_TABLE ( pp_install_exec_seq ) ,
2018-05-25 02:14:13 +02:00
ADD_TABLE ( pp_custom_action ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( rof_media ) ,
ADD_TABLE ( property ) ,
} ;
static const msi_table ppc_tables [ ] =
{
ADD_TABLE ( ppc_component ) ,
ADD_TABLE ( directory ) ,
ADD_TABLE ( rof_feature ) ,
ADD_TABLE ( ppc_feature_comp ) ,
ADD_TABLE ( ppc_file ) ,
ADD_TABLE ( pp_install_exec_seq ) ,
2018-05-25 02:14:11 +02:00
ADD_TABLE ( pp_custom_action ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( ppc_media ) ,
ADD_TABLE ( property ) ,
} ;
static const msi_table rem_tables [ ] =
{
ADD_TABLE ( rem_component ) ,
ADD_TABLE ( directory ) ,
ADD_TABLE ( rof_feature ) ,
ADD_TABLE ( rem_feature_comp ) ,
ADD_TABLE ( rem_file ) ,
ADD_TABLE ( rem_install_exec_seq ) ,
ADD_TABLE ( rof_media ) ,
ADD_TABLE ( property ) ,
ADD_TABLE ( rem_remove_files ) ,
} ;
static const msi_table mov_tables [ ] =
{
ADD_TABLE ( cwd_component ) ,
ADD_TABLE ( directory ) ,
ADD_TABLE ( rof_feature ) ,
ADD_TABLE ( ci2_feature_comp ) ,
ADD_TABLE ( ci2_file ) ,
2018-05-23 01:39:24 +02:00
ADD_TABLE ( mov_install_exec_seq ) ,
ADD_TABLE ( mov_custom_action ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( rof_media ) ,
ADD_TABLE ( property ) ,
ADD_TABLE ( mov_move_file ) ,
} ;
static const msi_table df_tables [ ] =
{
ADD_TABLE ( rof_component ) ,
ADD_TABLE ( df_directory ) ,
ADD_TABLE ( rof_feature ) ,
ADD_TABLE ( rof_feature_comp ) ,
ADD_TABLE ( rof_file ) ,
ADD_TABLE ( install_exec_seq ) ,
ADD_TABLE ( rof_media ) ,
ADD_TABLE ( property ) ,
ADD_TABLE ( df_duplicate_file ) ,
} ;
static const msi_table wrv_tables [ ] =
{
ADD_TABLE ( wrv_component ) ,
ADD_TABLE ( directory ) ,
2018-01-22 10:19:06 +01:00
ADD_TABLE ( wrv_feature ) ,
ADD_TABLE ( wrv_feature_comp ) ,
2018-06-02 04:48:21 +02:00
ADD_TABLE ( wrv_install_exec_seq ) ,
2018-06-02 04:48:22 +02:00
ADD_TABLE ( wrv_custom_action ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( property ) ,
2018-06-02 04:48:21 +02:00
ADD_TABLE ( media ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( wrv_registry ) ,
2018-06-02 04:48:21 +02:00
ADD_TABLE ( wrv_remove_registry ) ,
2010-10-14 11:06:13 +02:00
} ;
static const msi_table cf_tables [ ] =
{
2010-11-26 14:03:31 +01:00
ADD_TABLE ( cf_component ) ,
ADD_TABLE ( cf_directory ) ,
ADD_TABLE ( cf_feature ) ,
ADD_TABLE ( cf_feature_comp ) ,
ADD_TABLE ( cf_file ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( cf_create_folders ) ,
ADD_TABLE ( cf_install_exec_seq ) ,
2018-05-18 05:26:08 +02:00
ADD_TABLE ( cf_custom_action ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( media ) ,
ADD_TABLE ( property )
} ;
static const msi_table sss_tables [ ] =
{
ADD_TABLE ( component ) ,
ADD_TABLE ( directory ) ,
ADD_TABLE ( feature ) ,
ADD_TABLE ( feature_comp ) ,
ADD_TABLE ( file ) ,
ADD_TABLE ( sss_install_exec_seq ) ,
ADD_TABLE ( sss_service_control ) ,
2018-05-18 05:26:12 +02:00
ADD_TABLE ( sss_custom_action ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( media ) ,
ADD_TABLE ( property )
} ;
static const msi_table sds_tables [ ] =
{
ADD_TABLE ( component ) ,
ADD_TABLE ( directory ) ,
ADD_TABLE ( feature ) ,
ADD_TABLE ( feature_comp ) ,
ADD_TABLE ( file ) ,
ADD_TABLE ( sds_install_exec_seq ) ,
2018-05-18 05:26:10 +02:00
ADD_TABLE ( sds_custom_action ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( service_control ) ,
ADD_TABLE ( service_install ) ,
ADD_TABLE ( media ) ,
ADD_TABLE ( property )
} ;
2014-02-21 16:52:12 +01:00
static const msi_table sis_tables [ ] =
{
ADD_TABLE ( component ) ,
ADD_TABLE ( directory ) ,
ADD_TABLE ( feature ) ,
ADD_TABLE ( feature_comp ) ,
ADD_TABLE ( file ) ,
2018-05-18 05:26:11 +02:00
ADD_TABLE ( sis_install_exec_seq ) ,
ADD_TABLE ( sis_custom_action ) ,
2014-02-21 16:52:12 +01:00
ADD_TABLE ( service_install2 ) ,
ADD_TABLE ( media ) ,
ADD_TABLE ( property )
} ;
2010-10-14 11:06:13 +02:00
static const msi_table sr_tables [ ] =
{
2018-05-30 10:22:26 +02:00
ADD_TABLE ( sr_component ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( directory ) ,
2018-05-30 10:22:26 +02:00
ADD_TABLE ( sr_feature ) ,
ADD_TABLE ( sr_feature_comp ) ,
ADD_TABLE ( sr_file ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( sr_selfreg ) ,
ADD_TABLE ( sr_install_exec_seq ) ,
2018-05-30 10:22:27 +02:00
ADD_TABLE ( sr_custom_action ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( media ) ,
ADD_TABLE ( property )
} ;
static const msi_table font_tables [ ] =
{
ADD_TABLE ( font_component ) ,
ADD_TABLE ( directory ) ,
ADD_TABLE ( font_feature ) ,
ADD_TABLE ( font_feature_comp ) ,
ADD_TABLE ( font_file ) ,
ADD_TABLE ( font ) ,
ADD_TABLE ( font_install_exec_seq ) ,
2018-05-26 04:18:14 +02:00
ADD_TABLE ( font_custom_action ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( font_media ) ,
ADD_TABLE ( property )
} ;
static const msi_table vp_tables [ ] =
{
ADD_TABLE ( component ) ,
ADD_TABLE ( directory ) ,
ADD_TABLE ( feature ) ,
ADD_TABLE ( feature_comp ) ,
ADD_TABLE ( file ) ,
ADD_TABLE ( vp_custom_action ) ,
ADD_TABLE ( vp_install_exec_seq ) ,
ADD_TABLE ( media ) ,
ADD_TABLE ( vp_property )
} ;
static const msi_table odbc_tables [ ] =
{
ADD_TABLE ( odbc_component ) ,
ADD_TABLE ( directory ) ,
ADD_TABLE ( odbc_feature ) ,
ADD_TABLE ( odbc_feature_comp ) ,
ADD_TABLE ( odbc_file ) ,
ADD_TABLE ( odbc_driver ) ,
ADD_TABLE ( odbc_translator ) ,
ADD_TABLE ( odbc_datasource ) ,
ADD_TABLE ( odbc_install_exec_seq ) ,
2018-05-19 05:00:58 +02:00
ADD_TABLE ( odbc_custom_action ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( odbc_media ) ,
ADD_TABLE ( property )
} ;
static const msi_table tl_tables [ ] =
{
ADD_TABLE ( tl_component ) ,
ADD_TABLE ( directory ) ,
ADD_TABLE ( tl_feature ) ,
ADD_TABLE ( tl_feature_comp ) ,
ADD_TABLE ( tl_file ) ,
ADD_TABLE ( tl_typelib ) ,
ADD_TABLE ( tl_install_exec_seq ) ,
2018-05-30 10:22:25 +02:00
ADD_TABLE ( tl_custom_action ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( media ) ,
ADD_TABLE ( property )
} ;
static const msi_table crs_tables [ ] =
{
ADD_TABLE ( crs_component ) ,
ADD_TABLE ( directory ) ,
ADD_TABLE ( crs_feature ) ,
ADD_TABLE ( crs_feature_comp ) ,
ADD_TABLE ( crs_file ) ,
ADD_TABLE ( crs_shortcut ) ,
ADD_TABLE ( crs_install_exec_seq ) ,
2018-05-18 05:26:09 +02:00
ADD_TABLE ( crs_custom_action ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( media ) ,
ADD_TABLE ( property )
} ;
static const msi_table pub_tables [ ] =
{
ADD_TABLE ( directory ) ,
ADD_TABLE ( pub_component ) ,
ADD_TABLE ( pub_feature ) ,
ADD_TABLE ( pub_feature_comp ) ,
ADD_TABLE ( pub_file ) ,
ADD_TABLE ( pub_publish_component ) ,
ADD_TABLE ( pub_install_exec_seq ) ,
2018-05-25 02:14:12 +02:00
ADD_TABLE ( pub_custom_action ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( media ) ,
ADD_TABLE ( property )
} ;
static const msi_table rd_tables [ ] =
{
ADD_TABLE ( directory ) ,
ADD_TABLE ( rd_component ) ,
ADD_TABLE ( rd_feature ) ,
ADD_TABLE ( rd_feature_comp ) ,
ADD_TABLE ( rd_file ) ,
ADD_TABLE ( rd_duplicate_file ) ,
ADD_TABLE ( rd_install_exec_seq ) ,
2018-05-19 05:00:53 +02:00
ADD_TABLE ( rd_custom_action ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( media ) ,
ADD_TABLE ( property )
} ;
static const msi_table frp_tables [ ] =
{
ADD_TABLE ( directory ) ,
ADD_TABLE ( frp_component ) ,
ADD_TABLE ( frp_feature ) ,
ADD_TABLE ( frp_feature_comp ) ,
ADD_TABLE ( frp_file ) ,
ADD_TABLE ( frp_upgrade ) ,
ADD_TABLE ( frp_custom_action ) ,
ADD_TABLE ( frp_install_exec_seq ) ,
ADD_TABLE ( media ) ,
ADD_TABLE ( property )
} ;
2018-05-31 03:47:35 +02:00
static const msi_table ini_tables [ ] =
2010-10-14 11:06:13 +02:00
{
ADD_TABLE ( directory ) ,
2018-05-31 03:47:35 +02:00
ADD_TABLE ( ini_component ) ,
ADD_TABLE ( ini_feature ) ,
ADD_TABLE ( ini_feature_comp ) ,
ADD_TABLE ( ini_file ) ,
ADD_TABLE ( ini_ini_file ) ,
ADD_TABLE ( ini_remove_ini_file ) ,
ADD_TABLE ( ini_install_exec_seq ) ,
2018-05-31 03:47:36 +02:00
ADD_TABLE ( ini_custom_action ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( media ) ,
ADD_TABLE ( property )
} ;
static const msi_table rci_tables [ ] =
{
ADD_TABLE ( directory ) ,
ADD_TABLE ( rci_component ) ,
ADD_TABLE ( rci_feature ) ,
ADD_TABLE ( rci_feature_comp ) ,
ADD_TABLE ( rci_file ) ,
ADD_TABLE ( rci_appid ) ,
ADD_TABLE ( rci_class ) ,
ADD_TABLE ( rci_install_exec_seq ) ,
2018-05-26 04:18:12 +02:00
ADD_TABLE ( rci_custom_action ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( media ) ,
ADD_TABLE ( property )
} ;
static const msi_table rei_tables [ ] =
{
ADD_TABLE ( directory ) ,
ADD_TABLE ( rei_component ) ,
ADD_TABLE ( rei_feature ) ,
ADD_TABLE ( rei_feature_comp ) ,
ADD_TABLE ( rei_file ) ,
ADD_TABLE ( rei_extension ) ,
ADD_TABLE ( rei_verb ) ,
ADD_TABLE ( rei_progid ) ,
ADD_TABLE ( rei_install_exec_seq ) ,
2018-05-26 04:18:13 +02:00
ADD_TABLE ( rei_custom_action ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( media ) ,
ADD_TABLE ( property )
} ;
2014-02-24 22:00:55 +01:00
static const msi_table rpi_tables [ ] =
{
ADD_TABLE ( directory ) ,
ADD_TABLE ( rpi_component ) ,
ADD_TABLE ( rpi_feature ) ,
ADD_TABLE ( rpi_feature_comp ) ,
ADD_TABLE ( rpi_file ) ,
ADD_TABLE ( rpi_appid ) ,
ADD_TABLE ( rpi_class ) ,
ADD_TABLE ( rpi_extension ) ,
2014-02-27 11:03:48 +01:00
ADD_TABLE ( rpi_verb ) ,
2014-02-24 22:00:55 +01:00
ADD_TABLE ( rpi_progid ) ,
ADD_TABLE ( rpi_install_exec_seq ) ,
2018-05-29 04:07:52 +02:00
ADD_TABLE ( rpi_custom_action ) ,
2014-02-24 22:00:55 +01:00
ADD_TABLE ( media ) ,
ADD_TABLE ( property )
} ;
2010-10-14 11:06:13 +02:00
static const msi_table rmi_tables [ ] =
{
ADD_TABLE ( directory ) ,
ADD_TABLE ( rmi_component ) ,
ADD_TABLE ( rmi_feature ) ,
ADD_TABLE ( rmi_feature_comp ) ,
ADD_TABLE ( rmi_file ) ,
ADD_TABLE ( rmi_extension ) ,
ADD_TABLE ( rmi_verb ) ,
ADD_TABLE ( rmi_mime ) ,
ADD_TABLE ( rmi_install_exec_seq ) ,
2018-05-26 04:18:15 +02:00
ADD_TABLE ( rmi_custom_action ) ,
2010-10-14 11:06:13 +02:00
ADD_TABLE ( media ) ,
ADD_TABLE ( property )
} ;
2011-01-10 09:43:34 +01:00
static const msi_table pa_tables [ ] =
{
ADD_TABLE ( directory ) ,
ADD_TABLE ( pa_component ) ,
ADD_TABLE ( pa_feature ) ,
ADD_TABLE ( pa_feature_comp ) ,
ADD_TABLE ( pa_file ) ,
ADD_TABLE ( pa_msi_assembly ) ,
ADD_TABLE ( pa_msi_assembly_name ) ,
ADD_TABLE ( pa_install_exec_seq ) ,
2018-05-25 02:14:10 +02:00
ADD_TABLE ( pa_custom_action ) ,
2011-01-10 09:43:34 +01:00
ADD_TABLE ( media ) ,
ADD_TABLE ( property )
} ;
2012-07-31 12:25:42 +02:00
static const msi_table rep_tables [ ] =
{
ADD_TABLE ( directory ) ,
ADD_TABLE ( rep_component ) ,
ADD_TABLE ( rep_feature ) ,
ADD_TABLE ( rep_feature_comp ) ,
ADD_TABLE ( rep_file ) ,
ADD_TABLE ( rep_upgrade ) ,
ADD_TABLE ( rep_property ) ,
ADD_TABLE ( rep_install_exec_seq ) ,
ADD_TABLE ( media )
} ;
2010-10-14 11:06:13 +02:00
/* cabinet definitions */
/* make the max size large so there is only one cab file */
# define MEDIA_SIZE 0x7FFFFFFF
static void init_functionpointers ( void )
{
HMODULE hmsi = GetModuleHandleA ( " msi.dll " ) ;
HMODULE hadvapi32 = GetModuleHandleA ( " advapi32.dll " ) ;
HMODULE hkernel32 = GetModuleHandleA ( " kernel32.dll " ) ;
2018-09-26 15:17:18 +02:00
HMODULE hsrclient = LoadLibraryA ( " srclient.dll " ) ;
2010-10-14 11:06:13 +02:00
# define GET_PROC(mod, func) \
p # # func = ( void * ) GetProcAddress ( mod , # func ) ; \
if ( ! p # # func ) \
trace ( " GetProcAddress(%s) failed \n " , # func ) ;
GET_PROC ( hmsi , MsiQueryComponentStateA ) ;
GET_PROC ( hmsi , MsiSourceListEnumSourcesA ) ;
GET_PROC ( hmsi , MsiSourceListGetInfoA ) ;
GET_PROC ( hmsi , MsiGetComponentPathExA ) ;
2013-01-09 11:44:19 +01:00
GET_PROC ( hmsi , MsiQueryFeatureStateExA ) ;
2010-10-14 11:06:13 +02:00
GET_PROC ( hadvapi32 , RegDeleteKeyExA )
GET_PROC ( hkernel32 , IsWow64Process )
GET_PROC ( hsrclient , SRRemoveRestorePoint ) ;
GET_PROC ( hsrclient , SRSetRestorePointA ) ;
# undef GET_PROC
}
2011-03-30 12:30:35 +02:00
static char * get_user_sid ( void )
2010-10-14 11:06:13 +02:00
{
HANDLE token ;
2011-03-30 12:30:35 +02:00
DWORD size = 0 ;
TOKEN_USER * user ;
char * usersid = NULL ;
2010-10-14 11:06:13 +02:00
2011-03-30 12:30:35 +02:00
OpenProcessToken ( GetCurrentProcess ( ) , TOKEN_QUERY , & token ) ;
GetTokenInformation ( token , TokenUser , NULL , size , & size ) ;
user = HeapAlloc ( GetProcessHeap ( ) , 0 , size ) ;
GetTokenInformation ( token , TokenUser , user , size , & size ) ;
2018-09-26 15:17:18 +02:00
ConvertSidToStringSidA ( user - > User . Sid , & usersid ) ;
2011-03-30 12:30:35 +02:00
HeapFree ( GetProcessHeap ( ) , 0 , user ) ;
2010-10-14 11:06:13 +02:00
CloseHandle ( token ) ;
2011-03-30 12:30:35 +02:00
return usersid ;
2010-10-14 11:06:13 +02:00
}
static void create_test_files ( void )
{
CreateDirectoryA ( " msitest " , NULL ) ;
create_file ( " msitest \\ one.txt " , 100 ) ;
CreateDirectoryA ( " msitest \\ first " , NULL ) ;
create_file ( " msitest \\ first \\ two.txt " , 100 ) ;
CreateDirectoryA ( " msitest \\ second " , NULL ) ;
create_file ( " msitest \\ second \\ three.txt " , 100 ) ;
create_file ( " four.txt " , 100 ) ;
create_file ( " five.txt " , 100 ) ;
create_cab_file ( " msitest.cab " , MEDIA_SIZE , " four.txt \0 five.txt \0 " ) ;
create_file ( " msitest \\ filename " , 100 ) ;
create_file ( " msitest \\ service.exe " , 100 ) ;
2012-03-13 12:51:26 +01:00
create_file ( " msitest \\ service2.exe " , 100 ) ;
2010-10-14 11:06:13 +02:00
DeleteFileA ( " four.txt " ) ;
DeleteFileA ( " five.txt " ) ;
}
static void delete_test_files ( void )
{
DeleteFileA ( " msitest.msi " ) ;
DeleteFileA ( " msitest.cab " ) ;
DeleteFileA ( " msitest \\ second \\ three.txt " ) ;
DeleteFileA ( " msitest \\ first \\ two.txt " ) ;
DeleteFileA ( " msitest \\ one.txt " ) ;
DeleteFileA ( " msitest \\ service.exe " ) ;
2012-03-13 12:51:26 +01:00
DeleteFileA ( " msitest \\ service2.exe " ) ;
2010-10-14 11:06:13 +02:00
DeleteFileA ( " msitest \\ filename " ) ;
RemoveDirectoryA ( " msitest \\ second " ) ;
RemoveDirectoryA ( " msitest \\ first " ) ;
RemoveDirectoryA ( " msitest " ) ;
}
static BOOL notify_system_change ( DWORD event_type , STATEMGRSTATUS * status )
{
RESTOREPOINTINFOA spec ;
spec . dwEventType = event_type ;
spec . dwRestorePtType = APPLICATION_INSTALL ;
spec . llSequenceNumber = status - > llSequenceNumber ;
lstrcpyA ( spec . szDescription , " msitest restore point " ) ;
return pSRSetRestorePointA ( & spec , status ) ;
}
static void remove_restore_point ( DWORD seq_number )
{
DWORD res ;
res = pSRRemoveRestorePoint ( seq_number ) ;
if ( res ! = ERROR_SUCCESS )
trace ( " Failed to remove the restore point : %08x \n " , res ) ;
}
static LONG delete_key ( HKEY key , LPCSTR subkey , REGSAM access )
{
if ( pRegDeleteKeyExA )
return pRegDeleteKeyExA ( key , subkey , access , 0 ) ;
return RegDeleteKeyA ( key , subkey ) ;
}
static void delete_pfmsitest_files ( void )
{
2013-10-15 13:04:45 +02:00
SHFILEOPSTRUCTA shfl ;
2010-10-14 11:06:13 +02:00
CHAR path [ MAX_PATH + 11 ] ;
lstrcpyA ( path , PROG_FILES_DIR ) ;
lstrcatA ( path , " \\ msitest \\ * " ) ;
path [ strlen ( path ) + 1 ] = ' \0 ' ;
shfl . hwnd = NULL ;
shfl . wFunc = FO_DELETE ;
shfl . pFrom = path ;
shfl . pTo = NULL ;
shfl . fFlags = FOF_FILESONLY | FOF_NOCONFIRMATION | FOF_NORECURSION | FOF_SILENT | FOF_NOERRORUI ;
2013-10-15 13:04:45 +02:00
SHFileOperationA ( & shfl ) ;
2010-10-14 11:06:13 +02:00
lstrcpyA ( path , PROG_FILES_DIR ) ;
lstrcatA ( path , " \\ msitest " ) ;
RemoveDirectoryA ( path ) ;
}
static void check_reg_str ( HKEY prodkey , LPCSTR name , LPCSTR expected , BOOL bcase , DWORD line )
{
char val [ MAX_PATH ] ;
DWORD size , type ;
LONG res ;
size = MAX_PATH ;
val [ 0 ] = ' \0 ' ;
res = RegQueryValueExA ( prodkey , name , NULL , & type , ( LPBYTE ) val , & size ) ;
if ( res ! = ERROR_SUCCESS | |
( type ! = REG_SZ & & type ! = REG_EXPAND_SZ & & type ! = REG_MULTI_SZ ) )
{
ok_ ( __FILE__ , line ) ( FALSE , " Key doesn't exist or wrong type \n " ) ;
return ;
}
if ( ! expected )
2014-11-05 10:53:56 +01:00
ok_ ( __FILE__ , line ) ( ! val [ 0 ] , " Expected empty string, got %s \n " , val ) ;
2010-10-14 11:06:13 +02:00
else
{
if ( bcase )
ok_ ( __FILE__ , line ) ( ! lstrcmpA ( val , expected ) , " Expected %s, got %s \n " , expected , val ) ;
else
ok_ ( __FILE__ , line ) ( ! lstrcmpiA ( val , expected ) , " Expected %s, got %s \n " , expected , val ) ;
}
}
2018-06-02 04:48:21 +02:00
static void check_reg_multi ( HKEY prodkey , const char * name , const char * expect , DWORD line )
{
char val [ MAX_PATH ] ;
DWORD size , type ;
LONG res ;
size = MAX_PATH ;
val [ 0 ] = ' \0 ' ;
res = RegQueryValueExA ( prodkey , name , NULL , & type , ( BYTE * ) val , & size ) ;
if ( res ! = ERROR_SUCCESS | | type ! = REG_MULTI_SZ )
{
ok_ ( __FILE__ , line ) ( FALSE , " Key doesn't exist or wrong type \n " ) ;
return ;
}
ok_ ( __FILE__ , line ) ( ! memcmp ( val , expect , size ) , " wrong data \n " ) ;
}
2010-10-14 11:06:13 +02:00
static void check_reg_dword ( HKEY prodkey , LPCSTR name , DWORD expected , DWORD line )
{
DWORD val , size , type ;
LONG res ;
size = sizeof ( DWORD ) ;
res = RegQueryValueExA ( prodkey , name , NULL , & type , ( LPBYTE ) & val , & size ) ;
if ( res ! = ERROR_SUCCESS | | type ! = REG_DWORD )
{
ok_ ( __FILE__ , line ) ( FALSE , " Key doesn't exist or wrong type \n " ) ;
return ;
}
ok_ ( __FILE__ , line ) ( val = = expected , " Expected %d, got %d \n " , expected , val ) ;
}
# define CHECK_REG_STR(prodkey, name, expected) \
check_reg_str ( prodkey , name , expected , TRUE , __LINE__ ) ;
# define CHECK_DEL_REG_STR(prodkey, name, expected) \
2012-10-24 02:05:15 +02:00
do { \
check_reg_str ( prodkey , name , expected , TRUE , __LINE__ ) ; \
RegDeleteValueA ( prodkey , name ) ; \
} while ( 0 )
2010-10-14 11:06:13 +02:00
# define CHECK_REG_ISTR(prodkey, name, expected) \
check_reg_str ( prodkey , name , expected , FALSE , __LINE__ ) ;
# define CHECK_DEL_REG_ISTR(prodkey, name, expected) \
2012-10-24 02:05:15 +02:00
do { \
check_reg_str ( prodkey , name , expected , FALSE , __LINE__ ) ; \
RegDeleteValueA ( prodkey , name ) ; \
} while ( 0 )
2010-10-14 11:06:13 +02:00
2018-06-02 04:48:21 +02:00
# define CHECK_REG_MULTI(key, name, expect) \
check_reg_multi ( key , name , expect , __LINE__ ) ;
2010-10-14 11:06:13 +02:00
# define CHECK_REG_DWORD(prodkey, name, expected) \
check_reg_dword ( prodkey , name , expected , __LINE__ ) ;
# define CHECK_DEL_REG_DWORD(prodkey, name, expected) \
2012-10-24 02:05:15 +02:00
do { \
check_reg_dword ( prodkey , name , expected , __LINE__ ) ; \
RegDeleteValueA ( prodkey , name ) ; \
} while ( 0 )
2010-10-14 11:06:13 +02:00
static void get_date_str ( LPSTR date )
{
SYSTEMTIME systime ;
static const char date_fmt [ ] = " %d%02d%02d " ;
GetLocalTime ( & systime ) ;
sprintf ( date , date_fmt , systime . wYear , systime . wMonth , systime . wDay ) ;
}
2018-05-14 17:01:30 +02:00
/* EstimatedSize is the size in KiB of .msi + installed files, rounded up to page size. */
static DWORD get_estimated_size ( void )
{
SYSTEM_INFO si ;
HANDLE file ;
DWORD size ;
GetSystemInfo ( & si ) ;
file = CreateFileA ( msifile , GENERIC_READ , 0 , NULL , OPEN_EXISTING , 0 , NULL ) ;
size = ( ( GetFileSize ( file , NULL ) + si . dwPageSize - 1 ) / si . dwPageSize + 1 ) ;
size = size * si . dwPageSize / 1024 ;
CloseHandle ( file ) ;
return size ;
}
2018-05-30 10:22:24 +02:00
static void extract_resource ( const char * name , const char * type , const char * path )
{
DWORD written ;
HANDLE file ;
HRSRC res ;
void * ptr ;
file = CreateFileA ( path , GENERIC_READ | GENERIC_WRITE , 0 , NULL , CREATE_ALWAYS , 0 , 0 ) ;
ok ( file ! = INVALID_HANDLE_VALUE , " file creation failed, at %s, error %d \n " , path , GetLastError ( ) ) ;
res = FindResourceA ( NULL , name , type ) ;
ok ( res ! = 0 , " couldn't find resource \n " ) ;
ptr = LockResource ( LoadResource ( GetModuleHandleA ( NULL ) , res ) ) ;
WriteFile ( file , ptr , SizeofResource ( GetModuleHandleA ( NULL ) , res ) , & written , NULL ) ;
ok ( written = = SizeofResource ( GetModuleHandleA ( NULL ) , res ) , " couldn't write resource \n " ) ;
CloseHandle ( file ) ;
}
2010-10-14 11:06:13 +02:00
static void test_register_product ( void )
{
UINT r ;
LONG res ;
2011-06-30 12:15:02 +02:00
HKEY hkey , props , usage ;
2010-10-14 11:06:13 +02:00
LPSTR usersid ;
2011-06-30 12:15:02 +02:00
char date [ MAX_PATH ] , temp [ MAX_PATH ] , keypath [ MAX_PATH ] , path [ MAX_PATH ] ;
DWORD size , type ;
2010-10-14 11:06:13 +02:00
static const CHAR uninstall [ ] = " Software \\ Microsoft \\ Windows \\ CurrentVersion "
" \\ Uninstall \\ {7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ;
static const CHAR userdata [ ] = " Software \\ Microsoft \\ Windows \\ CurrentVersion \\ Installer "
" \\ UserData \\ %s \\ Products \\ 84A88FD7F6998CE40A22FB59F6B9C2BB " ;
static const CHAR ugkey [ ] = " Software \\ Microsoft \\ Windows \\ CurrentVersion \\ Installer "
" \\ UpgradeCodes \\ 51AAE0C44620A5E4788506E91F249BD2 " ;
static const CHAR userugkey [ ] = " Software \\ Microsoft \\ Installer \\ UpgradeCodes "
" \\ 51AAE0C44620A5E4788506E91F249BD2 " ;
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
2011-03-30 12:30:35 +02:00
if ( ! ( usersid = get_user_sid ( ) ) )
2010-10-14 11:06:13 +02:00
return ;
get_date_str ( date ) ;
2013-10-15 13:04:45 +02:00
GetTempPathA ( MAX_PATH , temp ) ;
2010-10-14 11:06:13 +02:00
CreateDirectoryA ( " msitest " , NULL ) ;
create_file ( " msitest \\ maximus " , 500 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , pp_tables , ARRAY_SIZE ( pp_tables ) ) ;
2010-10-14 11:06:13 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_FULL , NULL ) ;
/* RegisterProduct */
r = MsiInstallProductA ( msifile , " REGISTER_PRODUCT=1 " ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( delete_pf ( " msitest \\ maximus " , TRUE ) , " File not installed \n " ) ;
2011-09-05 11:48:03 +02:00
ok ( delete_pf ( " msitest " , FALSE ) , " Directory not created \n " ) ;
2010-10-14 11:06:13 +02:00
res = RegOpenKeyA ( HKEY_CURRENT_USER , userugkey , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
2018-05-29 04:07:50 +02:00
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , uninstall , 0 , KEY_READ | KEY_WOW64_32KEY , & hkey ) ;
ok ( ! res , " got %d \n " , res ) ;
2010-10-14 11:06:13 +02:00
CHECK_DEL_REG_STR ( hkey , " DisplayName " , " MSITEST " ) ;
CHECK_DEL_REG_STR ( hkey , " DisplayVersion " , " 1.1.1 " ) ;
CHECK_DEL_REG_STR ( hkey , " InstallDate " , date ) ;
CHECK_DEL_REG_STR ( hkey , " InstallSource " , temp ) ;
2018-09-27 15:00:31 +02:00
CHECK_DEL_REG_ISTR ( hkey , " ModifyPath " , " MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ) ;
2010-10-14 11:06:13 +02:00
CHECK_DEL_REG_STR ( hkey , " Publisher " , " Wine " ) ;
2018-09-27 15:00:31 +02:00
CHECK_DEL_REG_STR ( hkey , " UninstallString " , " MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ) ;
2010-10-14 11:06:13 +02:00
CHECK_DEL_REG_STR ( hkey , " AuthorizedCDFPrefix " , NULL ) ;
CHECK_DEL_REG_STR ( hkey , " Comments " , NULL ) ;
CHECK_DEL_REG_STR ( hkey , " Contact " , NULL ) ;
CHECK_DEL_REG_STR ( hkey , " HelpLink " , NULL ) ;
CHECK_DEL_REG_STR ( hkey , " HelpTelephone " , NULL ) ;
CHECK_DEL_REG_STR ( hkey , " InstallLocation " , NULL ) ;
2018-09-27 15:00:31 +02:00
CHECK_DEL_REG_DWORD ( hkey , " NoModify " , 1 ) ;
2010-10-14 11:06:13 +02:00
CHECK_DEL_REG_STR ( hkey , " Readme " , NULL ) ;
CHECK_DEL_REG_STR ( hkey , " Size " , NULL ) ;
CHECK_DEL_REG_STR ( hkey , " URLInfoAbout " , NULL ) ;
CHECK_DEL_REG_STR ( hkey , " URLUpdateInfo " , NULL ) ;
CHECK_DEL_REG_DWORD ( hkey , " Language " , 1033 ) ;
CHECK_DEL_REG_DWORD ( hkey , " Version " , 0x1010001 ) ;
CHECK_DEL_REG_DWORD ( hkey , " VersionMajor " , 1 ) ;
CHECK_DEL_REG_DWORD ( hkey , " VersionMinor " , 1 ) ;
CHECK_DEL_REG_DWORD ( hkey , " WindowsInstaller " , 1 ) ;
todo_wine
2018-05-14 17:01:30 +02:00
CHECK_DEL_REG_DWORD ( hkey , " EstimatedSize " , get_estimated_size ( ) ) ;
2010-10-14 11:06:13 +02:00
2018-05-29 04:07:50 +02:00
res = RegDeleteKeyA ( hkey , " " ) ;
ok ( ! res , " got %d \n " , res ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( hkey ) ;
sprintf ( keypath , userdata , usersid ) ;
2018-05-29 04:07:50 +02:00
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , keypath , 0 , KEY_ALL_ACCESS | KEY_WOW64_64KEY , & hkey ) ;
2010-10-14 11:06:13 +02:00
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
2018-05-29 04:07:50 +02:00
res = RegOpenKeyExA ( hkey , " InstallProperties " , 0 , KEY_READ , & props ) ;
2010-10-14 11:06:13 +02:00
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
2011-06-30 12:15:02 +02:00
size = sizeof ( path ) ;
RegQueryValueExA ( props , " LocalPackage " , NULL , & type , ( LPBYTE ) path , & size ) ;
DeleteFileA ( path ) ;
2010-10-14 11:06:13 +02:00
RegDeleteValueA ( props , " LocalPackage " ) ; /* LocalPackage is nondeterministic */
2011-06-30 12:15:02 +02:00
2010-10-14 11:06:13 +02:00
CHECK_DEL_REG_STR ( props , " DisplayName " , " MSITEST " ) ;
CHECK_DEL_REG_STR ( props , " DisplayVersion " , " 1.1.1 " ) ;
CHECK_DEL_REG_STR ( props , " InstallDate " , date ) ;
CHECK_DEL_REG_STR ( props , " InstallSource " , temp ) ;
2018-09-27 15:00:31 +02:00
CHECK_DEL_REG_ISTR ( props , " ModifyPath " , " MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ) ;
2010-10-14 11:06:13 +02:00
CHECK_DEL_REG_STR ( props , " Publisher " , " Wine " ) ;
2018-09-27 15:00:31 +02:00
CHECK_DEL_REG_STR ( props , " UninstallString " , " MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ) ;
2010-10-14 11:06:13 +02:00
CHECK_DEL_REG_STR ( props , " AuthorizedCDFPrefix " , NULL ) ;
CHECK_DEL_REG_STR ( props , " Comments " , NULL ) ;
CHECK_DEL_REG_STR ( props , " Contact " , NULL ) ;
CHECK_DEL_REG_STR ( props , " HelpLink " , NULL ) ;
CHECK_DEL_REG_STR ( props , " HelpTelephone " , NULL ) ;
CHECK_DEL_REG_STR ( props , " InstallLocation " , NULL ) ;
2018-09-27 15:00:31 +02:00
CHECK_DEL_REG_DWORD ( props , " NoModify " , 1 ) ;
2010-10-14 11:06:13 +02:00
CHECK_DEL_REG_STR ( props , " Readme " , NULL ) ;
CHECK_DEL_REG_STR ( props , " Size " , NULL ) ;
CHECK_DEL_REG_STR ( props , " URLInfoAbout " , NULL ) ;
CHECK_DEL_REG_STR ( props , " URLUpdateInfo " , NULL ) ;
CHECK_DEL_REG_DWORD ( props , " Language " , 1033 ) ;
CHECK_DEL_REG_DWORD ( props , " Version " , 0x1010001 ) ;
CHECK_DEL_REG_DWORD ( props , " VersionMajor " , 1 ) ;
CHECK_DEL_REG_DWORD ( props , " VersionMinor " , 1 ) ;
CHECK_DEL_REG_DWORD ( props , " WindowsInstaller " , 1 ) ;
todo_wine
2018-05-14 17:01:30 +02:00
CHECK_DEL_REG_DWORD ( props , " EstimatedSize " , get_estimated_size ( ) ) ;
2010-10-14 11:06:13 +02:00
2018-05-29 04:07:50 +02:00
res = RegDeleteKeyA ( props , " " ) ;
ok ( ! res , " got %d \n " , res ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( props ) ;
2018-05-29 04:07:50 +02:00
res = RegOpenKeyExA ( hkey , " Usage " , 0 , KEY_READ , & usage ) ;
2010-10-14 11:06:13 +02:00
todo_wine
{
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
}
2018-05-29 04:07:50 +02:00
res = RegDeleteKeyA ( usage , " " ) ;
todo_wine
ok ( ! res , " got %d \n " , res ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( usage ) ;
2018-05-29 04:07:50 +02:00
res = RegDeleteKeyA ( hkey , " " ) ;
ok ( ! res , " got %d \n " , res ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( hkey ) ;
2018-05-29 04:07:50 +02:00
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , ugkey , 0 , KEY_READ | KEY_WOW64_64KEY , & hkey ) ;
2010-10-14 11:06:13 +02:00
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_DEL_REG_STR ( hkey , " 84A88FD7F6998CE40A22FB59F6B9C2BB " , NULL ) ;
2018-05-29 04:07:50 +02:00
res = RegDeleteKeyA ( hkey , " " ) ;
ok ( ! res , " got %d \n " , res ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( hkey ) ;
/* RegisterProduct, machine */
r = MsiInstallProductA ( msifile , " REGISTER_PRODUCT=1 ALLUSERS=1 " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( delete_pf ( " msitest \\ maximus " , TRUE ) , " File not installed \n " ) ;
2011-09-05 11:48:03 +02:00
ok ( delete_pf ( " msitest " , FALSE ) , " Directory not created \n " ) ;
2010-10-14 11:06:13 +02:00
2018-05-29 04:07:50 +02:00
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , userugkey , 0 , KEY_READ | KEY_WOW64_64KEY , & hkey ) ;
2010-10-14 11:06:13 +02:00
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
2018-05-29 04:07:50 +02:00
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , uninstall , 0 , KEY_READ | KEY_WOW64_32KEY , & hkey ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
2010-10-14 11:06:13 +02:00
CHECK_DEL_REG_STR ( hkey , " DisplayName " , " MSITEST " ) ;
CHECK_DEL_REG_STR ( hkey , " DisplayVersion " , " 1.1.1 " ) ;
CHECK_DEL_REG_STR ( hkey , " InstallDate " , date ) ;
CHECK_DEL_REG_STR ( hkey , " InstallSource " , temp ) ;
2018-09-27 15:00:31 +02:00
CHECK_DEL_REG_ISTR ( hkey , " ModifyPath " , " MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ) ;
2010-10-14 11:06:13 +02:00
CHECK_DEL_REG_STR ( hkey , " Publisher " , " Wine " ) ;
2018-09-27 15:00:31 +02:00
CHECK_DEL_REG_STR ( hkey , " UninstallString " , " MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ) ;
2010-10-14 11:06:13 +02:00
CHECK_DEL_REG_STR ( hkey , " AuthorizedCDFPrefix " , NULL ) ;
CHECK_DEL_REG_STR ( hkey , " Comments " , NULL ) ;
CHECK_DEL_REG_STR ( hkey , " Contact " , NULL ) ;
CHECK_DEL_REG_STR ( hkey , " HelpLink " , NULL ) ;
CHECK_DEL_REG_STR ( hkey , " HelpTelephone " , NULL ) ;
CHECK_DEL_REG_STR ( hkey , " InstallLocation " , NULL ) ;
2018-09-27 15:00:31 +02:00
CHECK_DEL_REG_DWORD ( hkey , " NoModify " , 1 ) ;
2010-10-14 11:06:13 +02:00
CHECK_DEL_REG_STR ( hkey , " Readme " , NULL ) ;
CHECK_DEL_REG_STR ( hkey , " Size " , NULL ) ;
CHECK_DEL_REG_STR ( hkey , " URLInfoAbout " , NULL ) ;
CHECK_DEL_REG_STR ( hkey , " URLUpdateInfo " , NULL ) ;
CHECK_DEL_REG_DWORD ( hkey , " Language " , 1033 ) ;
CHECK_DEL_REG_DWORD ( hkey , " Version " , 0x1010001 ) ;
CHECK_DEL_REG_DWORD ( hkey , " VersionMajor " , 1 ) ;
CHECK_DEL_REG_DWORD ( hkey , " VersionMinor " , 1 ) ;
CHECK_DEL_REG_DWORD ( hkey , " WindowsInstaller " , 1 ) ;
todo_wine
2018-05-14 17:01:30 +02:00
CHECK_DEL_REG_DWORD ( hkey , " EstimatedSize " , get_estimated_size ( ) ) ;
2010-10-14 11:06:13 +02:00
2018-05-29 04:07:50 +02:00
res = RegDeleteKeyA ( hkey , " " ) ;
ok ( ! res , " got %d \n " , res ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( hkey ) ;
sprintf ( keypath , userdata , " S-1-5-18 " ) ;
2018-05-29 04:07:50 +02:00
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , keypath , 0 , KEY_READ | KEY_WOW64_64KEY , & hkey ) ;
2010-10-14 11:06:13 +02:00
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
2018-05-29 04:07:50 +02:00
res = RegOpenKeyExA ( hkey , " InstallProperties " , 0 , KEY_READ , & props ) ;
2010-10-14 11:06:13 +02:00
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
2011-06-30 12:15:02 +02:00
size = sizeof ( path ) ;
RegQueryValueExA ( props , " LocalPackage " , NULL , & type , ( LPBYTE ) path , & size ) ;
DeleteFileA ( path ) ;
2010-10-14 11:06:13 +02:00
RegDeleteValueA ( props , " LocalPackage " ) ; /* LocalPackage is nondeterministic */
2011-06-30 12:15:02 +02:00
2010-10-14 11:06:13 +02:00
CHECK_DEL_REG_STR ( props , " DisplayName " , " MSITEST " ) ;
CHECK_DEL_REG_STR ( props , " DisplayVersion " , " 1.1.1 " ) ;
CHECK_DEL_REG_STR ( props , " InstallDate " , date ) ;
CHECK_DEL_REG_STR ( props , " InstallSource " , temp ) ;
2018-09-27 15:00:31 +02:00
CHECK_DEL_REG_ISTR ( props , " ModifyPath " , " MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ) ;
2010-10-14 11:06:13 +02:00
CHECK_DEL_REG_STR ( props , " Publisher " , " Wine " ) ;
2018-09-27 15:00:31 +02:00
CHECK_DEL_REG_STR ( props , " UninstallString " , " MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ) ;
2010-10-14 11:06:13 +02:00
CHECK_DEL_REG_STR ( props , " AuthorizedCDFPrefix " , NULL ) ;
CHECK_DEL_REG_STR ( props , " Comments " , NULL ) ;
CHECK_DEL_REG_STR ( props , " Contact " , NULL ) ;
CHECK_DEL_REG_STR ( props , " HelpLink " , NULL ) ;
CHECK_DEL_REG_STR ( props , " HelpTelephone " , NULL ) ;
CHECK_DEL_REG_STR ( props , " InstallLocation " , NULL ) ;
2018-09-27 15:00:31 +02:00
CHECK_DEL_REG_DWORD ( props , " NoModify " , 1 ) ;
2010-10-14 11:06:13 +02:00
CHECK_DEL_REG_STR ( props , " Readme " , NULL ) ;
CHECK_DEL_REG_STR ( props , " Size " , NULL ) ;
CHECK_DEL_REG_STR ( props , " URLInfoAbout " , NULL ) ;
CHECK_DEL_REG_STR ( props , " URLUpdateInfo " , NULL ) ;
CHECK_DEL_REG_DWORD ( props , " Language " , 1033 ) ;
CHECK_DEL_REG_DWORD ( props , " Version " , 0x1010001 ) ;
CHECK_DEL_REG_DWORD ( props , " VersionMajor " , 1 ) ;
CHECK_DEL_REG_DWORD ( props , " VersionMinor " , 1 ) ;
CHECK_DEL_REG_DWORD ( props , " WindowsInstaller " , 1 ) ;
todo_wine
2018-05-14 17:01:30 +02:00
CHECK_DEL_REG_DWORD ( props , " EstimatedSize " , get_estimated_size ( ) ) ;
2010-10-14 11:06:13 +02:00
2018-05-29 04:07:50 +02:00
res = RegDeleteKeyA ( props , " " ) ;
ok ( ! res , " got %d \n " , res ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( props ) ;
2018-05-29 04:07:50 +02:00
res = RegOpenKeyExA ( hkey , " Usage " , 0 , KEY_READ , & usage ) ;
2010-10-14 11:06:13 +02:00
todo_wine
{
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
}
2018-05-29 04:07:50 +02:00
res = RegDeleteKeyA ( usage , " " ) ;
todo_wine
ok ( ! res , " got %d \n " , res ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( usage ) ;
2018-05-29 04:07:50 +02:00
res = RegDeleteKeyA ( hkey , " " ) ;
ok ( ! res , " got %d \n " , res ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( hkey ) ;
2018-05-29 04:07:50 +02:00
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , ugkey , 0 , KEY_READ | KEY_WOW64_64KEY , & hkey ) ;
2010-10-14 11:06:13 +02:00
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_DEL_REG_STR ( hkey , " 84A88FD7F6998CE40A22FB59F6B9C2BB " , NULL ) ;
2018-05-29 04:07:50 +02:00
res = RegDeleteKeyA ( hkey , " " ) ;
ok ( ! res , " got %d \n " , res ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( hkey ) ;
error :
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
DeleteFileA ( " msitest \\ maximus " ) ;
RemoveDirectoryA ( " msitest " ) ;
2010-10-14 11:06:13 +02:00
HeapFree ( GetProcessHeap ( ) , 0 , usersid ) ;
}
static void test_publish_product ( void )
{
2013-10-15 13:04:45 +02:00
static const char prodpath [ ] =
" Software \\ Microsoft \\ Windows \\ CurrentVersion \\ Installer \\ UserData \\ %s \\ Products "
" \\ 84A88FD7F6998CE40A22FB59F6B9C2BB " ;
static const char cuprodpath [ ] =
" Software \\ Microsoft \\ Installer \\ Products \\ 84A88FD7F6998CE40A22FB59F6B9C2BB " ;
static const char cuupgrades [ ] =
" Software \\ Microsoft \\ Installer \\ UpgradeCodes \\ 51AAE0C44620A5E4788506E91F249BD2 " ;
static const char badprod [ ] =
" Software \\ Microsoft \\ Windows \\ CurrentVersion \\ Installer \\ Products "
" \\ 84A88FD7F6998CE40A22FB59F6B9C2BB " ;
static const char machprod [ ] =
" Software \\ Classes \\ Installer \\ Products \\ 84A88FD7F6998CE40A22FB59F6B9C2BB " ;
static const char machup [ ] =
" Software \\ Classes \\ Installer \\ UpgradeCodes \\ 51AAE0C44620A5E4788506E91F249BD2 " ;
2010-10-14 11:06:13 +02:00
UINT r ;
LONG res ;
LPSTR usersid ;
HKEY sourcelist , net , props ;
HKEY hkey , patches , media ;
CHAR keypath [ MAX_PATH ] ;
CHAR temp [ MAX_PATH ] ;
CHAR path [ MAX_PATH ] ;
BOOL old_installer = FALSE ;
REGSAM access = KEY_ALL_ACCESS ;
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
2011-03-30 12:30:35 +02:00
if ( ! ( usersid = get_user_sid ( ) ) )
2010-10-14 11:06:13 +02:00
return ;
2013-10-15 13:04:45 +02:00
GetTempPathA ( MAX_PATH , temp ) ;
2010-10-14 11:06:13 +02:00
CreateDirectoryA ( " msitest " , NULL ) ;
create_file ( " msitest \\ maximus " , 500 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , pp_tables , ARRAY_SIZE ( pp_tables ) ) ;
2010-10-14 11:06:13 +02:00
if ( is_wow64 )
access | = KEY_WOW64_64KEY ;
MsiSetInternalUI ( INSTALLUILEVEL_FULL , NULL ) ;
/* PublishProduct, current user */
r = MsiInstallProductA ( msifile , " PUBLISH_PRODUCT=1 " ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( delete_pf ( " msitest \\ maximus " , TRUE ) , " File not installed \n " ) ;
2011-09-05 11:48:03 +02:00
ok ( delete_pf ( " msitest " , FALSE ) , " Directory not created \n " ) ;
2010-10-14 11:06:13 +02:00
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , badprod , 0 , access , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
sprintf ( keypath , prodpath , usersid ) ;
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , keypath , 0 , access , & hkey ) ;
if ( res = = ERROR_FILE_NOT_FOUND )
{
res = RegOpenKeyA ( HKEY_CURRENT_USER , cuprodpath , & hkey ) ;
if ( res = = ERROR_SUCCESS )
{
win_skip ( " Windows Installer < 3.0 detected \n " ) ;
RegCloseKey ( hkey ) ;
old_installer = TRUE ;
goto currentuser ;
}
else
{
win_skip ( " Install failed, no need to continue \n " ) ;
return ;
}
}
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
res = RegOpenKeyExA ( hkey , " InstallProperties " , 0 , access , & props ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
res = RegOpenKeyExA ( hkey , " Patches " , 0 , access , & patches ) ;
todo_wine
{
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_DEL_REG_STR ( patches , " AllPatches " , NULL ) ;
}
delete_key ( patches , " " , access ) ;
RegCloseKey ( patches ) ;
delete_key ( hkey , " " , access ) ;
RegCloseKey ( hkey ) ;
currentuser :
res = RegOpenKeyA ( HKEY_CURRENT_USER , cuprodpath , & hkey ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_DEL_REG_STR ( hkey , " ProductName " , " MSITEST " ) ;
2012-06-12 09:24:35 +02:00
CHECK_DEL_REG_STR ( hkey , " PackageCode " , " AC75740029052C94DA02821EECD05F2F " ) ;
2010-10-14 11:06:13 +02:00
CHECK_DEL_REG_DWORD ( hkey , " Language " , 1033 ) ;
CHECK_DEL_REG_DWORD ( hkey , " Version " , 0x1010001 ) ;
if ( ! old_installer )
CHECK_DEL_REG_DWORD ( hkey , " AuthorizedLUAApp " , 0 ) ;
CHECK_DEL_REG_DWORD ( hkey , " Assignment " , 0 ) ;
CHECK_DEL_REG_DWORD ( hkey , " AdvertiseFlags " , 0x184 ) ;
CHECK_DEL_REG_DWORD ( hkey , " InstanceType " , 0 ) ;
CHECK_DEL_REG_STR ( hkey , " Clients " , " : " ) ;
res = RegOpenKeyA ( hkey , " SourceList " , & sourcelist ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
lstrcpyA ( path , " n;1; " ) ;
lstrcatA ( path , temp ) ;
CHECK_DEL_REG_STR ( sourcelist , " LastUsedSource " , path ) ;
CHECK_DEL_REG_STR ( sourcelist , " PackageName " , " msitest.msi " ) ;
res = RegOpenKeyA ( sourcelist , " Net " , & net ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_DEL_REG_STR ( net , " 1 " , temp ) ;
RegDeleteKeyA ( net , " " ) ;
RegCloseKey ( net ) ;
res = RegOpenKeyA ( sourcelist , " Media " , & media ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_DEL_REG_STR ( media , " 1 " , " DISK1; " ) ;
RegDeleteKeyA ( media , " " ) ;
RegCloseKey ( media ) ;
RegDeleteKeyA ( sourcelist , " " ) ;
RegCloseKey ( sourcelist ) ;
RegDeleteKeyA ( hkey , " " ) ;
RegCloseKey ( hkey ) ;
res = RegOpenKeyA ( HKEY_CURRENT_USER , cuupgrades , & hkey ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_DEL_REG_STR ( hkey , " 84A88FD7F6998CE40A22FB59F6B9C2BB " , NULL ) ;
RegDeleteKeyA ( hkey , " " ) ;
RegCloseKey ( hkey ) ;
/* PublishProduct, machine */
r = MsiInstallProductA ( msifile , " PUBLISH_PRODUCT=1 ALLUSERS=1 " ) ;
if ( old_installer )
goto machprod ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( delete_pf ( " msitest \\ maximus " , TRUE ) , " File not installed \n " ) ;
2011-09-05 11:48:03 +02:00
ok ( delete_pf ( " msitest " , FALSE ) , " Directory not created \n " ) ;
2010-10-14 11:06:13 +02:00
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , badprod , 0 , access , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
sprintf ( keypath , prodpath , " S-1-5-18 " ) ;
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , keypath , 0 , access , & hkey ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
res = RegOpenKeyExA ( hkey , " InstallProperties " , 0 , access , & props ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
res = RegOpenKeyExA ( hkey , " Patches " , 0 , access , & patches ) ;
todo_wine
{
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_DEL_REG_STR ( patches , " AllPatches " , NULL ) ;
}
delete_key ( patches , " " , access ) ;
RegCloseKey ( patches ) ;
delete_key ( hkey , " " , access ) ;
RegCloseKey ( hkey ) ;
machprod :
2011-04-06 09:52:16 +02:00
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , machprod , 0 , access , & hkey ) ;
2010-10-14 11:06:13 +02:00
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_DEL_REG_STR ( hkey , " ProductName " , " MSITEST " ) ;
2012-06-12 09:24:35 +02:00
CHECK_DEL_REG_STR ( hkey , " PackageCode " , " AC75740029052C94DA02821EECD05F2F " ) ;
2010-10-14 11:06:13 +02:00
CHECK_DEL_REG_DWORD ( hkey , " Language " , 1033 ) ;
CHECK_DEL_REG_DWORD ( hkey , " Version " , 0x1010001 ) ;
if ( ! old_installer )
CHECK_DEL_REG_DWORD ( hkey , " AuthorizedLUAApp " , 0 ) ;
todo_wine CHECK_DEL_REG_DWORD ( hkey , " Assignment " , 1 ) ;
CHECK_DEL_REG_DWORD ( hkey , " AdvertiseFlags " , 0x184 ) ;
CHECK_DEL_REG_DWORD ( hkey , " InstanceType " , 0 ) ;
CHECK_DEL_REG_STR ( hkey , " Clients " , " : " ) ;
2010-12-10 16:46:43 +01:00
res = RegOpenKeyExA ( hkey , " SourceList " , 0 , access , & sourcelist ) ;
2010-10-14 11:06:13 +02:00
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
lstrcpyA ( path , " n;1; " ) ;
lstrcatA ( path , temp ) ;
CHECK_DEL_REG_STR ( sourcelist , " LastUsedSource " , path ) ;
CHECK_DEL_REG_STR ( sourcelist , " PackageName " , " msitest.msi " ) ;
2010-12-10 16:46:43 +01:00
res = RegOpenKeyExA ( sourcelist , " Net " , 0 , access , & net ) ;
2010-10-14 11:06:13 +02:00
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_DEL_REG_STR ( net , " 1 " , temp ) ;
2011-01-04 15:57:29 +01:00
res = delete_key ( net , " " , access ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( net ) ;
2010-12-10 16:46:43 +01:00
res = RegOpenKeyExA ( sourcelist , " Media " , 0 , access , & media ) ;
2010-10-14 11:06:13 +02:00
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_DEL_REG_STR ( media , " 1 " , " DISK1; " ) ;
2011-01-04 15:57:29 +01:00
res = delete_key ( media , " " , access ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( media ) ;
2011-01-04 15:57:29 +01:00
res = delete_key ( sourcelist , " " , access ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( sourcelist ) ;
2011-01-04 15:57:29 +01:00
res = delete_key ( hkey , " " , access ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( hkey ) ;
2011-04-06 09:52:16 +02:00
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , machup , 0 , access , & hkey ) ;
2010-10-14 11:06:13 +02:00
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_DEL_REG_STR ( hkey , " 84A88FD7F6998CE40A22FB59F6B9C2BB " , NULL ) ;
2011-01-04 15:57:29 +01:00
res = delete_key ( hkey , " " , access ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( hkey ) ;
error :
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
DeleteFileA ( " msitest \\ maximus " ) ;
RemoveDirectoryA ( " msitest " ) ;
2010-10-14 11:06:13 +02:00
HeapFree ( GetProcessHeap ( ) , 0 , usersid ) ;
}
static void test_publish_features ( void )
{
2013-10-15 13:04:45 +02:00
static const char cupath [ ] =
" Software \\ Microsoft \\ Installer \\ Features \\ 84A88FD7F6998CE40A22FB59F6B9C2BB " ;
static const char udfeatpath [ ] =
" Software \\ Microsoft \\ Windows \\ CurrentVersion \\ Installer \\ UserData \\ %s \\ Products "
" \\ 84A88FD7F6998CE40A22FB59F6B9C2BB \\ Features " ;
static const char udpridpath [ ] =
" Software \\ Microsoft \\ Windows \\ CurrentVersion \\ Installer \\ UserData \\ %s \\ Products "
" \\ 84A88FD7F6998CE40A22FB59F6B9C2BB " ;
static const char featkey [ ] =
" Software \\ Microsoft \\ Windows \\ CurrentVersion \\ Installer \\ Features " ;
static const char classfeat [ ] =
" Software \\ Classes \\ Installer \\ Features \\ 84A88FD7F6998CE40A22FB59F6B9C2BB " ;
2010-10-14 11:06:13 +02:00
UINT r ;
LONG res ;
HKEY hkey ;
LPSTR usersid ;
CHAR keypath [ MAX_PATH ] ;
REGSAM access = KEY_ALL_ACCESS ;
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
2011-03-30 12:30:35 +02:00
if ( ! ( usersid = get_user_sid ( ) ) )
2010-10-14 11:06:13 +02:00
return ;
CreateDirectoryA ( " msitest " , NULL ) ;
create_file ( " msitest \\ maximus " , 500 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , pp_tables , ARRAY_SIZE ( pp_tables ) ) ;
2010-10-14 11:06:13 +02:00
if ( is_wow64 )
access | = KEY_WOW64_64KEY ;
MsiSetInternalUI ( INSTALLUILEVEL_FULL , NULL ) ;
/* PublishFeatures, current user */
r = MsiInstallProductA ( msifile , " PUBLISH_FEATURES=1 " ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( delete_pf ( " msitest \\ maximus " , TRUE ) , " File not installed \n " ) ;
2011-09-05 11:48:03 +02:00
ok ( delete_pf ( " msitest " , FALSE ) , " Directory not created \n " ) ;
2010-10-14 11:06:13 +02:00
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , featkey , 0 , access , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , classfeat , 0 , access , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
res = RegOpenKeyA ( HKEY_CURRENT_USER , cupath , & hkey ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_REG_STR ( hkey , " feature " , " " ) ;
CHECK_REG_STR ( hkey , " montecristo " , " " ) ;
RegDeleteValueA ( hkey , " feature " ) ;
RegDeleteValueA ( hkey , " montecristo " ) ;
2011-01-04 15:57:29 +01:00
delete_key ( hkey , " " , access ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( hkey ) ;
2011-01-04 15:57:29 +01:00
sprintf ( keypath , udfeatpath , usersid ) ;
2010-10-14 11:06:13 +02:00
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , keypath , 0 , access , & hkey ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_REG_STR ( hkey , " feature " , " VGtfp^p+,?82@JU1j_KE " ) ;
CHECK_REG_STR ( hkey , " montecristo " , " VGtfp^p+,?82@JU1j_KE " ) ;
RegDeleteValueA ( hkey , " feature " ) ;
RegDeleteValueA ( hkey , " montecristo " ) ;
2011-01-04 15:57:29 +01:00
delete_key ( hkey , " " , access ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( hkey ) ;
2011-01-04 15:57:29 +01:00
sprintf ( keypath , udpridpath , usersid ) ;
delete_key ( HKEY_LOCAL_MACHINE , keypath , access ) ;
2010-10-14 11:06:13 +02:00
/* PublishFeatures, machine */
r = MsiInstallProductA ( msifile , " PUBLISH_FEATURES=1 ALLUSERS=1 " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( delete_pf ( " msitest \\ maximus " , TRUE ) , " File not installed \n " ) ;
2011-09-05 11:48:03 +02:00
ok ( delete_pf ( " msitest " , FALSE ) , " Directory not created \n " ) ;
2010-10-14 11:06:13 +02:00
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , featkey , 0 , access , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
res = RegOpenKeyA ( HKEY_CURRENT_USER , cupath , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
2010-12-10 16:46:43 +01:00
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , classfeat , 0 , access , & hkey ) ;
2010-10-14 11:06:13 +02:00
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_REG_STR ( hkey , " feature " , " " ) ;
CHECK_REG_STR ( hkey , " montecristo " , " " ) ;
RegDeleteValueA ( hkey , " feature " ) ;
RegDeleteValueA ( hkey , " montecristo " ) ;
2011-01-04 15:57:29 +01:00
delete_key ( hkey , " " , access ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( hkey ) ;
2011-01-04 15:57:29 +01:00
sprintf ( keypath , udfeatpath , " S-1-5-18 " ) ;
2010-10-14 11:06:13 +02:00
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , keypath , 0 , access , & hkey ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_REG_STR ( hkey , " feature " , " VGtfp^p+,?82@JU1j_KE " ) ;
CHECK_REG_STR ( hkey , " montecristo " , " VGtfp^p+,?82@JU1j_KE " ) ;
RegDeleteValueA ( hkey , " feature " ) ;
RegDeleteValueA ( hkey , " montecristo " ) ;
2011-01-04 15:57:29 +01:00
delete_key ( hkey , " " , access ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( hkey ) ;
2011-01-04 15:57:29 +01:00
sprintf ( keypath , udpridpath , " S-1-5-18 " ) ;
delete_key ( HKEY_LOCAL_MACHINE , keypath , access ) ;
2010-10-14 11:06:13 +02:00
error :
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
DeleteFileA ( " msitest \\ maximus " ) ;
RemoveDirectoryA ( " msitest " ) ;
2010-10-14 11:06:13 +02:00
HeapFree ( GetProcessHeap ( ) , 0 , usersid ) ;
}
static LPSTR reg_get_val_str ( HKEY hkey , LPCSTR name )
{
DWORD len = 0 ;
LPSTR val ;
LONG r ;
r = RegQueryValueExA ( hkey , name , NULL , NULL , NULL , & len ) ;
if ( r ! = ERROR_SUCCESS )
return NULL ;
len + = sizeof ( WCHAR ) ;
val = HeapAlloc ( GetProcessHeap ( ) , 0 , len ) ;
if ( ! val ) return NULL ;
val [ 0 ] = 0 ;
RegQueryValueExA ( hkey , name , NULL , NULL , ( LPBYTE ) val , & len ) ;
return val ;
}
static void get_owner_company ( LPSTR * owner , LPSTR * company )
{
LONG res ;
HKEY hkey ;
REGSAM access = KEY_ALL_ACCESS ;
* owner = * company = NULL ;
if ( is_wow64 )
access | = KEY_WOW64_64KEY ;
res = RegOpenKeyA ( HKEY_CURRENT_USER ,
" Software \\ Microsoft \\ MS Setup (ACME) \\ User Info " , & hkey ) ;
if ( res = = ERROR_SUCCESS )
{
* owner = reg_get_val_str ( hkey , " DefName " ) ;
* company = reg_get_val_str ( hkey , " DefCompany " ) ;
RegCloseKey ( hkey ) ;
}
if ( ! * owner | | ! * company )
{
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE ,
" Software \\ Microsoft \\ Windows \\ CurrentVersion " , 0 , access , & hkey ) ;
if ( res = = ERROR_SUCCESS )
{
* owner = reg_get_val_str ( hkey , " RegisteredOwner " ) ;
* company = reg_get_val_str ( hkey , " RegisteredOrganization " ) ;
RegCloseKey ( hkey ) ;
}
}
if ( ! * owner | | ! * company )
{
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE ,
" Software \\ Microsoft \\ Windows NT \\ CurrentVersion " , 0 , access , & hkey ) ;
if ( res = = ERROR_SUCCESS )
{
* owner = reg_get_val_str ( hkey , " RegisteredOwner " ) ;
* company = reg_get_val_str ( hkey , " RegisteredOrganization " ) ;
RegCloseKey ( hkey ) ;
}
}
}
static void test_register_user ( void )
{
UINT r ;
LONG res ;
HKEY props ;
LPSTR usersid ;
LPSTR owner , company ;
CHAR keypath [ MAX_PATH ] ;
REGSAM access = KEY_ALL_ACCESS ;
2011-01-04 15:57:29 +01:00
static const CHAR keypropsfmt [ ] =
2010-10-14 11:06:13 +02:00
" Software \\ Microsoft \\ Windows \\ CurrentVersion \\ Installer \\ "
" UserData \\ %s \\ Products \\ 84A88FD7F6998CE40A22FB59F6B9C2BB \\ InstallProperties " ;
2011-01-04 15:57:29 +01:00
static const CHAR keypridfmt [ ] =
" Software \\ Microsoft \\ Windows \\ CurrentVersion \\ Installer \\ "
" UserData \\ %s \\ Products \\ 84A88FD7F6998CE40A22FB59F6B9C2BB " ;
2010-10-14 11:06:13 +02:00
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
2011-03-30 12:30:35 +02:00
if ( ! ( usersid = get_user_sid ( ) ) )
2010-10-14 11:06:13 +02:00
return ;
get_owner_company ( & owner , & company ) ;
CreateDirectoryA ( " msitest " , NULL ) ;
create_file ( " msitest \\ maximus " , 500 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , pp_tables , ARRAY_SIZE ( pp_tables ) ) ;
2010-10-14 11:06:13 +02:00
if ( is_wow64 )
access | = KEY_WOW64_64KEY ;
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
/* RegisterUser, per-user */
r = MsiInstallProductA ( msifile , " REGISTER_USER=1 " ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( delete_pf ( " msitest \\ maximus " , TRUE ) , " File not installed \n " ) ;
2011-09-05 11:48:03 +02:00
ok ( delete_pf ( " msitest " , FALSE ) , " Directory not created \n " ) ;
2010-10-14 11:06:13 +02:00
2011-01-04 15:57:29 +01:00
sprintf ( keypath , keypropsfmt , usersid ) ;
2010-10-14 11:06:13 +02:00
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , keypath , 0 , access , & props ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_REG_STR ( props , " ProductID " , " none " ) ;
CHECK_REG_STR ( props , " RegCompany " , company ) ;
CHECK_REG_STR ( props , " RegOwner " , owner ) ;
RegDeleteValueA ( props , " ProductID " ) ;
RegDeleteValueA ( props , " RegCompany " ) ;
RegDeleteValueA ( props , " RegOwner " ) ;
delete_key ( props , " " , access ) ;
RegCloseKey ( props ) ;
2011-01-04 15:57:29 +01:00
sprintf ( keypath , keypridfmt , usersid ) ;
delete_key ( HKEY_LOCAL_MACHINE , keypath , access ) ;
2010-10-14 11:06:13 +02:00
/* RegisterUser, machine */
r = MsiInstallProductA ( msifile , " REGISTER_USER=1 ALLUSERS=1 " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( delete_pf ( " msitest \\ maximus " , TRUE ) , " File not installed \n " ) ;
2011-09-05 11:48:03 +02:00
ok ( delete_pf ( " msitest " , FALSE ) , " Directory not created \n " ) ;
2010-10-14 11:06:13 +02:00
2011-01-04 15:57:29 +01:00
sprintf ( keypath , keypropsfmt , " S-1-5-18 " ) ;
2010-10-14 11:06:13 +02:00
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , keypath , 0 , access , & props ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_REG_STR ( props , " ProductID " , " none " ) ;
CHECK_REG_STR ( props , " RegCompany " , company ) ;
CHECK_REG_STR ( props , " RegOwner " , owner ) ;
RegDeleteValueA ( props , " ProductID " ) ;
RegDeleteValueA ( props , " RegCompany " ) ;
RegDeleteValueA ( props , " RegOwner " ) ;
delete_key ( props , " " , access ) ;
RegCloseKey ( props ) ;
2011-01-04 15:57:29 +01:00
sprintf ( keypath , keypridfmt , " S-1-5-18 " ) ;
delete_key ( HKEY_LOCAL_MACHINE , keypath , access ) ;
2010-10-14 11:06:13 +02:00
error :
HeapFree ( GetProcessHeap ( ) , 0 , company ) ;
HeapFree ( GetProcessHeap ( ) , 0 , owner ) ;
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
DeleteFileA ( " msitest \\ maximus " ) ;
RemoveDirectoryA ( " msitest " ) ;
2010-10-14 11:06:13 +02:00
LocalFree ( usersid ) ;
}
static void test_process_components ( void )
{
2013-10-15 13:04:45 +02:00
static const char keyfmt [ ] =
" Software \\ Microsoft \\ Windows \\ CurrentVersion \\ Installer \\ UserData \\ %s \\ Components \\ %s " ;
static const char compkey [ ] =
" Software \\ Microsoft \\ Windows \\ CurrentVersion \\ Installer \\ Components " ;
2010-10-14 11:06:13 +02:00
UINT r ;
LONG res ;
DWORD size ;
HKEY comp , hkey ;
LPSTR usersid ;
CHAR val [ MAX_PATH ] ;
CHAR keypath [ MAX_PATH ] ;
CHAR program_files_maximus [ MAX_PATH ] ;
REGSAM access = KEY_ALL_ACCESS ;
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
2011-03-30 12:30:35 +02:00
if ( ! ( usersid = get_user_sid ( ) ) )
2010-10-14 11:06:13 +02:00
return ;
CreateDirectoryA ( " msitest " , NULL ) ;
create_file ( " msitest \\ maximus " , 500 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , ppc_tables , ARRAY_SIZE ( ppc_tables ) ) ;
2010-10-14 11:06:13 +02:00
if ( is_wow64 )
access | = KEY_WOW64_64KEY ;
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
/* ProcessComponents, per-user */
r = MsiInstallProductA ( msifile , " PROCESS_COMPONENTS=1 " ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( delete_pf ( " msitest \\ maximus " , TRUE ) , " File not installed \n " ) ;
2011-09-05 11:48:03 +02:00
ok ( delete_pf ( " msitest " , FALSE ) , " Directory not created \n " ) ;
2010-10-14 11:06:13 +02:00
sprintf ( keypath , keyfmt , usersid , " CBABC2FDCCB35E749A8944D8C1C098B5 " ) ;
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , keypath , 0 , access , & comp ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
size = MAX_PATH ;
res = RegQueryValueExA ( comp , " 84A88FD7F6998CE40A22FB59F6B9C2BB " ,
NULL , NULL , ( LPBYTE ) val , & size ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
lstrcpyA ( program_files_maximus , PROG_FILES_DIR ) ;
lstrcatA ( program_files_maximus , " \\ msitest \\ maximus " ) ;
ok ( ! lstrcmpiA ( val , program_files_maximus ) ,
" Expected \" %s \" , got \" %s \" \n " , program_files_maximus , val ) ;
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , compkey , 0 , access , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
RegDeleteValueA ( comp , " 84A88FD7F6998CE40A22FB59F6B9C2BB " ) ;
delete_key ( comp , " " , access ) ;
RegCloseKey ( comp ) ;
sprintf ( keypath , keyfmt , usersid , " 241C3DA58FECD0945B9687D408766058 " ) ;
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , keypath , 0 , access , & comp ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
size = MAX_PATH ;
res = RegQueryValueExA ( comp , " 84A88FD7F6998CE40A22FB59F6B9C2BB " ,
NULL , NULL , ( LPBYTE ) val , & size ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
ok ( ! lstrcmpA ( val , " 01 \\ msitest \\ augustus " ) ,
" Expected \" 01 \\ msitest \\ augustus \" , got \" %s \" \n " , val ) ;
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , compkey , 0 , access , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
RegDeleteValueA ( comp , " 84A88FD7F6998CE40A22FB59F6B9C2BB " ) ;
delete_key ( comp , " " , access ) ;
RegCloseKey ( comp ) ;
/* ProcessComponents, machine */
r = MsiInstallProductA ( msifile , " PROCESS_COMPONENTS=1 ALLUSERS=1 " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( delete_pf ( " msitest \\ maximus " , TRUE ) , " File not installed \n " ) ;
2011-09-05 11:48:03 +02:00
ok ( delete_pf ( " msitest " , FALSE ) , " Directory not created \n " ) ;
2010-10-14 11:06:13 +02:00
sprintf ( keypath , keyfmt , " S-1-5-18 " , " CBABC2FDCCB35E749A8944D8C1C098B5 " ) ;
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , keypath , 0 , access , & comp ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
size = MAX_PATH ;
res = RegQueryValueExA ( comp , " 84A88FD7F6998CE40A22FB59F6B9C2BB " ,
NULL , NULL , ( LPBYTE ) val , & size ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
ok ( ! lstrcmpiA ( val , program_files_maximus ) ,
" Expected \" %s \" , got \" %s \" \n " , program_files_maximus , val ) ;
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , compkey , 0 , access , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
RegDeleteValueA ( comp , " 84A88FD7F6998CE40A22FB59F6B9C2BB " ) ;
delete_key ( comp , " " , access ) ;
RegCloseKey ( comp ) ;
sprintf ( keypath , keyfmt , " S-1-5-18 " , " 241C3DA58FECD0945B9687D408766058 " ) ;
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , keypath , 0 , access , & comp ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
size = MAX_PATH ;
res = RegQueryValueExA ( comp , " 84A88FD7F6998CE40A22FB59F6B9C2BB " ,
NULL , NULL , ( LPBYTE ) val , & size ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
ok ( ! lstrcmpA ( val , " 01 \\ msitest \\ augustus " ) ,
" Expected \" 01 \\ msitest \\ augustus \" , got \" %s \" \n " , val ) ;
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , compkey , 0 , access , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
RegDeleteValueA ( comp , " 84A88FD7F6998CE40A22FB59F6B9C2BB " ) ;
delete_key ( comp , " " , access ) ;
RegCloseKey ( comp ) ;
error :
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
DeleteFileA ( " msitest \\ maximus " ) ;
RemoveDirectoryA ( " msitest " ) ;
2010-10-14 11:06:13 +02:00
LocalFree ( usersid ) ;
}
static void test_publish ( void )
{
2013-01-09 11:44:19 +01:00
static const char subkey [ ] = " Software \\ Microsoft \\ Windows \\ CurrentVersion \\ Uninstall " ;
static const char subkey_32node [ ] = " Software \\ Wow6432Node \\ Microsoft \\ Windows \\ CurrentVersion \\ Uninstall " ;
2010-10-14 11:06:13 +02:00
UINT r ;
LONG res ;
HKEY uninstall , prodkey , uninstall_32node = NULL ;
INSTALLSTATE state ;
2013-01-09 11:44:19 +01:00
char date [ MAX_PATH ] , temp [ MAX_PATH ] , prodcode [ ] = " {7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ;
2010-10-14 11:06:13 +02:00
REGSAM access = KEY_ALL_ACCESS ;
2013-01-09 11:44:19 +01:00
DWORD error ;
2010-10-14 11:06:13 +02:00
2013-01-09 11:44:19 +01:00
if ( ! pMsiQueryFeatureStateExA )
2010-10-14 11:06:13 +02:00
{
2013-01-09 11:44:19 +01:00
win_skip ( " MsiQueryFeatureStateExA is not available \n " ) ;
2010-10-14 11:06:13 +02:00
return ;
}
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
get_date_str ( date ) ;
2013-10-15 13:04:45 +02:00
GetTempPathA ( MAX_PATH , temp ) ;
2010-10-14 11:06:13 +02:00
if ( is_wow64 )
access | = KEY_WOW64_64KEY ;
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , subkey , 0 , KEY_ALL_ACCESS , & uninstall ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
if ( is_64bit )
{
res = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , subkey_32node , 0 , KEY_ALL_ACCESS , & uninstall_32node ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
}
CreateDirectoryA ( " msitest " , NULL ) ;
create_file ( " msitest \\ maximus " , 500 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , pp_tables , ARRAY_SIZE ( pp_tables ) ) ;
2010-10-14 11:06:13 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryProductStateA ( prodcode ) ;
2013-01-09 11:44:19 +01:00
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " feature " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
2013-01-09 11:44:19 +01:00
state = 0xdead ;
SetLastError ( 0xdeadbeef ) ;
r = pMsiQueryFeatureStateExA ( prodcode , NULL , MSIINSTALLCONTEXT_MACHINE , " feature " , & state ) ;
error = GetLastError ( ) ;
ok ( r = = ERROR_UNKNOWN_PRODUCT , " got %u \n " , r ) ;
ok ( state = = 0xdead , " got %d \n " , state ) ;
ok ( error = = 0xdeadbeef , " got %u \n " , error ) ;
state = 0xdead ;
SetLastError ( 0xdeadbeef ) ;
r = pMsiQueryFeatureStateExA ( prodcode , NULL , MSIINSTALLCONTEXT_USERMANAGED , " feature " , & state ) ;
error = GetLastError ( ) ;
ok ( r = = ERROR_UNKNOWN_PRODUCT , " got %u \n " , r ) ;
ok ( state = = 0xdead , " got %d \n " , state ) ;
ok ( error = = ERROR_SUCCESS , " got %u \n " , error ) ;
state = 0xdead ;
SetLastError ( 0xdeadbeef ) ;
r = pMsiQueryFeatureStateExA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED , " feature " , & state ) ;
error = GetLastError ( ) ;
ok ( r = = ERROR_UNKNOWN_PRODUCT , " got %u \n " , r ) ;
ok ( state = = 0xdead , " got %d \n " , state ) ;
ok ( error = = ERROR_SUCCESS , " got %u \n " , error ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " feature " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " montecristo " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
r = pMsiQueryComponentStateA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
" {DF2CBABC-3BCC-47E5-A998-448D1C0C895B} " , & state ) ;
ok ( r = = ERROR_UNKNOWN_PRODUCT , " Expected ERROR_UNKNOWN_PRODUCT, got %d \n " , r ) ;
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
res = RegOpenKeyExA ( uninstall , prodcode , 0 , access , & prodkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
/* nothing published */
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( pf_exists ( " msitest \\ maximus " ) , " File not installed \n " ) ;
ok ( pf_exists ( " msitest " ) , " File not installed \n " ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryProductStateA ( prodcode ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " feature " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " montecristo " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
r = pMsiQueryComponentStateA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
" {DF2CBABC-3BCC-47E5-A998-448D1C0C895B} " , & state ) ;
ok ( r = = ERROR_UNKNOWN_PRODUCT , " Expected ERROR_UNKNOWN_PRODUCT, got %d \n " , r ) ;
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
res = RegOpenKeyExA ( uninstall , prodcode , 0 , access , & prodkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
/* PublishProduct and RegisterProduct */
r = MsiInstallProductA ( msifile , " REGISTER_PRODUCT=1 PUBLISH_PRODUCT=1 " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( pf_exists ( " msitest \\ maximus " ) , " File not installed \n " ) ;
ok ( pf_exists ( " msitest " ) , " File not installed \n " ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryProductStateA ( prodcode ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_DEFAULT , " Expected INSTALLSTATE_DEFAULT, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " feature " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " montecristo " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
r = pMsiQueryComponentStateA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
" {DF2CBABC-3BCC-47E5-A998-448D1C0C895B} " , & state ) ;
ok ( r = = ERROR_UNKNOWN_COMPONENT , " Expected ERROR_UNKNOWN_COMPONENT, got %d \n " , r ) ;
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
2010-12-20 01:48:13 +01:00
if ( is_64bit )
2010-10-14 11:06:13 +02:00
{
res = RegOpenKeyExA ( uninstall_32node , prodcode , 0 , KEY_ALL_ACCESS , & prodkey ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
}
else
{
res = RegOpenKeyExA ( uninstall , prodcode , 0 , access , & prodkey ) ;
2011-01-03 01:06:08 +01:00
if ( is_wow64 & & res = = ERROR_FILE_NOT_FOUND ) /* XP - Vista, Wow64 */
res = RegOpenKeyExA ( uninstall , prodcode , 0 , KEY_ALL_ACCESS , & prodkey ) ;
2010-10-14 11:06:13 +02:00
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
}
CHECK_REG_STR ( prodkey , " DisplayName " , " MSITEST " ) ;
CHECK_REG_STR ( prodkey , " DisplayVersion " , " 1.1.1 " ) ;
CHECK_REG_STR ( prodkey , " InstallDate " , date ) ;
CHECK_REG_STR ( prodkey , " InstallSource " , temp ) ;
2018-09-27 15:00:31 +02:00
CHECK_REG_ISTR ( prodkey , " ModifyPath " , " MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ) ;
2010-10-14 11:06:13 +02:00
CHECK_REG_STR ( prodkey , " Publisher " , " Wine " ) ;
2018-09-27 15:00:31 +02:00
CHECK_REG_STR ( prodkey , " UninstallString " , " MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ) ;
2010-10-14 11:06:13 +02:00
CHECK_REG_STR ( prodkey , " AuthorizedCDFPrefix " , NULL ) ;
CHECK_REG_STR ( prodkey , " Comments " , NULL ) ;
CHECK_REG_STR ( prodkey , " Contact " , NULL ) ;
CHECK_REG_STR ( prodkey , " HelpLink " , NULL ) ;
CHECK_REG_STR ( prodkey , " HelpTelephone " , NULL ) ;
CHECK_REG_STR ( prodkey , " InstallLocation " , NULL ) ;
2018-09-27 15:00:31 +02:00
CHECK_REG_DWORD ( prodkey , " NoModify " , 1 ) ;
2010-10-14 11:06:13 +02:00
CHECK_REG_STR ( prodkey , " Readme " , NULL ) ;
CHECK_REG_STR ( prodkey , " Size " , NULL ) ;
CHECK_REG_STR ( prodkey , " URLInfoAbout " , NULL ) ;
CHECK_REG_STR ( prodkey , " URLUpdateInfo " , NULL ) ;
CHECK_REG_DWORD ( prodkey , " Language " , 1033 ) ;
CHECK_REG_DWORD ( prodkey , " Version " , 0x1010001 ) ;
CHECK_REG_DWORD ( prodkey , " VersionMajor " , 1 ) ;
CHECK_REG_DWORD ( prodkey , " VersionMinor " , 1 ) ;
CHECK_REG_DWORD ( prodkey , " WindowsInstaller " , 1 ) ;
todo_wine
2018-05-14 17:01:30 +02:00
CHECK_REG_DWORD ( prodkey , " EstimatedSize " , get_estimated_size ( ) ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( prodkey ) ;
r = MsiInstallProductA ( msifile , " FULL=1 REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( pf_exists ( " msitest \\ maximus " ) , " File deleted \n " ) ;
ok ( pf_exists ( " msitest " ) , " File deleted \n " ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryProductStateA ( prodcode ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " feature " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " montecristo " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
r = pMsiQueryComponentStateA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
" {DF2CBABC-3BCC-47E5-A998-448D1C0C895B} " , & state ) ;
ok ( r = = ERROR_UNKNOWN_PRODUCT , " Expected ERROR_UNKNOWN_PRODUCT, got %d \n " , r ) ;
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
res = RegOpenKeyExA ( uninstall , prodcode , 0 , access , & prodkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
/* complete install */
r = MsiInstallProductA ( msifile , " FULL=1 " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( pf_exists ( " msitest \\ maximus " ) , " File not installed \n " ) ;
ok ( pf_exists ( " msitest " ) , " File not installed \n " ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryProductStateA ( prodcode ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_DEFAULT , " Expected INSTALLSTATE_DEFAULT, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " feature " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_LOCAL , " Expected INSTALLSTATE_LOCAL, got %d \n " , state ) ;
2013-01-09 11:44:19 +01:00
state = 0xdead ;
SetLastError ( 0xdeadbeef ) ;
r = pMsiQueryFeatureStateExA ( prodcode , NULL , MSIINSTALLCONTEXT_MACHINE , " feature " , & state ) ;
error = GetLastError ( ) ;
ok ( r = = ERROR_UNKNOWN_PRODUCT , " got %u \n " , r ) ;
ok ( state = = 0xdead , " got %d \n " , state ) ;
ok ( error = = 0xdeadbeef , " got %u \n " , error ) ;
state = 0xdead ;
SetLastError ( 0xdeadbeef ) ;
r = pMsiQueryFeatureStateExA ( prodcode , NULL , MSIINSTALLCONTEXT_USERMANAGED , " feature " , & state ) ;
error = GetLastError ( ) ;
ok ( r = = ERROR_UNKNOWN_PRODUCT , " got %u \n " , r ) ;
ok ( state = = 0xdead , " got %d \n " , state ) ;
ok ( error = = ERROR_SUCCESS , " got %u \n " , error ) ;
state = 0xdead ;
SetLastError ( 0xdeadbeef ) ;
r = pMsiQueryFeatureStateExA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED , " feature " , & state ) ;
error = GetLastError ( ) ;
ok ( r = = ERROR_SUCCESS , " got %u \n " , r ) ;
ok ( state = = INSTALLSTATE_LOCAL , " got %d \n " , state ) ;
ok ( error = = ERROR_SUCCESS , " got %u \n " , error ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " montecristo " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_LOCAL , " Expected INSTALLSTATE_LOCAL, got %d \n " , state ) ;
r = pMsiQueryComponentStateA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
" {DF2CBABC-3BCC-47E5-A998-448D1C0C895B} " , & state ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( state = = INSTALLSTATE_LOCAL , " Expected INSTALLSTATE_LOCAL, got %d \n " , state ) ;
2011-03-30 12:31:57 +02:00
if ( is_64bit )
2010-10-14 11:06:13 +02:00
{
res = RegOpenKeyExA ( uninstall_32node , prodcode , 0 , KEY_ALL_ACCESS , & prodkey ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
}
else
{
res = RegOpenKeyExA ( uninstall , prodcode , 0 , KEY_ALL_ACCESS , & prodkey ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
}
CHECK_REG_STR ( prodkey , " DisplayName " , " MSITEST " ) ;
CHECK_REG_STR ( prodkey , " DisplayVersion " , " 1.1.1 " ) ;
CHECK_REG_STR ( prodkey , " InstallDate " , date ) ;
CHECK_REG_STR ( prodkey , " InstallSource " , temp ) ;
2018-09-27 15:00:31 +02:00
CHECK_REG_ISTR ( prodkey , " ModifyPath " , " MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ) ;
2010-10-14 11:06:13 +02:00
CHECK_REG_STR ( prodkey , " Publisher " , " Wine " ) ;
2018-09-27 15:00:31 +02:00
CHECK_REG_STR ( prodkey , " UninstallString " , " MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ) ;
2010-10-14 11:06:13 +02:00
CHECK_REG_STR ( prodkey , " AuthorizedCDFPrefix " , NULL ) ;
CHECK_REG_STR ( prodkey , " Comments " , NULL ) ;
CHECK_REG_STR ( prodkey , " Contact " , NULL ) ;
CHECK_REG_STR ( prodkey , " HelpLink " , NULL ) ;
CHECK_REG_STR ( prodkey , " HelpTelephone " , NULL ) ;
CHECK_REG_STR ( prodkey , " InstallLocation " , NULL ) ;
2018-09-27 15:00:31 +02:00
CHECK_REG_DWORD ( prodkey , " NoModify " , 1 ) ;
2010-10-14 11:06:13 +02:00
CHECK_REG_STR ( prodkey , " Readme " , NULL ) ;
CHECK_REG_STR ( prodkey , " Size " , NULL ) ;
CHECK_REG_STR ( prodkey , " URLInfoAbout " , NULL ) ;
CHECK_REG_STR ( prodkey , " URLUpdateInfo " , NULL ) ;
CHECK_REG_DWORD ( prodkey , " Language " , 1033 ) ;
CHECK_REG_DWORD ( prodkey , " Version " , 0x1010001 ) ;
CHECK_REG_DWORD ( prodkey , " VersionMajor " , 1 ) ;
CHECK_REG_DWORD ( prodkey , " VersionMinor " , 1 ) ;
CHECK_REG_DWORD ( prodkey , " WindowsInstaller " , 1 ) ;
todo_wine
2018-05-14 17:01:30 +02:00
CHECK_REG_DWORD ( prodkey , " EstimatedSize " , get_estimated_size ( ) ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( prodkey ) ;
/* no UnpublishFeatures */
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( ! pf_exists ( " msitest \\ maximus " ) , " File not deleted \n " ) ;
ok ( ! pf_exists ( " msitest " ) , " Directory not deleted \n " ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryProductStateA ( prodcode ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " feature " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " montecristo " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
r = pMsiQueryComponentStateA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
" {DF2CBABC-3BCC-47E5-A998-448D1C0C895B} " , & state ) ;
ok ( r = = ERROR_UNKNOWN_PRODUCT , " Expected ERROR_UNKNOWN_PRODUCT, got %d \n " , r ) ;
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
res = RegOpenKeyExA ( uninstall , prodcode , 0 , access , & prodkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
/* complete install */
r = MsiInstallProductA ( msifile , " FULL=1 " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( pf_exists ( " msitest \\ maximus " ) , " File not installed \n " ) ;
ok ( pf_exists ( " msitest " ) , " File not installed \n " ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryProductStateA ( prodcode ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_DEFAULT , " Expected INSTALLSTATE_DEFAULT, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " feature " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_LOCAL , " Expected INSTALLSTATE_LOCAL, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " montecristo " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_LOCAL , " Expected INSTALLSTATE_LOCAL, got %d \n " , state ) ;
r = pMsiQueryComponentStateA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
" {DF2CBABC-3BCC-47E5-A998-448D1C0C895B} " , & state ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( state = = INSTALLSTATE_LOCAL , " Expected INSTALLSTATE_LOCAL, got %d \n " , state ) ;
2011-03-30 12:31:57 +02:00
if ( is_64bit )
2010-10-14 11:06:13 +02:00
{
res = RegOpenKeyExA ( uninstall_32node , prodcode , 0 , KEY_ALL_ACCESS , & prodkey ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
}
else
{
res = RegOpenKeyExA ( uninstall , prodcode , 0 , KEY_ALL_ACCESS , & prodkey ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
}
CHECK_REG_STR ( prodkey , " DisplayName " , " MSITEST " ) ;
CHECK_REG_STR ( prodkey , " DisplayVersion " , " 1.1.1 " ) ;
CHECK_REG_STR ( prodkey , " InstallDate " , date ) ;
CHECK_REG_STR ( prodkey , " InstallSource " , temp ) ;
2018-09-27 15:00:31 +02:00
CHECK_REG_ISTR ( prodkey , " ModifyPath " , " MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ) ;
2010-10-14 11:06:13 +02:00
CHECK_REG_STR ( prodkey , " Publisher " , " Wine " ) ;
2018-09-27 15:00:31 +02:00
CHECK_REG_STR ( prodkey , " UninstallString " , " MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ) ;
2010-10-14 11:06:13 +02:00
CHECK_REG_STR ( prodkey , " AuthorizedCDFPrefix " , NULL ) ;
CHECK_REG_STR ( prodkey , " Comments " , NULL ) ;
CHECK_REG_STR ( prodkey , " Contact " , NULL ) ;
CHECK_REG_STR ( prodkey , " HelpLink " , NULL ) ;
CHECK_REG_STR ( prodkey , " HelpTelephone " , NULL ) ;
CHECK_REG_STR ( prodkey , " InstallLocation " , NULL ) ;
2018-09-27 15:00:31 +02:00
CHECK_REG_DWORD ( prodkey , " NoModify " , 1 ) ;
2010-10-14 11:06:13 +02:00
CHECK_REG_STR ( prodkey , " Readme " , NULL ) ;
CHECK_REG_STR ( prodkey , " Size " , NULL ) ;
CHECK_REG_STR ( prodkey , " URLInfoAbout " , NULL ) ;
CHECK_REG_STR ( prodkey , " URLUpdateInfo " , NULL ) ;
CHECK_REG_DWORD ( prodkey , " Language " , 1033 ) ;
CHECK_REG_DWORD ( prodkey , " Version " , 0x1010001 ) ;
CHECK_REG_DWORD ( prodkey , " VersionMajor " , 1 ) ;
CHECK_REG_DWORD ( prodkey , " VersionMinor " , 1 ) ;
CHECK_REG_DWORD ( prodkey , " WindowsInstaller " , 1 ) ;
todo_wine
2018-05-14 17:01:30 +02:00
CHECK_REG_DWORD ( prodkey , " EstimatedSize " , get_estimated_size ( ) ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( prodkey ) ;
/* UnpublishFeatures, only feature removed. Only works when entire product is removed */
r = MsiInstallProductA ( msifile , " UNPUBLISH_FEATURES=1 REMOVE=feature " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( pf_exists ( " msitest \\ maximus " ) , " File deleted \n " ) ;
ok ( pf_exists ( " msitest " ) , " Directory deleted \n " ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryProductStateA ( prodcode ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_DEFAULT , " Expected INSTALLSTATE_DEFAULT, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " feature " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_LOCAL , " Expected INSTALLSTATE_LOCAL, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " montecristo " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_LOCAL , " Expected INSTALLSTATE_LOCAL, got %d \n " , state ) ;
r = pMsiQueryComponentStateA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
" {DF2CBABC-3BCC-47E5-A998-448D1C0C895B} " , & state ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( state = = INSTALLSTATE_LOCAL , " Expected INSTALLSTATE_LOCAL, got %d \n " , state ) ;
2011-03-30 12:31:57 +02:00
if ( is_64bit )
2010-10-14 11:06:13 +02:00
{
res = RegOpenKeyExA ( uninstall_32node , prodcode , 0 , KEY_ALL_ACCESS , & prodkey ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
}
else
{
res = RegOpenKeyExA ( uninstall , prodcode , 0 , KEY_ALL_ACCESS , & prodkey ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
}
CHECK_REG_STR ( prodkey , " DisplayName " , " MSITEST " ) ;
CHECK_REG_STR ( prodkey , " DisplayVersion " , " 1.1.1 " ) ;
CHECK_REG_STR ( prodkey , " InstallDate " , date ) ;
CHECK_REG_STR ( prodkey , " InstallSource " , temp ) ;
2018-09-27 15:00:31 +02:00
CHECK_REG_ISTR ( prodkey , " ModifyPath " , " MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ) ;
2010-10-14 11:06:13 +02:00
CHECK_REG_STR ( prodkey , " Publisher " , " Wine " ) ;
2018-09-27 15:00:31 +02:00
CHECK_REG_STR ( prodkey , " UninstallString " , " MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ) ;
2010-10-14 11:06:13 +02:00
CHECK_REG_STR ( prodkey , " AuthorizedCDFPrefix " , NULL ) ;
CHECK_REG_STR ( prodkey , " Comments " , NULL ) ;
CHECK_REG_STR ( prodkey , " Contact " , NULL ) ;
CHECK_REG_STR ( prodkey , " HelpLink " , NULL ) ;
CHECK_REG_STR ( prodkey , " HelpTelephone " , NULL ) ;
CHECK_REG_STR ( prodkey , " InstallLocation " , NULL ) ;
2018-09-27 15:00:31 +02:00
CHECK_REG_DWORD ( prodkey , " NoModify " , 1 ) ;
2010-10-14 11:06:13 +02:00
CHECK_REG_STR ( prodkey , " Readme " , NULL ) ;
CHECK_REG_STR ( prodkey , " Size " , NULL ) ;
CHECK_REG_STR ( prodkey , " URLInfoAbout " , NULL ) ;
CHECK_REG_STR ( prodkey , " URLUpdateInfo " , NULL ) ;
CHECK_REG_DWORD ( prodkey , " Language " , 1033 ) ;
CHECK_REG_DWORD ( prodkey , " Version " , 0x1010001 ) ;
CHECK_REG_DWORD ( prodkey , " VersionMajor " , 1 ) ;
CHECK_REG_DWORD ( prodkey , " VersionMinor " , 1 ) ;
CHECK_REG_DWORD ( prodkey , " WindowsInstaller " , 1 ) ;
todo_wine
2018-05-14 17:01:30 +02:00
CHECK_REG_DWORD ( prodkey , " EstimatedSize " , get_estimated_size ( ) ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( prodkey ) ;
/* complete install */
r = MsiInstallProductA ( msifile , " FULL=1 " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( pf_exists ( " msitest \\ maximus " ) , " File not installed \n " ) ;
ok ( pf_exists ( " msitest " ) , " File not installed \n " ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryProductStateA ( prodcode ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_DEFAULT , " Expected INSTALLSTATE_DEFAULT, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " feature " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_LOCAL , " Expected INSTALLSTATE_LOCAL, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " montecristo " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_LOCAL , " Expected INSTALLSTATE_LOCAL, got %d \n " , state ) ;
r = pMsiQueryComponentStateA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
" {DF2CBABC-3BCC-47E5-A998-448D1C0C895B} " , & state ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( state = = INSTALLSTATE_LOCAL , " Expected INSTALLSTATE_LOCAL, got %d \n " , state ) ;
2011-03-30 12:31:57 +02:00
if ( is_64bit )
2010-10-14 11:06:13 +02:00
{
res = RegOpenKeyExA ( uninstall_32node , prodcode , 0 , KEY_ALL_ACCESS , & prodkey ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
}
else
{
res = RegOpenKeyExA ( uninstall , prodcode , 0 , KEY_ALL_ACCESS , & prodkey ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
}
CHECK_REG_STR ( prodkey , " DisplayName " , " MSITEST " ) ;
CHECK_REG_STR ( prodkey , " DisplayVersion " , " 1.1.1 " ) ;
CHECK_REG_STR ( prodkey , " InstallDate " , date ) ;
CHECK_REG_STR ( prodkey , " InstallSource " , temp ) ;
2018-09-27 15:00:31 +02:00
CHECK_REG_ISTR ( prodkey , " ModifyPath " , " MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ) ;
2010-10-14 11:06:13 +02:00
CHECK_REG_STR ( prodkey , " Publisher " , " Wine " ) ;
2018-09-27 15:00:31 +02:00
CHECK_REG_STR ( prodkey , " UninstallString " , " MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ) ;
2010-10-14 11:06:13 +02:00
CHECK_REG_STR ( prodkey , " AuthorizedCDFPrefix " , NULL ) ;
CHECK_REG_STR ( prodkey , " Comments " , NULL ) ;
CHECK_REG_STR ( prodkey , " Contact " , NULL ) ;
CHECK_REG_STR ( prodkey , " HelpLink " , NULL ) ;
CHECK_REG_STR ( prodkey , " HelpTelephone " , NULL ) ;
CHECK_REG_STR ( prodkey , " InstallLocation " , NULL ) ;
2018-09-27 15:00:31 +02:00
CHECK_REG_DWORD ( prodkey , " NoModify " , 1 ) ;
2010-10-14 11:06:13 +02:00
CHECK_REG_STR ( prodkey , " Readme " , NULL ) ;
CHECK_REG_STR ( prodkey , " Size " , NULL ) ;
CHECK_REG_STR ( prodkey , " URLInfoAbout " , NULL ) ;
CHECK_REG_STR ( prodkey , " URLUpdateInfo " , NULL ) ;
CHECK_REG_DWORD ( prodkey , " Language " , 1033 ) ;
CHECK_REG_DWORD ( prodkey , " Version " , 0x1010001 ) ;
CHECK_REG_DWORD ( prodkey , " VersionMajor " , 1 ) ;
CHECK_REG_DWORD ( prodkey , " VersionMinor " , 1 ) ;
CHECK_REG_DWORD ( prodkey , " WindowsInstaller " , 1 ) ;
todo_wine
2018-05-14 17:01:30 +02:00
CHECK_REG_DWORD ( prodkey , " EstimatedSize " , get_estimated_size ( ) ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( prodkey ) ;
/* UnpublishFeatures, both features removed */
r = MsiInstallProductA ( msifile , " UNPUBLISH_FEATURES=1 REMOVE=feature,montecristo " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( ! pf_exists ( " msitest \\ maximus " ) , " File not deleted \n " ) ;
ok ( ! pf_exists ( " msitest " ) , " Directory not deleted \n " ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryProductStateA ( prodcode ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " feature " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " montecristo " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
r = pMsiQueryComponentStateA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
" {DF2CBABC-3BCC-47E5-A998-448D1C0C895B} " , & state ) ;
ok ( r = = ERROR_UNKNOWN_PRODUCT , " Expected ERROR_UNKNOWN_PRODUCT, got %d \n " , r ) ;
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
res = RegOpenKeyExA ( uninstall , prodcode , 0 , access , & prodkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
/* complete install */
r = MsiInstallProductA ( msifile , " FULL=1 " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( pf_exists ( " msitest \\ maximus " ) , " File not installed \n " ) ;
ok ( pf_exists ( " msitest " ) , " File not installed \n " ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryProductStateA ( prodcode ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_DEFAULT , " Expected INSTALLSTATE_DEFAULT, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " feature " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_LOCAL , " Expected INSTALLSTATE_LOCAL, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " montecristo " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_LOCAL , " Expected INSTALLSTATE_LOCAL, got %d \n " , state ) ;
r = pMsiQueryComponentStateA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
" {DF2CBABC-3BCC-47E5-A998-448D1C0C895B} " , & state ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( state = = INSTALLSTATE_LOCAL , " Expected INSTALLSTATE_LOCAL, got %d \n " , state ) ;
2011-03-30 12:31:57 +02:00
if ( is_64bit )
2010-10-14 11:06:13 +02:00
{
res = RegOpenKeyExA ( uninstall_32node , prodcode , 0 , KEY_ALL_ACCESS , & prodkey ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
}
else
{
res = RegOpenKeyExA ( uninstall , prodcode , 0 , KEY_ALL_ACCESS , & prodkey ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
}
CHECK_REG_STR ( prodkey , " DisplayName " , " MSITEST " ) ;
CHECK_REG_STR ( prodkey , " DisplayVersion " , " 1.1.1 " ) ;
CHECK_REG_STR ( prodkey , " InstallDate " , date ) ;
CHECK_REG_STR ( prodkey , " InstallSource " , temp ) ;
2018-09-27 15:00:31 +02:00
CHECK_REG_ISTR ( prodkey , " ModifyPath " , " MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ) ;
2010-10-14 11:06:13 +02:00
CHECK_REG_STR ( prodkey , " Publisher " , " Wine " ) ;
2018-09-27 15:00:31 +02:00
CHECK_REG_STR ( prodkey , " UninstallString " , " MsiExec.exe /X{7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ) ;
2010-10-14 11:06:13 +02:00
CHECK_REG_STR ( prodkey , " AuthorizedCDFPrefix " , NULL ) ;
CHECK_REG_STR ( prodkey , " Comments " , NULL ) ;
CHECK_REG_STR ( prodkey , " Contact " , NULL ) ;
CHECK_REG_STR ( prodkey , " HelpLink " , NULL ) ;
CHECK_REG_STR ( prodkey , " HelpTelephone " , NULL ) ;
CHECK_REG_STR ( prodkey , " InstallLocation " , NULL ) ;
2018-09-27 15:00:31 +02:00
CHECK_REG_DWORD ( prodkey , " NoModify " , 1 ) ;
2010-10-14 11:06:13 +02:00
CHECK_REG_STR ( prodkey , " Readme " , NULL ) ;
CHECK_REG_STR ( prodkey , " Size " , NULL ) ;
CHECK_REG_STR ( prodkey , " URLInfoAbout " , NULL ) ;
CHECK_REG_STR ( prodkey , " URLUpdateInfo " , NULL ) ;
CHECK_REG_DWORD ( prodkey , " Language " , 1033 ) ;
CHECK_REG_DWORD ( prodkey , " Version " , 0x1010001 ) ;
CHECK_REG_DWORD ( prodkey , " VersionMajor " , 1 ) ;
CHECK_REG_DWORD ( prodkey , " VersionMinor " , 1 ) ;
CHECK_REG_DWORD ( prodkey , " WindowsInstaller " , 1 ) ;
todo_wine
2018-05-14 17:01:30 +02:00
CHECK_REG_DWORD ( prodkey , " EstimatedSize " , get_estimated_size ( ) ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( prodkey ) ;
/* complete uninstall */
r = MsiInstallProductA ( msifile , " FULL=1 REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( ! pf_exists ( " msitest \\ maximus " ) , " File not deleted \n " ) ;
ok ( ! pf_exists ( " msitest " ) , " Directory not deleted \n " ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryProductStateA ( prodcode ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " feature " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
2013-10-15 13:04:45 +02:00
state = MsiQueryFeatureStateA ( prodcode , " montecristo " ) ;
2010-10-14 11:06:13 +02:00
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
r = pMsiQueryComponentStateA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
" {DF2CBABC-3BCC-47E5-A998-448D1C0C895B} " , & state ) ;
ok ( r = = ERROR_UNKNOWN_PRODUCT , " Expected ERROR_UNKNOWN_PRODUCT, got %d \n " , r ) ;
ok ( state = = INSTALLSTATE_UNKNOWN , " Expected INSTALLSTATE_UNKNOWN, got %d \n " , state ) ;
res = RegOpenKeyExA ( uninstall , prodcode , 0 , access , & prodkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
/* make sure 'Program Files\msitest' is removed */
delete_pfmsitest_files ( ) ;
error :
RegCloseKey ( uninstall ) ;
RegCloseKey ( uninstall_32node ) ;
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
DeleteFileA ( " msitest \\ maximus " ) ;
RemoveDirectoryA ( " msitest " ) ;
2010-10-14 11:06:13 +02:00
}
static void test_publish_sourcelist ( void )
{
UINT r ;
DWORD size ;
CHAR value [ MAX_PATH ] ;
CHAR path [ MAX_PATH ] ;
CHAR prodcode [ ] = " {7DF88A48-996F-4EC8-A022-BF956F9B2CBB} " ;
if ( ! pMsiSourceListEnumSourcesA | | ! pMsiSourceListGetInfoA )
{
win_skip ( " MsiSourceListEnumSourcesA and/or MsiSourceListGetInfoA are not available \n " ) ;
return ;
}
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
CreateDirectoryA ( " msitest " , NULL ) ;
create_file ( " msitest \\ maximus " , 500 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , pp_tables , ARRAY_SIZE ( pp_tables ) ) ;
2010-10-14 11:06:13 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( pf_exists ( " msitest \\ maximus " ) , " File not installed \n " ) ;
ok ( pf_exists ( " msitest " ) , " File not installed \n " ) ;
/* nothing published */
size = MAX_PATH ;
lstrcpyA ( value , " aaa " ) ;
r = pMsiSourceListGetInfoA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
2013-10-15 13:04:45 +02:00
MSICODE_PRODUCT , INSTALLPROPERTY_PACKAGENAMEA , value , & size ) ;
2010-10-14 11:06:13 +02:00
ok ( r = = ERROR_UNKNOWN_PRODUCT , " Expected ERROR_UNKNOWN_PRODUCT, got %d \n " , r ) ;
ok ( size = = MAX_PATH , " Expected %d, got %d \n " , MAX_PATH , size ) ;
ok ( ! lstrcmpA ( value , " aaa " ) , " Expected \" aaa \" , got \" %s \" \n " , value ) ;
size = MAX_PATH ;
lstrcpyA ( value , " aaa " ) ;
r = pMsiSourceListEnumSourcesA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
MSICODE_PRODUCT | MSISOURCETYPE_URL , 0 , value , & size ) ;
ok ( r = = ERROR_UNKNOWN_PRODUCT , " Expected ERROR_UNKNOWN_PRODUCT, got %d \n " , r ) ;
ok ( size = = MAX_PATH , " Expected %d, got %d \n " , MAX_PATH , size ) ;
ok ( ! lstrcmpA ( value , " aaa " ) , " Expected \" aaa \" , got \" %s \" \n " , value ) ;
r = MsiInstallProductA ( msifile , " REGISTER_PRODUCT=1 " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( pf_exists ( " msitest \\ maximus " ) , " File not installed \n " ) ;
ok ( pf_exists ( " msitest " ) , " File not installed \n " ) ;
/* after RegisterProduct */
size = MAX_PATH ;
lstrcpyA ( value , " aaa " ) ;
r = pMsiSourceListGetInfoA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
2013-10-15 13:04:45 +02:00
MSICODE_PRODUCT , INSTALLPROPERTY_PACKAGENAMEA , value , & size ) ;
2010-10-14 11:06:13 +02:00
ok ( r = = ERROR_UNKNOWN_PRODUCT , " Expected ERROR_UNKNOWN_PRODUCT, got %d \n " , r ) ;
ok ( size = = MAX_PATH , " Expected %d, got %d \n " , MAX_PATH , size ) ;
ok ( ! lstrcmpA ( value , " aaa " ) , " Expected \" aaa \" , got \" %s \" \n " , value ) ;
size = MAX_PATH ;
lstrcpyA ( value , " aaa " ) ;
r = pMsiSourceListEnumSourcesA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
MSICODE_PRODUCT | MSISOURCETYPE_URL , 0 , value , & size ) ;
ok ( r = = ERROR_UNKNOWN_PRODUCT , " Expected ERROR_UNKNOWN_PRODUCT, got %d \n " , r ) ;
ok ( size = = MAX_PATH , " Expected %d, got %d \n " , MAX_PATH , size ) ;
ok ( ! lstrcmpA ( value , " aaa " ) , " Expected \" aaa \" , got \" %s \" \n " , value ) ;
r = MsiInstallProductA ( msifile , " PROCESS_COMPONENTS=1 " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( pf_exists ( " msitest \\ maximus " ) , " File not installed \n " ) ;
ok ( pf_exists ( " msitest " ) , " File not installed \n " ) ;
/* after ProcessComponents */
size = MAX_PATH ;
lstrcpyA ( value , " aaa " ) ;
r = pMsiSourceListGetInfoA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
2013-10-15 13:04:45 +02:00
MSICODE_PRODUCT , INSTALLPROPERTY_PACKAGENAMEA , value , & size ) ;
2010-10-14 11:06:13 +02:00
ok ( r = = ERROR_UNKNOWN_PRODUCT , " Expected ERROR_UNKNOWN_PRODUCT, got %d \n " , r ) ;
ok ( size = = MAX_PATH , " Expected %d, got %d \n " , MAX_PATH , size ) ;
ok ( ! lstrcmpA ( value , " aaa " ) , " Expected \" aaa \" , got \" %s \" \n " , value ) ;
size = MAX_PATH ;
lstrcpyA ( value , " aaa " ) ;
r = pMsiSourceListEnumSourcesA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
MSICODE_PRODUCT | MSISOURCETYPE_URL , 0 , value , & size ) ;
ok ( r = = ERROR_UNKNOWN_PRODUCT , " Expected ERROR_UNKNOWN_PRODUCT, got %d \n " , r ) ;
ok ( size = = MAX_PATH , " Expected %d, got %d \n " , MAX_PATH , size ) ;
ok ( ! lstrcmpA ( value , " aaa " ) , " Expected \" aaa \" , got \" %s \" \n " , value ) ;
r = MsiInstallProductA ( msifile , " PUBLISH_FEATURES=1 " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( pf_exists ( " msitest \\ maximus " ) , " File not installed \n " ) ;
ok ( pf_exists ( " msitest " ) , " File not installed \n " ) ;
/* after PublishFeatures */
size = MAX_PATH ;
lstrcpyA ( value , " aaa " ) ;
r = pMsiSourceListGetInfoA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
2013-10-15 13:04:45 +02:00
MSICODE_PRODUCT , INSTALLPROPERTY_PACKAGENAMEA , value , & size ) ;
2010-10-14 11:06:13 +02:00
ok ( r = = ERROR_UNKNOWN_PRODUCT , " Expected ERROR_UNKNOWN_PRODUCT, got %d \n " , r ) ;
ok ( size = = MAX_PATH , " Expected %d, got %d \n " , MAX_PATH , size ) ;
ok ( ! lstrcmpA ( value , " aaa " ) , " Expected \" aaa \" , got \" %s \" \n " , value ) ;
size = MAX_PATH ;
lstrcpyA ( value , " aaa " ) ;
r = pMsiSourceListEnumSourcesA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
MSICODE_PRODUCT | MSISOURCETYPE_URL , 0 , value , & size ) ;
ok ( r = = ERROR_UNKNOWN_PRODUCT , " Expected ERROR_UNKNOWN_PRODUCT, got %d \n " , r ) ;
ok ( size = = MAX_PATH , " Expected %d, got %d \n " , MAX_PATH , size ) ;
ok ( ! lstrcmpA ( value , " aaa " ) , " Expected \" aaa \" , got \" %s \" \n " , value ) ;
r = MsiInstallProductA ( msifile , " PUBLISH_PRODUCT=1 " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( pf_exists ( " msitest \\ maximus " ) , " File not installed \n " ) ;
ok ( pf_exists ( " msitest " ) , " File not installed \n " ) ;
/* after PublishProduct */
size = MAX_PATH ;
lstrcpyA ( value , " aaa " ) ;
r = pMsiSourceListGetInfoA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
2013-10-15 13:04:45 +02:00
MSICODE_PRODUCT , INSTALLPROPERTY_PACKAGENAMEA , value , & size ) ;
2010-10-14 11:06:13 +02:00
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( ! lstrcmpA ( value , " msitest.msi " ) , " Expected 'msitest.msi', got %s \n " , value ) ;
ok ( size = = 11 , " Expected 11, got %d \n " , size ) ;
size = MAX_PATH ;
lstrcpyA ( value , " aaa " ) ;
r = pMsiSourceListGetInfoA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
2013-10-15 13:04:45 +02:00
MSICODE_PRODUCT , INSTALLPROPERTY_MEDIAPACKAGEPATHA , value , & size ) ;
2010-10-14 11:06:13 +02:00
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( ! lstrcmpA ( value , " " ) , " Expected \" \" , got \" %s \" \n " , value ) ;
ok ( size = = 0 , " Expected 0, got %d \n " , size ) ;
size = MAX_PATH ;
lstrcpyA ( value , " aaa " ) ;
r = pMsiSourceListGetInfoA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
2013-10-15 13:04:45 +02:00
MSICODE_PRODUCT , INSTALLPROPERTY_DISKPROMPTA , value , & size ) ;
2010-10-14 11:06:13 +02:00
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( ! lstrcmpA ( value , " " ) , " Expected \" \" , got \" %s \" \n " , value ) ;
ok ( size = = 0 , " Expected 0, got %d \n " , size ) ;
lstrcpyA ( path , CURR_DIR ) ;
lstrcatA ( path , " \\ " ) ;
size = MAX_PATH ;
lstrcpyA ( value , " aaa " ) ;
r = pMsiSourceListGetInfoA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
2013-10-15 13:04:45 +02:00
MSICODE_PRODUCT , INSTALLPROPERTY_LASTUSEDSOURCEA , value , & size ) ;
2010-10-14 11:06:13 +02:00
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( ! lstrcmpA ( value , path ) , " Expected \" %s \" , got \" %s \" \n " , path , value ) ;
ok ( size = = lstrlenA ( path ) , " Expected %d, got %d \n " , lstrlenA ( path ) , size ) ;
size = MAX_PATH ;
lstrcpyA ( value , " aaa " ) ;
r = pMsiSourceListGetInfoA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
2013-10-15 13:04:45 +02:00
MSICODE_PRODUCT , INSTALLPROPERTY_LASTUSEDTYPEA , value , & size ) ;
2010-10-14 11:06:13 +02:00
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( ! lstrcmpA ( value , " n " ) , " Expected \" n \" , got \" %s \" \n " , value ) ;
ok ( size = = 1 , " Expected 1, got %d \n " , size ) ;
size = MAX_PATH ;
lstrcpyA ( value , " aaa " ) ;
r = pMsiSourceListEnumSourcesA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
MSICODE_PRODUCT | MSISOURCETYPE_URL , 0 , value , & size ) ;
ok ( r = = ERROR_NO_MORE_ITEMS , " Expected ERROR_NO_MORE_ITEMS, got %d \n " , r ) ;
ok ( ! lstrcmpA ( value , " aaa " ) , " Expected value to be unchanged, got %s \n " , value ) ;
ok ( size = = MAX_PATH , " Expected MAX_PATH, got %d \n " , size ) ;
size = MAX_PATH ;
lstrcpyA ( value , " aaa " ) ;
r = pMsiSourceListEnumSourcesA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
MSICODE_PRODUCT | MSISOURCETYPE_NETWORK , 0 , value , & size ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( ! lstrcmpA ( value , path ) , " Expected \" %s \" , got \" %s \" \n " , path , value ) ;
ok ( size = = lstrlenA ( path ) , " Expected %d, got %d \n " , lstrlenA ( path ) , size ) ;
size = MAX_PATH ;
lstrcpyA ( value , " aaa " ) ;
r = pMsiSourceListEnumSourcesA ( prodcode , NULL , MSIINSTALLCONTEXT_USERUNMANAGED ,
MSICODE_PRODUCT | MSISOURCETYPE_NETWORK , 1 , value , & size ) ;
ok ( r = = ERROR_NO_MORE_ITEMS , " Expected ERROR_NO_MORE_ITEMS, got %d \n " , r ) ;
ok ( ! lstrcmpA ( value , " aaa " ) , " Expected value to be unchanged, got %s \n " , value ) ;
ok ( size = = MAX_PATH , " Expected MAX_PATH, got %d \n " , size ) ;
/* complete uninstall */
r = MsiInstallProductA ( msifile , " FULL=1 REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , r ) ;
ok ( ! pf_exists ( " msitest \\ maximus " ) , " File not deleted \n " ) ;
ok ( ! pf_exists ( " msitest " ) , " Directory not deleted \n " ) ;
/* make sure 'Program Files\msitest' is removed */
delete_pfmsitest_files ( ) ;
error :
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
DeleteFileA ( " msitest \\ maximus " ) ;
RemoveDirectoryA ( " msitest " ) ;
2010-10-14 11:06:13 +02:00
}
static void test_remove_files ( void )
{
UINT r ;
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
CreateDirectoryA ( " msitest " , NULL ) ;
create_file ( " msitest \\ hydrogen " , 500 ) ;
create_file ( " msitest \\ helium " , 500 ) ;
create_file ( " msitest \\ lithium " , 500 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , rem_tables , ARRAY_SIZE ( rem_tables ) ) ;
2010-10-14 11:06:13 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( pf_exists ( " msitest \\ hydrogen " ) , " File not installed \n " ) ;
ok ( ! pf_exists ( " msitest \\ helium " ) , " File installed \n " ) ;
ok ( pf_exists ( " msitest \\ lithium " ) , " File not installed \n " ) ;
ok ( pf_exists ( " msitest " ) , " File not installed \n " ) ;
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( ! pf_exists ( " msitest \\ hydrogen " ) , " File not deleted \n " ) ;
ok ( ! pf_exists ( " msitest \\ helium " ) , " File not deleted \n " ) ;
ok ( delete_pf ( " msitest \\ lithium " , TRUE ) , " File deleted \n " ) ;
2011-09-05 11:48:03 +02:00
ok ( delete_pf ( " msitest " , FALSE ) , " Directory deleted \n " ) ;
2010-10-14 11:06:13 +02:00
create_pf ( " msitest " , FALSE ) ;
create_pf ( " msitest \\ hydrogen " , TRUE ) ;
create_pf ( " msitest \\ helium " , TRUE ) ;
create_pf ( " msitest \\ lithium " , TRUE ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( pf_exists ( " msitest \\ hydrogen " ) , " File not installed \n " ) ;
ok ( pf_exists ( " msitest \\ helium " ) , " File not installed \n " ) ;
ok ( pf_exists ( " msitest \\ lithium " ) , " File not installed \n " ) ;
ok ( pf_exists ( " msitest " ) , " File not installed \n " ) ;
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( ! pf_exists ( " msitest \\ hydrogen " ) , " File not deleted \n " ) ;
ok ( delete_pf ( " msitest \\ helium " , TRUE ) , " File deleted \n " ) ;
ok ( delete_pf ( " msitest \\ lithium " , TRUE ) , " File deleted \n " ) ;
2011-09-05 11:48:03 +02:00
ok ( delete_pf ( " msitest " , FALSE ) , " Directory deleted \n " ) ;
2010-10-14 11:06:13 +02:00
create_pf ( " msitest " , FALSE ) ;
create_pf ( " msitest \\ furlong " , TRUE ) ;
create_pf ( " msitest \\ firkin " , TRUE ) ;
create_pf ( " msitest \\ fortnight " , TRUE ) ;
create_pf ( " msitest \\ becquerel " , TRUE ) ;
create_pf ( " msitest \\ dioptre " , TRUE ) ;
create_pf ( " msitest \\ attoparsec " , TRUE ) ;
create_pf ( " msitest \\ storeys " , TRUE ) ;
create_pf ( " msitest \\ block " , TRUE ) ;
create_pf ( " msitest \\ siriometer " , TRUE ) ;
create_pf ( " msitest \\ cabout " , FALSE ) ;
create_pf ( " msitest \\ cabout \\ blocker " , TRUE ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( pf_exists ( " msitest \\ hydrogen " ) , " File not installed \n " ) ;
ok ( ! pf_exists ( " msitest \\ helium " ) , " File installed \n " ) ;
ok ( pf_exists ( " msitest \\ lithium " ) , " File not installed \n " ) ;
ok ( ! pf_exists ( " msitest \\ furlong " ) , " File not deleted \n " ) ;
ok ( ! pf_exists ( " msitest \\ firkin " ) , " File not deleted \n " ) ;
ok ( ! pf_exists ( " msitest \\ fortnight " ) , " File not deleted \n " ) ;
ok ( pf_exists ( " msitest \\ becquerel " ) , " File not installed \n " ) ;
ok ( pf_exists ( " msitest \\ dioptre " ) , " File not installed \n " ) ;
ok ( pf_exists ( " msitest \\ attoparsec " ) , " File not installed \n " ) ;
ok ( ! pf_exists ( " msitest \\ storeys " ) , " File not deleted \n " ) ;
ok ( ! pf_exists ( " msitest \\ block " ) , " File not deleted \n " ) ;
ok ( ! pf_exists ( " msitest \\ siriometer " ) , " File not deleted \n " ) ;
ok ( pf_exists ( " msitest \\ cabout " ) , " Directory removed \n " ) ;
ok ( pf_exists ( " msitest " ) , " File not installed \n " ) ;
create_pf ( " msitest \\ furlong " , TRUE ) ;
create_pf ( " msitest \\ firkin " , TRUE ) ;
create_pf ( " msitest \\ fortnight " , TRUE ) ;
create_pf ( " msitest \\ storeys " , TRUE ) ;
create_pf ( " msitest \\ block " , TRUE ) ;
create_pf ( " msitest \\ siriometer " , TRUE ) ;
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( ! delete_pf ( " msitest \\ hydrogen " , TRUE ) , " File not deleted \n " ) ;
ok ( ! delete_pf ( " msitest \\ helium " , TRUE ) , " File not deleted \n " ) ;
ok ( delete_pf ( " msitest \\ lithium " , TRUE ) , " File deleted \n " ) ;
ok ( delete_pf ( " msitest \\ furlong " , TRUE ) , " File deleted \n " ) ;
ok ( delete_pf ( " msitest \\ firkin " , TRUE ) , " File deleted \n " ) ;
ok ( delete_pf ( " msitest \\ fortnight " , TRUE ) , " File deleted \n " ) ;
ok ( ! delete_pf ( " msitest \\ becquerel " , TRUE ) , " File not deleted \n " ) ;
ok ( ! delete_pf ( " msitest \\ dioptre " , TRUE ) , " File not deleted \n " ) ;
ok ( delete_pf ( " msitest \\ attoparsec " , TRUE ) , " File deleted \n " ) ;
ok ( ! delete_pf ( " msitest \\ storeys " , TRUE ) , " File not deleted \n " ) ;
ok ( ! delete_pf ( " msitest \\ block " , TRUE ) , " File not deleted \n " ) ;
ok ( delete_pf ( " msitest \\ siriometer " , TRUE ) , " File deleted \n " ) ;
ok ( pf_exists ( " msitest \\ cabout " ) , " Directory deleted \n " ) ;
ok ( pf_exists ( " msitest " ) , " Directory deleted \n " ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( delete_pf ( " msitest \\ hydrogen " , TRUE ) , " File not installed \n " ) ;
ok ( ! delete_pf ( " msitest \\ helium " , TRUE ) , " File installed \n " ) ;
ok ( delete_pf ( " msitest \\ lithium " , TRUE ) , " File not installed \n " ) ;
ok ( pf_exists ( " msitest \\ cabout " ) , " Directory deleted \n " ) ;
ok ( pf_exists ( " msitest " ) , " Directory deleted \n " ) ;
delete_pf ( " msitest \\ cabout \\ blocker " , TRUE ) ;
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( ! delete_pf ( " msitest \\ cabout " , FALSE ) , " Directory not deleted \n " ) ;
2011-06-30 12:14:44 +02:00
delete_pf ( " msitest " , FALSE ) ;
2010-10-14 11:06:13 +02:00
error :
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
DeleteFileA ( " msitest \\ hydrogen " ) ;
DeleteFileA ( " msitest \\ helium " ) ;
DeleteFileA ( " msitest \\ lithium " ) ;
RemoveDirectoryA ( " msitest " ) ;
2010-10-14 11:06:13 +02:00
}
static void test_move_files ( void )
{
UINT r ;
char props [ MAX_PATH ] ;
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
CreateDirectoryA ( " msitest " , NULL ) ;
create_file ( " msitest \\ augustus " , 100 ) ;
create_file ( " cameroon " , 100 ) ;
create_file ( " djibouti " , 100 ) ;
create_file ( " egypt " , 100 ) ;
create_file ( " finland " , 100 ) ;
create_file ( " gambai " , 100 ) ;
create_file ( " honduras " , 100 ) ;
create_file ( " msitest \\ india " , 100 ) ;
create_file ( " japan " , 100 ) ;
create_file ( " kenya " , 100 ) ;
CreateDirectoryA ( " latvia " , NULL ) ;
create_file ( " nauru " , 100 ) ;
create_file ( " peru " , 100 ) ;
create_file ( " apple " , 100 ) ;
create_file ( " application " , 100 ) ;
create_file ( " ape " , 100 ) ;
create_file ( " foo " , 100 ) ;
create_file ( " fao " , 100 ) ;
create_file ( " fbod " , 100 ) ;
create_file ( " budding " , 100 ) ;
create_file ( " buddy " , 100 ) ;
create_file ( " bud " , 100 ) ;
create_file ( " bar " , 100 ) ;
create_file ( " bur " , 100 ) ;
create_file ( " bird " , 100 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , mov_tables , ARRAY_SIZE ( mov_tables ) ) ;
2010-10-14 11:06:13 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
/* if the source or dest property is not a full path,
* windows tries to access it as a network resource
*/
sprintf ( props , " SOURCEFULL= \" %s \\ \" DESTFULL= \" %s \\ msitest \" "
" FILEPATHBAD= \" %s \\ japan \" FILEPATHGOOD= \" %s \\ kenya \" " ,
CURR_DIR , PROG_FILES_DIR , CURR_DIR , CURR_DIR ) ;
r = MsiInstallProductA ( msifile , props ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( delete_pf ( " msitest \\ augustus " , TRUE ) , " File not installed \n " ) ;
ok ( ! delete_pf ( " msitest \\ dest " , TRUE ) , " File copied \n " ) ;
ok ( delete_pf ( " msitest \\ canada " , TRUE ) , " File not copied \n " ) ;
ok ( delete_pf ( " msitest \\ dominica " , TRUE ) , " File not moved \n " ) ;
ok ( ! delete_pf ( " msitest \\ elsalvador " , TRUE ) , " File moved \n " ) ;
ok ( ! delete_pf ( " msitest \\ france " , TRUE ) , " File moved \n " ) ;
ok ( ! delete_pf ( " msitest \\ georgia " , TRUE ) , " File moved \n " ) ;
ok ( delete_pf ( " msitest \\ hungary " , TRUE ) , " File not moved \n " ) ;
ok ( ! delete_pf ( " msitest \\ indonesia " , TRUE ) , " File moved \n " ) ;
ok ( ! delete_pf ( " msitest \\ jordan " , TRUE ) , " File moved \n " ) ;
ok ( delete_pf ( " msitest \\ kiribati " , TRUE ) , " File not moved \n " ) ;
ok ( ! delete_pf ( " msitest \\ lebanon " , TRUE ) , " File moved \n " ) ;
ok ( ! delete_pf ( " msitest \\ lebanon " , FALSE ) , " Directory moved \n " ) ;
ok ( delete_pf ( " msitest \\ poland " , TRUE ) , " File not moved \n " ) ;
/* either apple or application will be moved depending on directory order */
if ( ! delete_pf ( " msitest \\ apple " , TRUE ) )
ok ( delete_pf ( " msitest \\ application " , TRUE ) , " File not moved \n " ) ;
else
ok ( ! delete_pf ( " msitest \\ application " , TRUE ) , " File should not exist \n " ) ;
ok ( delete_pf ( " msitest \\ wildcard " , TRUE ) , " File not moved \n " ) ;
ok ( ! delete_pf ( " msitest \\ ape " , TRUE ) , " File moved \n " ) ;
/* either fao or foo will be moved depending on directory order */
if ( delete_pf ( " msitest \\ foo " , TRUE ) )
ok ( ! delete_pf ( " msitest \\ fao " , TRUE ) , " File should not exist \n " ) ;
else
ok ( delete_pf ( " msitest \\ fao " , TRUE ) , " File not moved \n " ) ;
ok ( delete_pf ( " msitest \\ single " , TRUE ) , " File not moved \n " ) ;
ok ( ! delete_pf ( " msitest \\ fbod " , TRUE ) , " File moved \n " ) ;
ok ( delete_pf ( " msitest \\ budding " , TRUE ) , " File not moved \n " ) ;
ok ( delete_pf ( " msitest \\ buddy " , TRUE ) , " File not moved \n " ) ;
ok ( ! delete_pf ( " msitest \\ bud " , TRUE ) , " File moved \n " ) ;
ok ( delete_pf ( " msitest \\ bar " , TRUE ) , " File not moved \n " ) ;
ok ( delete_pf ( " msitest \\ bur " , TRUE ) , " File not moved \n " ) ;
ok ( ! delete_pf ( " msitest \\ bird " , TRUE ) , " File moved \n " ) ;
2011-09-05 11:48:03 +02:00
ok ( delete_pf ( " msitest " , FALSE ) , " Directory not created \n " ) ;
2010-10-14 11:06:13 +02:00
ok ( DeleteFileA ( " cameroon " ) , " File moved \n " ) ;
ok ( ! DeleteFileA ( " djibouti " ) , " File not moved \n " ) ;
ok ( DeleteFileA ( " egypt " ) , " File moved \n " ) ;
ok ( DeleteFileA ( " finland " ) , " File moved \n " ) ;
ok ( DeleteFileA ( " gambai " ) , " File moved \n " ) ;
ok ( ! DeleteFileA ( " honduras " ) , " File not moved \n " ) ;
ok ( DeleteFileA ( " msitest \\ india " ) , " File moved \n " ) ;
ok ( DeleteFileA ( " japan " ) , " File moved \n " ) ;
ok ( ! DeleteFileA ( " kenya " ) , " File not moved \n " ) ;
ok ( RemoveDirectoryA ( " latvia " ) , " Directory moved \n " ) ;
ok ( ! DeleteFileA ( " nauru " ) , " File not moved \n " ) ;
ok ( ! DeleteFileA ( " peru " ) , " File not moved \n " ) ;
ok ( ! DeleteFileA ( " apple " ) , " File not moved \n " ) ;
ok ( ! DeleteFileA ( " application " ) , " File not moved \n " ) ;
ok ( DeleteFileA ( " ape " ) , " File moved \n " ) ;
ok ( ! DeleteFileA ( " foo " ) , " File not moved \n " ) ;
ok ( ! DeleteFileA ( " fao " ) , " File not moved \n " ) ;
ok ( DeleteFileA ( " fbod " ) , " File moved \n " ) ;
ok ( ! DeleteFileA ( " budding " ) , " File not moved \n " ) ;
ok ( ! DeleteFileA ( " buddy " ) , " File not moved \n " ) ;
ok ( DeleteFileA ( " bud " ) , " File moved \n " ) ;
ok ( ! DeleteFileA ( " bar " ) , " File not moved \n " ) ;
ok ( ! DeleteFileA ( " bur " ) , " File not moved \n " ) ;
ok ( DeleteFileA ( " bird " ) , " File moved \n " ) ;
error :
2013-10-15 13:04:45 +02:00
DeleteFileA ( " cameroon " ) ;
DeleteFileA ( " djibouti " ) ;
DeleteFileA ( " egypt " ) ;
DeleteFileA ( " finland " ) ;
DeleteFileA ( " gambai " ) ;
DeleteFileA ( " honduras " ) ;
DeleteFileA ( " japan " ) ;
DeleteFileA ( " kenya " ) ;
DeleteFileA ( " nauru " ) ;
DeleteFileA ( " peru " ) ;
DeleteFileA ( " apple " ) ;
DeleteFileA ( " application " ) ;
DeleteFileA ( " ape " ) ;
DeleteFileA ( " foo " ) ;
DeleteFileA ( " fao " ) ;
DeleteFileA ( " fbod " ) ;
DeleteFileA ( " budding " ) ;
DeleteFileA ( " buddy " ) ;
DeleteFileA ( " bud " ) ;
DeleteFileA ( " bar " ) ;
DeleteFileA ( " bur " ) ;
DeleteFileA ( " bird " ) ;
DeleteFileA ( " msitest \\ india " ) ;
DeleteFileA ( " msitest \\ augustus " ) ;
RemoveDirectoryA ( " latvia " ) ;
RemoveDirectoryA ( " msitest " ) ;
DeleteFileA ( msifile ) ;
2010-10-14 11:06:13 +02:00
}
static void test_duplicate_files ( void )
{
UINT r ;
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
CreateDirectoryA ( " msitest " , NULL ) ;
create_file ( " msitest \\ maximus " , 500 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , df_tables , ARRAY_SIZE ( df_tables ) ) ;
2010-10-14 11:06:13 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
/* fails if the destination folder is not a valid property */
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( delete_pf ( " msitest \\ maximus " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ augustus " , TRUE ) , " File not duplicated \n " ) ;
ok ( delete_pf ( " msitest \\ this \\ doesnot \\ exist \\ maximus " , TRUE ) , " File not duplicated \n " ) ;
2011-09-05 11:48:03 +02:00
ok ( delete_pf ( " msitest \\ this \\ doesnot \\ exist " , FALSE ) , " Directory not created \n " ) ;
ok ( delete_pf ( " msitest \\ this \\ doesnot " , FALSE ) , " Directory not created \n " ) ;
ok ( delete_pf ( " msitest \\ this " , FALSE ) , " Directory not created \n " ) ;
ok ( delete_pf ( " msitest " , FALSE ) , " Directory not created \n " ) ;
2010-10-14 11:06:13 +02:00
error :
2013-10-15 13:04:45 +02:00
DeleteFileA ( " msitest \\ maximus " ) ;
RemoveDirectoryA ( " msitest " ) ;
DeleteFileA ( msifile ) ;
2010-10-14 11:06:13 +02:00
}
static void test_write_registry_values ( void )
{
2018-06-02 04:48:21 +02:00
HKEY hkey , subkey ;
2010-10-14 11:06:13 +02:00
DWORD type , size ;
2018-06-02 04:48:21 +02:00
char buf [ 20 ] ;
LONG res ;
UINT r ;
2010-10-14 11:06:13 +02:00
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
CreateDirectoryA ( " msitest " , NULL ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , wrv_tables , ARRAY_SIZE ( wrv_tables ) ) ;
2010-10-14 11:06:13 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
2018-06-02 04:48:21 +02:00
res = RegCreateKeyA ( HKEY_CURRENT_USER , " msitest " , & hkey ) ;
2012-11-05 16:30:27 +01:00
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
res = RegSetValueExA ( hkey , " Value1 " , 0 , REG_MULTI_SZ , ( const BYTE * ) " two \0 " , 5 ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
res = RegSetValueExA ( hkey , " Value2 " , 0 , REG_MULTI_SZ , ( const BYTE * ) " one \0 " , 5 ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
res = RegSetValueExA ( hkey , " Value3 " , 0 , REG_MULTI_SZ , ( const BYTE * ) " two \0 " , 5 ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
res = RegSetValueExA ( hkey , " Value4 " , 0 , REG_MULTI_SZ , ( const BYTE * ) " one \0 " , 5 ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
res = RegSetValueExA ( hkey , " Value5 " , 0 , REG_MULTI_SZ , ( const BYTE * ) " one \0 two \0 " , 9 ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
res = RegSetValueExA ( hkey , " Value6 " , 0 , REG_MULTI_SZ , ( const BYTE * ) " one \0 " , 5 ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
res = RegSetValueExA ( hkey , " Value7 " , 0 , REG_SZ , ( const BYTE * ) " one " , 4 ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
2018-06-02 04:48:21 +02:00
res = RegSetValueExA ( hkey , " instremove " , 0 , REG_SZ , ( const BYTE * ) " val " , 3 ) ;
ok ( ! res , " got %u \n " , res ) ;
res = RegCreateKeyA ( hkey , " instremove " , & subkey ) ;
ok ( ! res , " got %u \n " , res ) ;
RegCloseKey ( subkey ) ;
2012-11-05 16:30:27 +01:00
2010-10-14 11:06:13 +02:00
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
2018-06-02 04:48:21 +02:00
CHECK_REG_STR ( hkey , " sz " , " string " ) ;
CHECK_REG_MULTI ( hkey , " multisz " , " one \0 two \0 three \0 " ) ;
CHECK_REG_DWORD ( hkey , " dword " , 123 ) ;
2010-10-14 11:06:13 +02:00
2018-06-02 04:48:21 +02:00
size = sizeof ( buf ) ;
res = RegQueryValueExA ( hkey , " expandsz " , NULL , & type , ( BYTE * ) buf , & size ) ;
ok ( ! res , " got %u \n " , res ) ;
ok ( type = = REG_EXPAND_SZ , " got %d \n " , type ) ;
ok ( ! strcmp ( buf , " string " ) , " got %s \n " , buf ) ;
2012-11-05 16:30:27 +01:00
2018-06-02 04:48:21 +02:00
size = sizeof ( buf ) ;
res = RegQueryValueExA ( hkey , " binary " , NULL , & type , ( BYTE * ) buf , & size ) ;
ok ( ! res , " got %u \n " , res ) ;
ok ( type = = REG_BINARY , " got %d \n " , type ) ;
ok ( size = = 4 , " got size %u \n " , size ) ;
ok ( ! memcmp ( buf , " \x01 \x23 \x45 \x67 " , 4 ) , " wrong data \n " ) ;
2012-11-05 16:30:27 +01:00
2018-06-02 04:48:21 +02:00
CHECK_REG_STR ( hkey , " " , " default " ) ;
2012-11-05 16:30:27 +01:00
2018-06-02 04:48:21 +02:00
res = RegOpenKeyA ( hkey , " VisualStudio " , & subkey ) ;
2012-11-05 16:30:27 +01:00
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
2018-06-02 04:48:21 +02:00
RegCloseKey ( subkey ) ;
CHECK_REG_MULTI ( hkey , " Value1 " , " one \0 " ) ;
CHECK_REG_MULTI ( hkey , " Value2 " , " one \0 two \0 " ) ;
CHECK_REG_MULTI ( hkey , " Value3 " , " one \0 two \0 " ) ;
CHECK_REG_MULTI ( hkey , " Value4 " , " one \0 two \0 " ) ;
CHECK_REG_MULTI ( hkey , " Value5 " , " one \0 two \0 three \0 " ) ;
CHECK_REG_MULTI ( hkey , " Value6 " , " " ) ;
CHECK_REG_MULTI ( hkey , " Value7 " , " two \0 " ) ;
CHECK_REG_DWORD ( hkey , " format " , 1 ) ;
CHECK_REG_DWORD ( hkey , " source " , 1 ) ;
res = RegOpenKeyA ( hkey , " subkey " , & subkey ) ;
ok ( ! res , " got %u \n " , res ) ;
res = RegQueryValueExA ( subkey , " " , NULL , NULL , NULL , NULL ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " got %u \n " , res ) ;
RegCloseKey ( subkey ) ;
res = RegOpenKeyA ( hkey , " create " , & subkey ) ;
ok ( ! res , " got %u \n " , res ) ;
RegCloseKey ( subkey ) ;
res = RegOpenKeyA ( hkey , " delete " , & subkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " got %u \n " , res ) ;
res = RegCreateKeyA ( hkey , " delete " , & subkey ) ;
ok ( ! res , " got %u \n " , res ) ;
RegCloseKey ( subkey ) ;
res = RegQueryValueExA ( hkey , " instremove " , NULL , NULL , NULL , NULL ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " got %u \n " , res ) ;
res = RegOpenKeyA ( hkey , " instremove " , & subkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " got %u \n " , res ) ;
2012-11-05 16:30:27 +01:00
2018-06-02 04:48:21 +02:00
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( ! r , " got %u \n " , r ) ;
2012-11-05 16:30:27 +01:00
2018-06-02 04:48:21 +02:00
res = RegQueryValueExA ( hkey , " sz " , NULL , NULL , NULL , NULL ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " got %u \n " , res ) ;
res = RegQueryValueExA ( hkey , " multisz " , NULL , NULL , NULL , NULL ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " got %u \n " , res ) ;
res = RegQueryValueExA ( hkey , " dword " , NULL , NULL , NULL , NULL ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " got %u \n " , res ) ;
res = RegQueryValueExA ( hkey , " expandsz " , NULL , NULL , NULL , NULL ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " got %u \n " , res ) ;
res = RegQueryValueExA ( hkey , " binary " , NULL , NULL , NULL , NULL ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " got %u \n " , res ) ;
res = RegQueryValueExA ( hkey , " " , NULL , NULL , NULL , NULL ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " got %u \n " , res ) ;
res = RegOpenKeyA ( hkey , " VisualStudio " , & subkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " got %u \n " , res ) ;
res = RegQueryValueExA ( hkey , " Value1 " , NULL , NULL , NULL , NULL ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " got %u \n " , res ) ;
res = RegQueryValueExA ( hkey , " Value4 " , NULL , NULL , NULL , NULL ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " got %u \n " , res ) ;
res = RegQueryValueExA ( hkey , " Value5 " , NULL , NULL , NULL , NULL ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " got %u \n " , res ) ;
res = RegQueryValueExA ( hkey , " Value6 " , NULL , NULL , NULL , NULL ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " got %u \n " , res ) ;
res = RegQueryValueExA ( hkey , " Value7 " , NULL , NULL , NULL , NULL ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " got %u \n " , res ) ;
2012-11-05 16:30:27 +01:00
2018-06-02 04:48:21 +02:00
todo_wine {
CHECK_REG_MULTI ( hkey , " Value2 " , " one \0 " ) ;
CHECK_REG_MULTI ( hkey , " Value3 " , " two \0 " ) ;
}
2012-11-05 16:30:27 +01:00
2018-06-02 04:48:21 +02:00
res = RegQueryValueExA ( hkey , " format " , NULL , NULL , NULL , NULL ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " got %u \n " , res ) ;
res = RegQueryValueExA ( hkey , " source " , NULL , NULL , NULL , NULL ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " got %u \n " , res ) ;
2014-10-30 14:09:06 +01:00
2018-06-02 04:48:21 +02:00
res = RegOpenKeyA ( hkey , " subkey " , & subkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " got %u \n " , res ) ;
2014-10-30 14:09:06 +01:00
2018-06-02 04:48:21 +02:00
res = RegOpenKeyA ( hkey , " create " , & subkey ) ;
ok ( ! res , " got %u \n " , res ) ;
RegCloseKey ( subkey ) ;
res = RegDeleteKeyA ( hkey , " create " ) ;
ok ( ! res , " got %u \n " , res ) ;
2014-10-30 14:09:06 +01:00
2018-06-02 04:48:21 +02:00
res = RegOpenKeyA ( hkey , " delete " , & subkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " got %u \n " , res ) ;
2014-10-30 14:09:06 +01:00
2010-10-14 11:06:13 +02:00
RegCloseKey ( hkey ) ;
2018-06-02 04:48:21 +02:00
res = RegDeleteKeyA ( HKEY_CURRENT_USER , " msitest " ) ;
ok ( ! res , " got %u \n " , res ) ;
2010-10-14 11:06:13 +02:00
error :
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
RemoveDirectoryA ( " msitest " ) ;
2010-10-14 11:06:13 +02:00
}
static void test_envvar ( void )
{
2018-05-31 03:47:33 +02:00
char buffer [ 16 ] ;
UINT r , i ;
2010-10-14 11:06:13 +02:00
HKEY env ;
LONG res ;
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
2018-06-15 18:54:38 +02:00
create_database ( msifile , env_tables , ARRAY_SIZE ( env_tables ) ) ;
2010-10-14 11:06:13 +02:00
res = RegCreateKeyExA ( HKEY_CURRENT_USER , " Environment " , 0 , NULL , 0 , KEY_ALL_ACCESS , NULL , & env , NULL ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
res = RegSetValueExA ( env , " MSITESTVAR1 " , 0 , REG_SZ , ( const BYTE * ) " 0 " , 2 ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
res = RegSetValueExA ( env , " MSITESTVAR2 " , 0 , REG_SZ , ( const BYTE * ) " 0 " , 2 ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
2015-08-26 08:45:31 +02:00
res = RegSetValueExA ( env , " MSITESTVAR21 " , 0 , REG_SZ , ( const BYTE * ) " 1 " , 2 ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
2010-10-14 11:06:13 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
2018-05-31 03:47:33 +02:00
CHECK_REG_STR ( env , " MSITESTVAR1 " , " 1 " ) ;
CHECK_REG_STR ( env , " MSITESTVAR2 " , " 1 " ) ;
CHECK_REG_STR ( env , " MSITESTVAR3 " , " 1 " ) ;
CHECK_REG_STR ( env , " MSITESTVAR4 " , " 1 " ) ;
2010-10-14 11:06:13 +02:00
res = RegDeleteValueA ( env , " MSITESTVAR5 " ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
res = RegDeleteValueA ( env , " MSITESTVAR6 " ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
res = RegDeleteValueA ( env , " MSITESTVAR7 " ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
res = RegDeleteValueA ( env , " MSITESTVAR8 " ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
res = RegDeleteValueA ( env , " MSITESTVAR9 " ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
res = RegDeleteValueA ( env , " MSITESTVAR10 " ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
2018-05-31 03:47:33 +02:00
CHECK_REG_STR ( env , " MSITESTVAR11 " , " 1;2 " ) ;
CHECK_REG_STR ( env , " MSITESTVAR12 " , " 1 " ) ;
CHECK_REG_STR ( env , " MSITESTVAR13 " , " 1;2 " ) ;
CHECK_REG_STR ( env , " MSITESTVAR14 " , " ;1; " ) ;
CHECK_REG_STR ( env , " MSITESTVAR15 " , " ;;1;; " ) ;
CHECK_REG_STR ( env , " MSITESTVAR16 " , " 1 " ) ;
CHECK_REG_STR ( env , " MSITESTVAR17 " , " ;;2;;1 " ) ;
CHECK_REG_STR ( env , " MSITESTVAR18 " , " 1;;2;; " ) ;
CHECK_REG_STR ( env , " MSITESTVAR19 " , " 1 " ) ;
CHECK_REG_STR ( env , " MSITESTVAR20 " , " 1 " ) ;
CHECK_REG_STR ( env , " MSITESTVAR21 " , " 1 " ) ;
res = RegSetValueExA ( env , " MSITESTVAR22 " , 0 , REG_SZ , ( const BYTE * ) " 1 " , 2 ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
res = RegSetValueExA ( env , " MSITESTVAR23 " , 0 , REG_SZ , ( const BYTE * ) " 1 " , 2 ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( ! r , " got %u \n " , r ) ;
CHECK_DEL_REG_STR ( env , " MSITESTVAR13 " , " 1;2 " ) ;
CHECK_DEL_REG_STR ( env , " MSITESTVAR14 " , " ;1; " ) ;
CHECK_DEL_REG_STR ( env , " MSITESTVAR15 " , " ;;1;; " ) ;
CHECK_DEL_REG_STR ( env , " MSITESTVAR16 " , " 1 " ) ;
todo_wine {
CHECK_DEL_REG_STR ( env , " MSITESTVAR17 " , " 1 " ) ;
CHECK_DEL_REG_STR ( env , " MSITESTVAR18 " , " 1 " ) ;
}
CHECK_DEL_REG_STR ( env , " MSITESTVAR23 " , " 1 " ) ;
for ( i = 1 ; i < = 23 ; i + + )
2010-10-14 11:06:13 +02:00
{
2018-05-31 03:47:33 +02:00
sprintf ( buffer , " MSITESTVAR%i " , i ) ;
res = RegDeleteValueA ( env , buffer ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " [%d] got %u \n " , i , res ) ;
2010-10-14 11:06:13 +02:00
}
error :
RegDeleteValueA ( env , " MSITESTVAR1 " ) ;
RegDeleteValueA ( env , " MSITESTVAR2 " ) ;
2015-08-26 08:45:31 +02:00
RegDeleteValueA ( env , " MSITESTVAR21 " ) ;
2010-10-14 11:06:13 +02:00
RegCloseKey ( env ) ;
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
2010-10-14 11:06:13 +02:00
}
2010-11-26 14:03:31 +01:00
static void test_create_remove_folder ( void )
2010-10-14 11:06:13 +02:00
{
UINT r ;
2011-08-24 10:22:17 +02:00
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
2010-11-26 14:03:31 +01:00
CreateDirectoryA ( " msitest " , NULL ) ;
CreateDirectoryA ( " msitest \\ first " , NULL ) ;
CreateDirectoryA ( " msitest \\ second " , NULL ) ;
create_file ( " msitest \\ first \\ one.txt " , 1000 ) ;
create_file ( " msitest \\ second \\ two.txt " , 1000 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , cf_tables , ARRAY_SIZE ( cf_tables ) ) ;
2010-10-14 11:06:13 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
2010-11-26 14:03:31 +01:00
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
2010-10-14 11:06:13 +02:00
2010-11-26 14:03:31 +01:00
ok ( pf_exists ( " msitest \\ first \\ one.txt " ) , " file not installed \n " ) ;
ok ( pf_exists ( " msitest \\ first " ) , " directory not created \n " ) ;
ok ( pf_exists ( " msitest \\ second \\ two.txt " ) , " file not installed \n " ) ;
ok ( pf_exists ( " msitest \\ second " ) , " directory not created \n " ) ;
ok ( pf_exists ( " msitest \\ third " ) , " directory not created \n " ) ;
ok ( pf_exists ( " msitest " ) , " directory not created \n " ) ;
2010-10-14 11:06:13 +02:00
2010-11-26 14:03:31 +01:00
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
2010-10-14 11:06:13 +02:00
2010-11-26 14:03:31 +01:00
ok ( ! pf_exists ( " msitest \\ first \\ one.txt " ) , " file not removed \n " ) ;
ok ( ! pf_exists ( " msitest \\ first " ) , " directory not removed \n " ) ;
ok ( ! pf_exists ( " msitest \\ second \\ two.txt " ) , " file not removed \n " ) ;
ok ( ! pf_exists ( " msitest \\ second " ) , " directory not removed \n " ) ;
ok ( ! pf_exists ( " msitest \\ third " ) , " directory not removed \n " ) ;
todo_wine ok ( ! pf_exists ( " msitest " ) , " directory not removed \n " ) ;
2010-10-14 11:06:13 +02:00
error :
2010-11-26 14:03:31 +01:00
DeleteFileA ( " msitest \\ first \\ one.txt " ) ;
DeleteFileA ( " msitest \\ second \\ two.txt " ) ;
RemoveDirectoryA ( " msitest \\ first " ) ;
RemoveDirectoryA ( " msitest \\ second " ) ;
RemoveDirectoryA ( " msitest " ) ;
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
2010-10-14 11:06:13 +02:00
}
2014-12-02 12:41:26 +01:00
static void test_start_stop_services ( void )
2010-10-14 11:06:13 +02:00
{
UINT r ;
SC_HANDLE scm , service ;
BOOL ret ;
DWORD error = ERROR_SUCCESS ;
2013-10-15 13:04:45 +02:00
scm = OpenSCManagerA ( NULL , NULL , SC_MANAGER_ALL_ACCESS ) ;
2010-10-14 11:06:13 +02:00
if ( ! scm & & GetLastError ( ) = = ERROR_ACCESS_DENIED )
{
skip ( " Not enough rights to perform tests \n " ) ;
return ;
}
ok ( scm ! = NULL , " Failed to open the SC Manager \n " ) ;
if ( ! scm ) return ;
2013-10-15 13:04:45 +02:00
service = OpenServiceA ( scm , " Spooler " , SC_MANAGER_ALL_ACCESS ) ;
2010-10-14 11:06:13 +02:00
if ( ! service & & GetLastError ( ) = = ERROR_SERVICE_DOES_NOT_EXIST )
{
win_skip ( " The 'Spooler' service does not exist \n " ) ;
CloseServiceHandle ( scm ) ;
return ;
}
ok ( service ! = NULL , " Failed to open Spooler, error %d \n " , GetLastError ( ) ) ;
if ( ! service ) {
CloseServiceHandle ( scm ) ;
return ;
}
2013-10-15 13:04:45 +02:00
ret = StartServiceA ( service , 0 , NULL ) ;
2010-10-14 11:06:13 +02:00
if ( ! ret & & ( error = GetLastError ( ) ) ! = ERROR_SERVICE_ALREADY_RUNNING )
{
2011-10-27 13:36:21 +02:00
skip ( " Spooler service not available, skipping test \n " ) ;
2010-10-14 11:06:13 +02:00
CloseServiceHandle ( service ) ;
CloseServiceHandle ( scm ) ;
return ;
}
CloseServiceHandle ( service ) ;
CloseServiceHandle ( scm ) ;
create_test_files ( ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , sss_tables , ARRAY_SIZE ( sss_tables ) ) ;
2010-10-14 11:06:13 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
2014-12-02 12:41:26 +01:00
if ( error = = ERROR_SUCCESS )
{
SERVICE_STATUS status ;
scm = OpenSCManagerA ( NULL , NULL , SC_MANAGER_ALL_ACCESS ) ;
service = OpenServiceA ( scm , " Spooler " , SC_MANAGER_ALL_ACCESS ) ;
ret = ControlService ( service , SERVICE_CONTROL_STOP , & status ) ;
ok ( ret , " ControlService failed %u \n " , GetLastError ( ) ) ;
CloseServiceHandle ( service ) ;
CloseServiceHandle ( scm ) ;
}
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
2010-10-14 11:06:13 +02:00
ok ( delete_pf ( " msitest \\ cabout \\ new \\ five.txt " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ cabout \\ new " , FALSE ) , " Directory not created \n " ) ;
ok ( delete_pf ( " msitest \\ cabout \\ four.txt " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ cabout " , FALSE ) , " Directory not created \n " ) ;
ok ( delete_pf ( " msitest \\ changed \\ three.txt " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ changed " , FALSE ) , " Directory not created \n " ) ;
ok ( delete_pf ( " msitest \\ first \\ two.txt " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ first " , FALSE ) , " Directory not created \n " ) ;
ok ( delete_pf ( " msitest \\ filename " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ one.txt " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ service.exe " , TRUE ) , " File not installed \n " ) ;
2012-03-13 12:51:26 +01:00
ok ( delete_pf ( " msitest \\ service2.exe " , TRUE ) , " File not installed \n " ) ;
2010-10-14 11:06:13 +02:00
ok ( delete_pf ( " msitest " , FALSE ) , " Directory not created \n " ) ;
if ( error = = ERROR_SUCCESS )
{
SERVICE_STATUS status ;
2013-10-15 13:04:45 +02:00
scm = OpenSCManagerA ( NULL , NULL , SC_MANAGER_ALL_ACCESS ) ;
service = OpenServiceA ( scm , " Spooler " , SC_MANAGER_ALL_ACCESS ) ;
2010-10-14 11:06:13 +02:00
ret = ControlService ( service , SERVICE_CONTROL_STOP , & status ) ;
ok ( ret , " ControlService failed %u \n " , GetLastError ( ) ) ;
CloseServiceHandle ( service ) ;
CloseServiceHandle ( scm ) ;
}
2014-12-02 12:41:26 +01:00
delete_test_files ( ) ;
DeleteFileA ( msifile ) ;
2010-10-14 11:06:13 +02:00
}
2016-11-04 13:28:05 +01:00
static void delete_test_service ( const char * name )
2016-06-06 23:35:16 +02:00
{
BOOL ret ;
SC_HANDLE manager , service ;
manager = OpenSCManagerA ( NULL , NULL , SC_MANAGER_ALL_ACCESS ) ;
ok ( manager ! = NULL , " can't open service manager \n " ) ;
2016-11-04 13:28:05 +01:00
if ( ! manager ) return ;
2016-06-06 23:35:16 +02:00
2016-11-04 13:28:05 +01:00
service = OpenServiceA ( manager , name , GENERIC_ALL ) ;
2016-06-06 23:35:16 +02:00
if ( service )
{
ret = DeleteService ( service ) ;
ok ( ret , " failed to delete service %u \n " , GetLastError ( ) ) ;
CloseServiceHandle ( service ) ;
}
CloseServiceHandle ( manager ) ;
}
2010-10-14 11:06:13 +02:00
static void test_delete_services ( void )
{
UINT r ;
2012-03-13 12:51:26 +01:00
SC_HANDLE manager , service ;
DWORD error ;
2010-10-14 11:06:13 +02:00
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
2013-10-15 13:04:45 +02:00
manager = OpenSCManagerA ( NULL , NULL , SC_MANAGER_ALL_ACCESS ) ;
2012-03-13 12:51:26 +01:00
ok ( manager ! = NULL , " can't open service manager %u \n " , GetLastError ( ) ) ;
if ( ! manager ) return ;
service = CreateServiceA ( manager , " TestService3 " , " TestService3 " ,
SERVICE_ALL_ACCESS , SERVICE_WIN32_OWN_PROCESS , SERVICE_DEMAND_START ,
SERVICE_ERROR_NORMAL , " C: \\ doesnt_exist.exe " , NULL , NULL , NULL , NULL , NULL ) ;
ok ( service ! = NULL , " can't create service %u \n " , GetLastError ( ) ) ;
CloseServiceHandle ( service ) ;
CloseServiceHandle ( manager ) ;
2016-11-04 13:28:05 +01:00
if ( ! service ) return ;
2012-03-13 12:51:26 +01:00
2010-10-14 11:06:13 +02:00
create_test_files ( ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , sds_tables , ARRAY_SIZE ( sds_tables ) ) ;
2010-10-14 11:06:13 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
2013-10-15 13:04:45 +02:00
manager = OpenSCManagerA ( NULL , NULL , SC_MANAGER_ALL_ACCESS ) ;
2012-03-13 12:51:26 +01:00
ok ( manager ! = NULL , " can't open service manager \n " ) ;
if ( ! manager ) goto error ;
service = OpenServiceA ( manager , " TestService3 " , GENERIC_ALL ) ;
error = GetLastError ( ) ;
ok ( service = = NULL , " TestService3 not deleted \n " ) ;
ok ( error = = ERROR_SERVICE_DOES_NOT_EXIST , " wrong error %u \n " , error ) ;
CloseServiceHandle ( manager ) ;
2010-10-14 11:06:13 +02:00
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( delete_pf ( " msitest \\ cabout \\ new \\ five.txt " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ cabout \\ new " , FALSE ) , " Directory not created \n " ) ;
ok ( delete_pf ( " msitest \\ cabout \\ four.txt " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ cabout " , FALSE ) , " Directory not created \n " ) ;
ok ( delete_pf ( " msitest \\ changed \\ three.txt " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ changed " , FALSE ) , " Directory not created \n " ) ;
ok ( delete_pf ( " msitest \\ first \\ two.txt " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ first " , FALSE ) , " Directory not created \n " ) ;
ok ( delete_pf ( " msitest \\ filename " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ one.txt " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ service.exe " , TRUE ) , " File not installed \n " ) ;
2012-03-13 12:51:26 +01:00
ok ( delete_pf ( " msitest \\ service2.exe " , TRUE ) , " File not installed \n " ) ;
2010-10-14 11:06:13 +02:00
ok ( delete_pf ( " msitest " , FALSE ) , " Directory not created \n " ) ;
error :
2016-11-04 13:28:05 +01:00
delete_test_service ( " TestService " ) ;
delete_test_service ( " TestService2 " ) ;
delete_test_service ( " TestService3 " ) ;
2010-10-14 11:06:13 +02:00
delete_test_files ( ) ;
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
2010-10-14 11:06:13 +02:00
}
2014-02-21 16:52:12 +01:00
static void test_install_services ( void )
{
UINT r ;
SC_HANDLE manager , service ;
2016-06-06 23:35:16 +02:00
LONG res ;
HKEY hKey ;
DWORD err_control , err_controlsize , err_controltype ;
2014-02-21 16:52:12 +01:00
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
create_test_files ( ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , sis_tables , ARRAY_SIZE ( sis_tables ) ) ;
2014-02-21 16:52:12 +01:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
manager = OpenSCManagerA ( NULL , NULL , SC_MANAGER_ALL_ACCESS ) ;
ok ( manager ! = NULL , " can't open service manager \n " ) ;
if ( ! manager ) goto error ;
service = OpenServiceA ( manager , " TestService " , GENERIC_ALL ) ;
ok ( service ! = NULL , " TestService not installed \n " ) ;
CloseServiceHandle ( service ) ;
service = OpenServiceA ( manager , " TestService4 " , GENERIC_ALL ) ;
ok ( service = = NULL , " TestService4 installed \n " ) ;
2016-06-06 23:35:54 +02:00
res = RegOpenKeyA ( HKEY_LOCAL_MACHINE , " SYSTEM \\ CurrentControlSet \\ Services \\ TestService " , & hKey ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
if ( res = = ERROR_SUCCESS )
{
err_control = 0xBEEF ;
err_controltype = REG_DWORD ;
err_controlsize = sizeof ( err_control ) ;
res = RegQueryValueExA ( hKey , " ErrorControl " , NULL , & err_controltype , ( LPBYTE ) & err_control , & err_controlsize ) ;
ok ( err_control = = 0 , " TestService.ErrorControl wrong, expected 0, got %u \n " , err_control ) ;
RegCloseKey ( hKey ) ;
}
2014-02-21 16:52:12 +01:00
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
2016-11-04 13:28:05 +01:00
service = OpenServiceA ( manager , " TestService " , GENERIC_ALL ) ;
ok ( service ! = NULL , " TestService deleted \n " ) ;
CloseServiceHandle ( service ) ;
CloseServiceHandle ( manager ) ;
2014-02-21 16:52:12 +01:00
ok ( delete_pf ( " msitest \\ cabout \\ new \\ five.txt " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ cabout \\ new " , FALSE ) , " Directory not created \n " ) ;
ok ( delete_pf ( " msitest \\ cabout \\ four.txt " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ cabout " , FALSE ) , " Directory not created \n " ) ;
ok ( delete_pf ( " msitest \\ changed \\ three.txt " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ changed " , FALSE ) , " Directory not created \n " ) ;
ok ( delete_pf ( " msitest \\ first \\ two.txt " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ first " , FALSE ) , " Directory not created \n " ) ;
ok ( delete_pf ( " msitest \\ filename " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ one.txt " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ service.exe " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ service2.exe " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest " , FALSE ) , " Directory not created \n " ) ;
error :
2016-11-04 13:28:05 +01:00
delete_test_service ( " TestService " ) ;
2014-02-21 16:52:12 +01:00
delete_test_files ( ) ;
DeleteFileA ( msifile ) ;
}
2010-10-14 11:06:13 +02:00
static void test_self_registration ( void )
{
2018-05-30 10:22:26 +02:00
HKEY key ;
2010-10-14 11:06:13 +02:00
UINT r ;
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
create_test_files ( ) ;
2018-05-30 10:22:26 +02:00
extract_resource ( " selfreg.dll " , " TESTDLL " , " msitest \\ selfreg.dll " ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , sr_tables , ARRAY_SIZE ( sr_tables ) ) ;
2010-10-14 11:06:13 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
2018-05-30 10:22:26 +02:00
r = RegOpenKeyA ( HKEY_CLASSES_ROOT , " selfreg_test " , & key ) ;
ok ( ! r , " got %u \n " , r ) ;
RegCloseKey ( key ) ;
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( ! r , " got %u \n " , r ) ;
r = RegOpenKeyA ( HKEY_CLASSES_ROOT , " selfreg_test " , & key ) ;
ok ( r = = ERROR_FILE_NOT_FOUND , " got %u \n " , r ) ;
ok ( ! delete_pf ( " msitest \\ selfreg.dll " , TRUE ) , " file not removed \n " ) ;
ok ( ! delete_pf ( " msitest " , FALSE ) , " directory not removed \n " ) ;
2010-10-14 11:06:13 +02:00
error :
2018-05-30 10:22:26 +02:00
DeleteFileA ( " msitest \\ selfreg.dll " ) ;
2010-10-14 11:06:13 +02:00
delete_test_files ( ) ;
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
2010-10-14 11:06:13 +02:00
}
static void test_register_font ( void )
{
static const char regfont1 [ ] = " Software \\ Microsoft \\ Windows NT \\ CurrentVersion \\ Fonts " ;
static const char regfont2 [ ] = " Software \\ Microsoft \\ Windows \\ CurrentVersion \\ Fonts " ;
LONG ret ;
HKEY key ;
UINT r ;
REGSAM access = KEY_ALL_ACCESS ;
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
create_test_files ( ) ;
create_file ( " msitest \\ font.ttf " , 1000 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , font_tables , ARRAY_SIZE ( font_tables ) ) ;
2010-10-14 11:06:13 +02:00
if ( is_wow64 )
access | = KEY_WOW64_64KEY ;
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ret = RegOpenKeyExA ( HKEY_LOCAL_MACHINE , regfont1 , 0 , access , & key ) ;
if ( ret )
RegOpenKeyExA ( HKEY_LOCAL_MACHINE , regfont2 , 0 , access , & key ) ;
ret = RegQueryValueExA ( key , " msi test font " , NULL , NULL , NULL , NULL ) ;
ok ( ret ! = ERROR_FILE_NOT_FOUND , " unexpected result %d \n " , ret ) ;
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( ! delete_pf ( " msitest " , FALSE ) , " directory not removed \n " ) ;
ret = RegQueryValueExA ( key , " msi test font " , NULL , NULL , NULL , NULL ) ;
ok ( ret = = ERROR_FILE_NOT_FOUND , " unexpected result %d \n " , ret ) ;
RegDeleteValueA ( key , " msi test font " ) ;
RegCloseKey ( key ) ;
error :
DeleteFileA ( " msitest \\ font.ttf " ) ;
delete_test_files ( ) ;
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
2010-10-14 11:06:13 +02:00
}
static void test_validate_product_id ( void )
{
UINT r ;
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
create_test_files ( ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , vp_tables , ARRAY_SIZE ( vp_tables ) ) ;
2010-10-14 11:06:13 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
r = MsiInstallProductA ( msifile , " SET_PRODUCT_ID=1 " ) ;
ok ( r = = ERROR_INSTALL_FAILURE , " Expected ERROR_INSTALL_FAILURE, got %u \n " , r ) ;
r = MsiInstallProductA ( msifile , " SET_PRODUCT_ID=2 " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
r = MsiInstallProductA ( msifile , " PIDKEY=123-1234567 " ) ;
ok ( r = = ERROR_INSTALL_FAILURE , " Expected ERROR_INSTALL_FAILURE, got %u \n " , r ) ;
ok ( delete_pf ( " msitest \\ cabout \\ new \\ five.txt " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ cabout \\ new " , FALSE ) , " Directory not created \n " ) ;
ok ( delete_pf ( " msitest \\ cabout \\ four.txt " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ cabout " , FALSE ) , " Directory not created \n " ) ;
ok ( delete_pf ( " msitest \\ changed \\ three.txt " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ changed " , FALSE ) , " Directory not created \n " ) ;
ok ( delete_pf ( " msitest \\ first \\ two.txt " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ first " , FALSE ) , " Directory not created \n " ) ;
ok ( delete_pf ( " msitest \\ filename " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ one.txt " , TRUE ) , " File not installed \n " ) ;
ok ( delete_pf ( " msitest \\ service.exe " , TRUE ) , " File not installed \n " ) ;
2012-03-13 12:51:26 +01:00
ok ( delete_pf ( " msitest \\ service2.exe " , TRUE ) , " File not installed \n " ) ;
2010-10-14 11:06:13 +02:00
ok ( delete_pf ( " msitest " , FALSE ) , " Directory not created \n " ) ;
error :
delete_test_files ( ) ;
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
2010-10-14 11:06:13 +02:00
}
static void test_install_remove_odbc ( void )
{
2018-05-19 05:00:57 +02:00
int gotdriver = 0 , gotdriver2 = 0 ;
char buffer [ 1000 ] , * p ;
WORD len ;
2010-10-14 11:06:13 +02:00
UINT r ;
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
create_test_files ( ) ;
create_file ( " msitest \\ ODBCdriver.dll " , 1000 ) ;
create_file ( " msitest \\ ODBCdriver2.dll " , 1000 ) ;
create_file ( " msitest \\ ODBCtranslator.dll " , 1000 ) ;
create_file ( " msitest \\ ODBCtranslator2.dll " , 1000 ) ;
create_file ( " msitest \\ ODBCsetup.dll " , 1000 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , odbc_tables , ARRAY_SIZE ( odbc_tables ) ) ;
2010-10-14 11:06:13 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( pf_exists ( " msitest \\ ODBCdriver.dll " ) , " file not created \n " ) ;
ok ( pf_exists ( " msitest \\ ODBCdriver2.dll " ) , " file not created \n " ) ;
ok ( pf_exists ( " msitest \\ ODBCtranslator.dll " ) , " file not created \n " ) ;
ok ( pf_exists ( " msitest \\ ODBCtranslator2.dll " ) , " file not created \n " ) ;
ok ( pf_exists ( " msitest \\ ODBCsetup.dll " ) , " file not created \n " ) ;
2018-05-19 05:00:57 +02:00
r = SQLGetInstalledDrivers ( buffer , sizeof ( buffer ) , & len ) ;
ok ( len < sizeof ( buffer ) , " buffer too small \n " ) ;
ok ( r , " SQLGetInstalledDrivers failed \n " ) ;
for ( p = buffer ; * p ; p + = strlen ( p ) + 1 )
{
if ( ! strcmp ( p , " ODBC test driver " ) )
gotdriver = 1 ;
if ( ! strcmp ( p , " ODBC test driver2 " ) )
gotdriver2 = 1 ;
}
ok ( gotdriver , " driver not installed \n " ) ;
ok ( gotdriver2 , " driver 2 not installed \n " ) ;
2010-10-14 11:06:13 +02:00
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( ! delete_pf ( " msitest \\ ODBCdriver.dll " , TRUE ) , " file not removed \n " ) ;
ok ( ! delete_pf ( " msitest \\ ODBCdriver2.dll " , TRUE ) , " file not removed \n " ) ;
ok ( ! delete_pf ( " msitest \\ ODBCtranslator.dll " , TRUE ) , " file not removed \n " ) ;
ok ( ! delete_pf ( " msitest \\ ODBCtranslator2.dll " , TRUE ) , " file not removed \n " ) ;
ok ( ! delete_pf ( " msitest \\ ODBCsetup.dll " , TRUE ) , " file not removed \n " ) ;
ok ( ! delete_pf ( " msitest " , FALSE ) , " directory not removed \n " ) ;
2018-05-19 05:00:57 +02:00
gotdriver = gotdriver2 = 0 ;
r = SQLGetInstalledDrivers ( buffer , sizeof ( buffer ) , & len ) ;
ok ( len < sizeof ( buffer ) , " buffer too small \n " ) ;
ok ( r , " SQLGetInstalledDrivers failed \n " ) ;
for ( p = buffer ; * p ; p + = strlen ( p ) + 1 )
{
if ( ! strcmp ( p , " ODBC test driver " ) )
gotdriver = 1 ;
if ( ! strcmp ( p , " ODBC test driver2 " ) )
gotdriver2 = 1 ;
}
ok ( ! gotdriver , " driver not installed \n " ) ;
ok ( ! gotdriver2 , " driver 2 not installed \n " ) ;
2010-10-14 11:06:13 +02:00
error :
DeleteFileA ( " msitest \\ ODBCdriver.dll " ) ;
DeleteFileA ( " msitest \\ ODBCdriver2.dll " ) ;
DeleteFileA ( " msitest \\ ODBCtranslator.dll " ) ;
DeleteFileA ( " msitest \\ ODBCtranslator2.dll " ) ;
DeleteFileA ( " msitest \\ ODBCsetup.dll " ) ;
delete_test_files ( ) ;
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
2010-10-14 11:06:13 +02:00
}
static void test_register_typelib ( void )
{
2018-05-30 10:22:24 +02:00
ITypeLib * tlb ;
HRESULT hr ;
2010-10-14 11:06:13 +02:00
UINT r ;
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
2018-05-30 10:22:24 +02:00
/* UnregisterTypeLibraries action fails in 64-bit Windows <= 7 */
if ( sizeof ( void * ) = = 8 )
{
win_skip ( " broken on 64-bit Windows \n " ) ;
return ;
}
2010-10-14 11:06:13 +02:00
create_test_files ( ) ;
2018-05-30 10:22:24 +02:00
extract_resource ( " typelib.tlb " , " TYPELIB " , " msitest \\ typelib.dll " ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , tl_tables , ARRAY_SIZE ( tl_tables ) ) ;
2010-10-14 11:06:13 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
2018-05-30 10:22:24 +02:00
r = MsiInstallProductA ( msifile , NULL ) ;
2010-10-14 11:06:13 +02:00
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
2018-05-30 10:22:24 +02:00
ok ( r = = ERROR_SUCCESS , " got %u \n " , r ) ;
2010-10-14 11:06:13 +02:00
2018-05-30 10:22:24 +02:00
hr = LoadRegTypeLib ( & LIBID_register_test , 7 , 1 , 0 , & tlb ) ;
ok ( hr = = S_OK , " got %#x \n " , hr ) ;
ITypeLib_Release ( tlb ) ;
2010-10-14 11:06:13 +02:00
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
2018-05-30 10:22:24 +02:00
hr = LoadRegTypeLib ( & LIBID_register_test , 7 , 1 , 0 , & tlb ) ;
ok ( hr = = TYPE_E_LIBNOTREGISTERED , " got %#x \n " , hr ) ;
2010-10-14 11:06:13 +02:00
ok ( ! delete_pf ( " msitest \\ typelib.dll " , TRUE ) , " file not removed \n " ) ;
ok ( ! delete_pf ( " msitest " , FALSE ) , " directory not removed \n " ) ;
error :
DeleteFileA ( " msitest \\ typelib.dll " ) ;
delete_test_files ( ) ;
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
2010-10-14 11:06:13 +02:00
}
static void test_create_remove_shortcut ( void )
{
UINT r ;
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
create_test_files ( ) ;
create_file ( " msitest \\ target.txt " , 1000 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , crs_tables , ARRAY_SIZE ( crs_tables ) ) ;
2010-10-14 11:06:13 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( pf_exists ( " msitest \\ target.txt " ) , " file not created \n " ) ;
ok ( pf_exists ( " msitest \\ shortcut.lnk " ) , " file not created \n " ) ;
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( ! delete_pf ( " msitest \\ shortcut.lnk " , TRUE ) , " file not removed \n " ) ;
ok ( ! delete_pf ( " msitest \\ target.txt " , TRUE ) , " file not removed \n " ) ;
todo_wine ok ( ! delete_pf ( " msitest " , FALSE ) , " directory not removed \n " ) ;
error :
DeleteFileA ( " msitest \\ target.txt " ) ;
delete_test_files ( ) ;
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
2010-10-14 11:06:13 +02:00
}
static void test_publish_components ( void )
{
2013-12-26 22:49:27 +01:00
static const char keypath [ ] =
2010-10-14 11:06:13 +02:00
" Software \\ Microsoft \\ Installer \\ Components \\ 0CBCFA296AC907244845745CEEB2F8AA " ;
2015-09-09 09:55:35 +02:00
static const char keypath2 [ ] =
" Software \\ Classes \\ Installer \\ Components \\ 0CBCFA296AC907244845745CEEB2F8AA " ;
2010-10-14 11:06:13 +02:00
UINT r ;
LONG res ;
HKEY key ;
2015-09-09 09:55:35 +02:00
BYTE * data ;
DWORD size ;
2010-10-14 11:06:13 +02:00
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
create_test_files ( ) ;
create_file ( " msitest \\ english.txt " , 1000 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , pub_tables , ARRAY_SIZE ( pub_tables ) ) ;
2010-10-14 11:06:13 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
2015-09-09 09:55:35 +02:00
size = 0 ;
r = MsiProvideQualifiedComponentA ( " {92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA} " ,
" english.txt " , INSTALLMODE_DEFAULT , NULL , & size ) ;
2016-04-20 08:55:43 +02:00
ok ( r = = ERROR_SUCCESS , " MsiProvideQualifiedComponent returned %d \n " , r ) ;
2015-09-09 09:55:35 +02:00
2010-10-14 11:06:13 +02:00
res = RegOpenKeyA ( HKEY_CURRENT_USER , keypath , & key ) ;
ok ( res = = ERROR_SUCCESS , " components key not created %d \n " , res ) ;
2015-09-09 09:55:35 +02:00
res = RegQueryValueExA ( key , " english.txt " , NULL , NULL , NULL , & size ) ;
ok ( res = = ERROR_SUCCESS , " value not found %d \n " , res ) ;
data = HeapAlloc ( GetProcessHeap ( ) , 0 , size ) ;
res = RegQueryValueExA ( key , " english.txt " , NULL , NULL , data , & size ) ;
2010-10-14 11:06:13 +02:00
ok ( res = = ERROR_SUCCESS , " value not found %d \n " , res ) ;
RegCloseKey ( key ) ;
2015-09-09 09:55:35 +02:00
res = RegDeleteKeyA ( HKEY_CURRENT_USER , keypath ) ;
ok ( res = = ERROR_SUCCESS , " RegDeleteKey failed %d \n " , res ) ;
2015-09-11 16:33:33 +02:00
res = RegCreateKeyExA ( HKEY_LOCAL_MACHINE , keypath2 , 0 , NULL , REG_OPTION_NON_VOLATILE ,
MAXIMUM_ALLOWED | KEY_WOW64_64KEY , NULL , & key , NULL ) ;
2015-10-27 20:55:37 +01:00
ok ( res = = ERROR_SUCCESS , " RegCreateKeyEx failed %d \n " , res ) ;
2015-09-09 09:55:35 +02:00
res = RegSetValueExA ( key , " english.txt " , 0 , REG_MULTI_SZ , data , size ) ;
ok ( res = = ERROR_SUCCESS , " RegSetValueEx failed %d \n " , res ) ;
RegCloseKey ( key ) ;
size = 0 ;
r = MsiProvideQualifiedComponentA ( " {92AFCBC0-9CA6-4270-8454-47C5EE2B8FAA} " ,
" english.txt " , INSTALLMODE_DEFAULT , NULL , & size ) ;
2016-04-20 08:55:43 +02:00
ok ( r = = ERROR_SUCCESS , " MsiProvideQualifiedComponent returned %d \n " , r ) ;
2015-09-09 09:55:35 +02:00
2015-09-11 16:33:33 +02:00
if ( pRegDeleteKeyExA )
res = pRegDeleteKeyExA ( HKEY_LOCAL_MACHINE , keypath2 , KEY_WOW64_64KEY , 0 ) ;
else
res = RegDeleteKeyA ( HKEY_LOCAL_MACHINE , keypath2 ) ;
2015-09-09 09:55:35 +02:00
ok ( res = = ERROR_SUCCESS , " RegDeleteKey failed %d \n " , res ) ;
res = RegCreateKeyA ( HKEY_CURRENT_USER , keypath , & key ) ;
ok ( res = = ERROR_SUCCESS , " RegCreateKey failed %d \n " , res ) ;
res = RegSetValueExA ( key , " english.txt " , 0 , REG_MULTI_SZ , data , size ) ;
ok ( res = = ERROR_SUCCESS , " RegSetValueEx failed %d \n " , res ) ;
HeapFree ( GetProcessHeap ( ) , 0 , data ) ;
RegCloseKey ( key ) ;
2010-10-14 11:06:13 +02:00
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
res = RegOpenKeyA ( HKEY_CURRENT_USER , keypath , & key ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " unexpected result %d \n " , res ) ;
ok ( ! delete_pf ( " msitest \\ english.txt " , TRUE ) , " file not removed \n " ) ;
ok ( ! delete_pf ( " msitest " , FALSE ) , " directory not removed \n " ) ;
error :
DeleteFileA ( " msitest \\ english.txt " ) ;
delete_test_files ( ) ;
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
2010-10-14 11:06:13 +02:00
}
static void test_remove_duplicate_files ( void )
{
UINT r ;
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
create_test_files ( ) ;
create_file ( " msitest \\ original.txt " , 1000 ) ;
create_file ( " msitest \\ original2.txt " , 1000 ) ;
create_file ( " msitest \\ original3.txt " , 1000 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , rd_tables , ARRAY_SIZE ( rd_tables ) ) ;
2010-10-14 11:06:13 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( pf_exists ( " msitest \\ original.txt " ) , " file not created \n " ) ;
ok ( pf_exists ( " msitest \\ original2.txt " ) , " file not created \n " ) ;
ok ( ! pf_exists ( " msitest \\ original3.txt " ) , " file created \n " ) ;
ok ( pf_exists ( " msitest \\ duplicate.txt " ) , " file not created \n " ) ;
ok ( ! pf_exists ( " msitest \\ duplicate2.txt " ) , " file created \n " ) ;
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( delete_pf ( " msitest \\ original.txt " , TRUE ) , " file removed \n " ) ;
ok ( ! delete_pf ( " msitest \\ original2.txt " , TRUE ) , " file not removed \n " ) ;
ok ( ! delete_pf ( " msitest \\ original3.txt " , TRUE ) , " file not removed \n " ) ;
ok ( ! delete_pf ( " msitest \\ duplicate.txt " , TRUE ) , " file not removed \n " ) ;
ok ( ! delete_pf ( " msitest \\ duplicate2.txt " , TRUE ) , " file not removed \n " ) ;
ok ( delete_pf ( " msitest " , FALSE ) , " directory removed \n " ) ;
error :
DeleteFileA ( " msitest \\ original.txt " ) ;
DeleteFileA ( " msitest \\ original2.txt " ) ;
DeleteFileA ( " msitest \\ original3.txt " ) ;
delete_test_files ( ) ;
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
2010-10-14 11:06:13 +02:00
}
static void test_find_related_products ( void )
{
UINT r ;
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
create_test_files ( ) ;
create_file ( " msitest \\ product.txt " , 1000 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , frp_tables , ARRAY_SIZE ( frp_tables ) ) ;
2010-10-14 11:06:13 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
/* install again, so it finds the upgrade code */
r = MsiInstallProductA ( msifile , NULL ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( ! delete_pf ( " msitest \\ product.txt " , TRUE ) , " file not removed \n " ) ;
ok ( ! delete_pf ( " msitest " , FALSE ) , " directory not removed \n " ) ;
error :
DeleteFileA ( " msitest \\ product.txt " ) ;
delete_test_files ( ) ;
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
2010-10-14 11:06:13 +02:00
}
2018-05-31 03:47:35 +02:00
static void test_ini_values ( void )
2010-10-14 11:06:13 +02:00
{
UINT r ;
DWORD len ;
char inifile [ MAX_PATH ] , buf [ 0x10 ] ;
HANDLE file ;
BOOL ret ;
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
create_test_files ( ) ;
create_file ( " msitest \\ inifile.txt " , 1000 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , ini_tables , ARRAY_SIZE ( ini_tables ) ) ;
2010-10-14 11:06:13 +02:00
lstrcpyA ( inifile , PROG_FILES_DIR ) ;
lstrcatA ( inifile , " \\ msitest " ) ;
ret = CreateDirectoryA ( inifile , NULL ) ;
if ( ! ret & & GetLastError ( ) = = ERROR_ACCESS_DENIED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
lstrcatA ( inifile , " \\ test.ini " ) ;
file = CreateFileA ( inifile , GENERIC_WRITE | GENERIC_READ , 0 , NULL , CREATE_ALWAYS , 0 , NULL ) ;
CloseHandle ( file ) ;
ret = WritePrivateProfileStringA ( " sectionA " , " keyA " , " valueA " , inifile ) ;
ok ( ret , " failed to write profile string %u \n " , GetLastError ( ) ) ;
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
len = GetPrivateProfileStringA ( " section1 " , " key1 " , NULL , buf , sizeof ( buf ) , inifile ) ;
ok ( len = = 6 , " got %u expected 6 \n " , len ) ;
len = GetPrivateProfileStringA ( " sectionA " , " keyA " , NULL , buf , sizeof ( buf ) , inifile ) ;
ok ( ! len , " got %u expected 0 \n " , len ) ;
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
len = GetPrivateProfileStringA ( " section1 " , " key1 " , NULL , buf , sizeof ( buf ) , inifile ) ;
ok ( ! len , " got %u expected 0 \n " , len ) ;
len = GetPrivateProfileStringA ( " sectionA " , " keyA " , NULL , buf , sizeof ( buf ) , inifile ) ;
ok ( ! len , " got %u expected 0 \n " , len ) ;
todo_wine ok ( ! delete_pf ( " msitest \\ test.ini " , TRUE ) , " file removed \n " ) ;
ok ( ! delete_pf ( " msitest \\ inifile.txt " , TRUE ) , " file not removed \n " ) ;
ok ( delete_pf ( " msitest " , FALSE ) , " directory removed \n " ) ;
error :
DeleteFileA ( " msitest \\ inifile.txt " ) ;
delete_test_files ( ) ;
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
2010-10-14 11:06:13 +02:00
}
static void test_register_class_info ( void )
{
UINT r ;
LONG res ;
HKEY hkey ;
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
create_test_files ( ) ;
create_file ( " msitest \\ class.txt " , 1000 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , rci_tables , ARRAY_SIZE ( rci_tables ) ) ;
2010-10-14 11:06:13 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
2011-03-30 12:31:57 +02:00
if ( is_64bit )
2010-10-14 11:06:13 +02:00
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Wow6432Node \\ CLSID \\ {110913E7-86D1-4BF3-9922-BA103FCDDDFA} " , & hkey ) ;
else
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " CLSID \\ {110913E7-86D1-4BF3-9922-BA103FCDDDFA} " , & hkey ) ;
ok ( res = = ERROR_SUCCESS , " key not created \n " ) ;
RegCloseKey ( hkey ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " FileType \\ {110913E7-86D1-4BF3-9922-BA103FCDDDFA} " , & hkey ) ;
ok ( res = = ERROR_SUCCESS , " key not created \n " ) ;
RegCloseKey ( hkey ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " AppID \\ {CFCC3B38-E683-497D-9AB4-CB40AAFE307F} " , & hkey ) ;
ok ( res = = ERROR_SUCCESS , " key not created \n " ) ;
RegCloseKey ( hkey ) ;
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
2011-03-30 12:31:57 +02:00
if ( is_64bit )
2010-10-14 11:06:13 +02:00
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Wow6432Node \\ CLSID \\ {110913E7-86D1-4BF3-9922-BA103FCDDDFA} " , & hkey ) ;
else
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " CLSID \\ {110913E7-86D1-4BF3-9922-BA103FCDDDFA} " , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " key not removed \n " ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " FileType \\ {110913E7-86D1-4BF3-9922-BA103FCDDDFA} " , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " key not removed \n " ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " AppID \\ {CFCC3B38-E683-497D-9AB4-CB40AAFE307F} " , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " key not removed \n " ) ;
ok ( ! delete_pf ( " msitest \\ class.txt " , TRUE ) , " file not removed \n " ) ;
ok ( ! delete_pf ( " msitest " , FALSE ) , " directory not removed \n " ) ;
error :
DeleteFileA ( " msitest \\ class.txt " ) ;
delete_test_files ( ) ;
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
2010-10-14 11:06:13 +02:00
}
static void test_register_extension_info ( void )
{
UINT r ;
LONG res ;
HKEY hkey ;
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
create_test_files ( ) ;
create_file ( " msitest \\ extension.txt " , 1000 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , rei_tables , ARRAY_SIZE ( rei_tables ) ) ;
2010-10-14 11:06:13 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " .extension " , & hkey ) ;
ok ( res = = ERROR_SUCCESS , " key not created \n " ) ;
RegCloseKey ( hkey ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Prog.Id.1 \\ shell \\ Open \\ command " , & hkey ) ;
ok ( res = = ERROR_SUCCESS , " key not created \n " ) ;
RegCloseKey ( hkey ) ;
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " .extension " , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " key not removed \n " ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Prog.Id.1 " , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " key not removed \n " ) ;
ok ( ! delete_pf ( " msitest \\ extension.txt " , TRUE ) , " file not removed \n " ) ;
ok ( ! delete_pf ( " msitest " , FALSE ) , " directory not removed \n " ) ;
error :
DeleteFileA ( " msitest \\ extension.txt " ) ;
delete_test_files ( ) ;
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
2010-10-14 11:06:13 +02:00
}
2014-02-24 22:00:55 +01:00
static void test_register_progid_info ( void )
{
UINT r ;
LONG res ;
HKEY hkey ;
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
create_test_files ( ) ;
create_file ( " msitest \\ progid.txt " , 1000 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , rpi_tables , ARRAY_SIZE ( rpi_tables ) ) ;
2014-02-24 22:00:55 +01:00
res = RegCreateKeyExA ( HKEY_CLASSES_ROOT , " Winetest.Orphaned " , 0 , NULL , 0 ,
KEY_ALL_ACCESS , NULL , & hkey , NULL ) ;
ok ( res = = ERROR_SUCCESS , " key not created \n " ) ;
RegCloseKey ( hkey ) ;
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
if ( is_64bit )
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Wow6432Node \\ CLSID \\ {110913E7-86D1-4BF3-9922-BA103FCDDDFA} " , & hkey ) ;
else
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " CLSID \\ {110913E7-86D1-4BF3-9922-BA103FCDDDFA} " , & hkey ) ;
ok ( res = = ERROR_SUCCESS , " key not created \n " ) ;
RegCloseKey ( hkey ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Winetest.Class.1 " , & hkey ) ;
ok ( res = = ERROR_SUCCESS , " key not created \n " ) ;
RegCloseKey ( hkey ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Winetest.Class " , & hkey ) ;
ok ( res = = ERROR_SUCCESS , " key not created \n " ) ;
RegCloseKey ( hkey ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Winetest.Class.2 " , & hkey ) ;
ok ( res = = ERROR_SUCCESS , " key not created \n " ) ;
RegCloseKey ( hkey ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Winetest.VerClass.1 " , & hkey ) ;
ok ( res = = ERROR_SUCCESS , " key not created \n " ) ;
RegCloseKey ( hkey ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Winetest.VerClass " , & hkey ) ;
ok ( res = = ERROR_SUCCESS , " key not created \n " ) ;
RegCloseKey ( hkey ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Winetest.NoProgIdClass.1 " , & hkey ) ;
2014-02-27 11:03:48 +01:00
ok ( res = = ERROR_FILE_NOT_FOUND , " key created \n " ) ;
2014-02-24 22:00:55 +01:00
if ( res = = ERROR_SUCCESS ) RegCloseKey ( hkey ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Winetest.NoProgIdClass " , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " key created \n " ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Winetest.Orphaned " , & hkey ) ;
2014-02-27 11:03:48 +01:00
ok ( res = = ERROR_SUCCESS , " key deleted \n " ) ;
2014-02-24 22:00:55 +01:00
if ( res = = ERROR_SUCCESS ) RegCloseKey ( hkey ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Winetest.Orphaned2 " , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " key created \n " ) ;
2014-02-27 11:03:48 +01:00
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Winetest.Extension " , & hkey ) ;
ok ( res = = ERROR_SUCCESS , " key not created \n " ) ;
RegCloseKey ( hkey ) ;
2014-02-24 22:00:55 +01:00
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
if ( is_64bit )
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Wow6432Node \\ CLSID \\ {110913E7-86D1-4BF3-9922-BA103FCDDDFA} " , & hkey ) ;
else
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " CLSID \\ {110913E7-86D1-4BF3-9922-BA103FCDDDFA} " , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " key not removed \n " ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Winetest.Class.1 " , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " key not removed \n " ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Winetest.Class " , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " key not removed \n " ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Winetest.Class.2 " , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " key not removed \n " ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Winetest.VerClass.1 " , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " key not removed \n " ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Winetest.VerClass " , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " key not removed \n " ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Winetest.NoProgIdClass.1 " , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " key not removed \n " ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Winetest.NoProgIdClass " , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " key not removed \n " ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Winetest.Orphaned " , & hkey ) ;
2014-02-27 11:03:48 +01:00
ok ( res = = ERROR_SUCCESS , " key deleted \n " ) ;
2014-02-24 22:00:55 +01:00
if ( res = = ERROR_SUCCESS ) RegCloseKey ( hkey ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Winetest.Orphaned2 " , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " key not removed \n " ) ;
2014-02-27 11:03:48 +01:00
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " Winetest.Extension " , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " key not removed \n " ) ;
2014-02-24 22:00:55 +01:00
ok ( ! delete_pf ( " msitest \\ progid.txt " , TRUE ) , " file not removed \n " ) ;
ok ( ! delete_pf ( " msitest " , FALSE ) , " directory not removed \n " ) ;
error :
DeleteFileA ( " msitest \\ progid.txt " ) ;
delete_test_files ( ) ;
DeleteFileA ( msifile ) ;
RegDeleteKeyA ( HKEY_CLASSES_ROOT , " Winetest.Orphaned " ) ;
}
2010-10-14 11:06:13 +02:00
static void test_register_mime_info ( void )
{
UINT r ;
LONG res ;
HKEY hkey ;
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
create_test_files ( ) ;
create_file ( " msitest \\ mime.txt " , 1000 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , rmi_tables , ARRAY_SIZE ( rmi_tables ) ) ;
2010-10-14 11:06:13 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " MIME \\ Database \\ Content Type \\ mime/type " , & hkey ) ;
ok ( res = = ERROR_SUCCESS , " key not created \n " ) ;
RegCloseKey ( hkey ) ;
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , " MIME \\ Database \\ Content Type \\ mime/type " , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " key not removed \n " ) ;
ok ( ! delete_pf ( " msitest \\ mime.txt " , TRUE ) , " file not removed \n " ) ;
ok ( ! delete_pf ( " msitest " , FALSE ) , " directory not removed \n " ) ;
error :
DeleteFileA ( " msitest \\ mime.txt " ) ;
delete_test_files ( ) ;
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
2010-10-14 11:06:13 +02:00
}
2011-01-10 09:43:34 +01:00
static void test_publish_assemblies ( void )
{
static const char manifest [ ] =
" <assemblyIdentity type= \" win32 \" name= \" Wine.Win32.Assembly \" "
" version= \" 1.0.0.0 \" publicKeyToken= \" abcdef0123456789 \" "
" processorArchitecture= \" x86 \" /> " ;
static const char manifest_local [ ] =
" <assemblyIdentity type= \" win32 \" name= \" Wine.Win32.Local.Assembly \" "
" version= \" 1.0.0.0 \" publicKeyToken= \" abcdef0123456789 \" "
" processorArchitecture= \" x86 \" /> " ;
2011-01-20 09:07:05 +01:00
static const char classes_path_dotnet [ ] =
" Installer \\ Assemblies \\ Global " ;
static const char classes_path_dotnet_local [ ] =
" Installer \\ Assemblies \\ C:|Program Files|msitest|application_dotnet.txt " ;
static const char classes_path_dotnet_local_wow64 [ ] =
" Installer \\ Assemblies \\ C:|Program Files (x86)|msitest|application_dotnet.txt " ;
2018-09-04 02:17:56 +02:00
static const char classes_path_fake_local [ ] =
" Installer \\ Assemblies \\ C:|Program Files|msitest|nonexistent.txt " ;
static const char classes_path_fake_local_wow64 [ ] =
" Installer \\ Assemblies \\ C:|Program Files (x86)|msitest|nonexistent.txt " ;
2011-01-20 09:07:05 +01:00
static const char classes_path_win32 [ ] =
" Installer \\ Win32Assemblies \\ Global " ;
static const char classes_path_win32_local [ ] =
" Installer \\ Win32Assemblies \\ C:|Program Files|msitest|application_win32.txt " ;
static const char classes_path_win32_local_wow64 [ ] =
" Installer \\ Win32Assemblies \\ C:|Program Files (x86)|msitest|application_win32.txt " ;
2011-01-10 09:43:34 +01:00
static const char path_dotnet [ ] =
" Software \\ Microsoft \\ Installer \\ Assemblies \\ Global " ;
static const char path_dotnet_local [ ] =
" Software \\ Microsoft \\ Installer \\ Assemblies \\ C:|Program Files|msitest|application_dotnet.txt " ;
static const char path_dotnet_local_wow64 [ ] =
" Software \\ Microsoft \\ Installer \\ Assemblies \\ C:|Program Files (x86)|msitest|application_dotnet.txt " ;
2018-09-04 02:17:56 +02:00
static const char path_fake_local [ ] =
" Software \\ Microsoft \\ Installer \\ Assemblies \\ C:|Program Files|msitest|nonexistent.txt " ;
static const char path_fake_local_wow64 [ ] =
" Software \\ Microsoft \\ Installer \\ Assemblies \\ C:|Program Files (x86)|msitest|nonexistent.txt " ;
2011-01-10 09:43:34 +01:00
static const char path_win32 [ ] =
" Software \\ Microsoft \\ Installer \\ Win32Assemblies \\ Global " ;
static const char path_win32_local [ ] =
" Software \\ Microsoft \\ Installer \\ Win32Assemblies \\ C:|Program Files|msitest|application_win32.txt " ;
static const char path_win32_local_wow64 [ ] =
" Software \\ Microsoft \\ Installer \\ Win32Assemblies \\ C:|Program Files (x86)|msitest|application_win32.txt " ;
static const char name_dotnet [ ] =
" Wine.Dotnet.Assembly,processorArchitecture= \" MSIL \" ,publicKeyToken= \" abcdef0123456789 \" , "
" version= \" 1.0.0.0 \" ,culture= \" neutral \" " ;
static const char name_dotnet_local [ ] =
" Wine.Dotnet.Local.Assembly,processorArchitecture= \" MSIL \" ,publicKeyToken= \" abcdef0123456789 \" , "
" version= \" 1.0.0.0 \" ,culture= \" neutral \" " ;
static const char name_win32 [ ] =
" Wine.Win32.Assembly,processorArchitecture= \" x86 \" ,publicKeyToken= \" abcdef0123456789 \" , "
" type= \" win32 \" ,version= \" 1.0.0.0 \" " ;
static const char name_win32_local [ ] =
" Wine.Win32.Local.Assembly,processorArchitecture= \" x86 \" ,publicKeyToken= \" abcdef0123456789 \" , "
" type= \" win32 \" ,version= \" 1.0.0.0 \" " ;
UINT r ;
LONG res ;
HKEY hkey ;
const char * path ;
2011-01-27 11:35:36 +01:00
int access ;
2011-01-10 09:43:34 +01:00
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
create_test_files ( ) ;
create_file ( " msitest \\ win32.txt " , 1000 ) ;
create_file ( " msitest \\ win32_local.txt " , 1000 ) ;
create_file ( " msitest \\ dotnet.txt " , 1000 ) ;
create_file ( " msitest \\ dotnet_local.txt " , 1000 ) ;
create_file_data ( " msitest \\ manifest.txt " , manifest , 0 ) ;
create_file_data ( " msitest \\ manifest_local.txt " , manifest_local , 0 ) ;
create_file ( " msitest \\ application_win32.txt " , 1000 ) ;
create_file ( " msitest \\ application_dotnet.txt " , 1000 ) ;
2018-09-04 02:17:56 +02:00
create_file ( " msitest \\ fake_local.txt " , 1000 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , pa_tables , ARRAY_SIZE ( pa_tables ) ) ;
2011-01-10 09:43:34 +01:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto done ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
res = RegOpenKeyA ( HKEY_CURRENT_USER , path_dotnet , & hkey ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_REG_STR ( hkey , name_dotnet , " rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~] " ) ;
RegCloseKey ( hkey ) ;
path = ( is_wow64 | | is_64bit ) ? path_dotnet_local_wow64 : path_dotnet_local ;
res = RegOpenKeyA ( HKEY_CURRENT_USER , path , & hkey ) ;
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_REG_STR ( hkey , name_dotnet_local , " rcHQPHq?CA@Uv-XqMI1e>LF,8A?0d.AW@vcZ$Cgox " ) ;
RegCloseKey ( hkey ) ;
res = RegOpenKeyA ( HKEY_CURRENT_USER , path_win32 , & hkey ) ;
2018-09-04 02:17:55 +02:00
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_REG_STR ( hkey , name_win32 , " rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(% " ) ;
2011-01-10 09:43:34 +01:00
RegCloseKey ( hkey ) ;
path = ( is_wow64 | | is_64bit ) ? path_win32_local_wow64 : path_win32_local ;
res = RegOpenKeyA ( HKEY_CURRENT_USER , path , & hkey ) ;
2018-09-04 02:17:55 +02:00
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_REG_STR ( hkey , name_win32_local , " rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X! " ) ;
2011-01-10 09:43:34 +01:00
RegCloseKey ( hkey ) ;
2018-09-04 02:17:56 +02:00
/* No registration is done for a local assembly with no matching file */
path = ( is_wow64 | | is_64bit ) ? path_fake_local_wow64 : path_fake_local ;
res = RegOpenKeyA ( HKEY_CURRENT_USER , path , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " got %u \n " , res ) ;
2011-01-10 09:43:34 +01:00
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
res = RegOpenKeyA ( HKEY_CURRENT_USER , path_dotnet , & hkey ) ;
2011-01-20 09:07:05 +01:00
if ( res = = ERROR_SUCCESS )
{
res = RegDeleteValueA ( hkey , name_dotnet ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
RegCloseKey ( hkey ) ;
}
2011-01-10 09:43:34 +01:00
path = ( is_wow64 | | is_64bit ) ? path_dotnet_local_wow64 : path_dotnet_local ;
res = RegOpenKeyA ( HKEY_CURRENT_USER , path , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
res = RegOpenKeyA ( HKEY_CURRENT_USER , path_win32 , & hkey ) ;
2011-01-20 09:07:05 +01:00
if ( res = = ERROR_SUCCESS )
{
res = RegDeleteValueA ( hkey , name_win32 ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
RegCloseKey ( hkey ) ;
}
2011-01-10 09:43:34 +01:00
path = ( is_wow64 | | is_64bit ) ? path_win32_local_wow64 : path_win32_local ;
res = RegOpenKeyA ( HKEY_CURRENT_USER , path , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
2011-01-20 09:07:05 +01:00
r = MsiInstallProductA ( msifile , " ALLUSERS=1 " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
2011-01-27 11:35:36 +01:00
access = KEY_QUERY_VALUE ;
res = RegOpenKeyExA ( HKEY_CLASSES_ROOT , classes_path_dotnet , 0 , access , & hkey ) ;
if ( res = = ERROR_FILE_NOT_FOUND & & is_wow64 ) /* Vista WOW64 */
{
trace ( " Using 64-bit registry view for HKCR \\ Installer \n " ) ;
access = KEY_QUERY_VALUE | KEY_WOW64_64KEY ;
res = RegOpenKeyExA ( HKEY_CLASSES_ROOT , classes_path_dotnet , 0 , access , & hkey ) ;
}
2011-01-20 09:07:05 +01:00
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_REG_STR ( hkey , name_dotnet , " rcHQPHq?CA@Uv-XqMI1e>Z'q,T*76M@=YEg6My?~] " ) ;
RegCloseKey ( hkey ) ;
path = ( is_wow64 | | is_64bit ) ? classes_path_dotnet_local_wow64 : classes_path_dotnet_local ;
2011-01-27 11:35:36 +01:00
res = RegOpenKeyExA ( HKEY_CLASSES_ROOT , path , 0 , access , & hkey ) ;
2011-01-20 09:07:05 +01:00
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_REG_STR ( hkey , name_dotnet_local , " rcHQPHq?CA@Uv-XqMI1e>LF,8A?0d.AW@vcZ$Cgox " ) ;
RegCloseKey ( hkey ) ;
2011-01-27 11:35:36 +01:00
res = RegOpenKeyExA ( HKEY_CLASSES_ROOT , classes_path_win32 , 0 , access , & hkey ) ;
2018-09-04 02:17:55 +02:00
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_REG_STR ( hkey , name_win32 , " rcHQPHq?CA@Uv-XqMI1e>}NJjwR'%D9v1p!v{WV(% " ) ;
2011-01-20 09:07:05 +01:00
RegCloseKey ( hkey ) ;
path = ( is_wow64 | | is_64bit ) ? classes_path_win32_local_wow64 : classes_path_win32_local ;
2011-01-27 11:35:36 +01:00
res = RegOpenKeyExA ( HKEY_CLASSES_ROOT , path , 0 , access , & hkey ) ;
2018-09-04 02:17:55 +02:00
ok ( res = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %d \n " , res ) ;
CHECK_REG_STR ( hkey , name_win32_local , " rcHQPHq?CA@Uv-XqMI1e>C)Uvlj*53A)u(QQ9=)X! " ) ;
2011-01-20 09:07:05 +01:00
RegCloseKey ( hkey ) ;
2018-09-04 02:17:56 +02:00
/* No registration is done for a local assembly with no matching file */
path = ( is_wow64 | | is_64bit ) ? classes_path_fake_local_wow64 : classes_path_fake_local ;
res = RegOpenKeyExA ( HKEY_CLASSES_ROOT , path , 0 , access , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " got %u \n " , res ) ;
2011-01-24 15:22:11 +01:00
r = MsiInstallProductA ( msifile , " REMOVE=ALL ALLUSERS=1 " ) ;
2011-01-20 09:07:05 +01:00
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , classes_path_dotnet , & hkey ) ;
if ( res = = ERROR_SUCCESS )
{
res = RegDeleteValueA ( hkey , name_dotnet ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
RegCloseKey ( hkey ) ;
}
path = ( is_wow64 | | is_64bit ) ? classes_path_dotnet_local_wow64 : classes_path_dotnet_local ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , path , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , classes_path_win32 , & hkey ) ;
if ( res = = ERROR_SUCCESS )
{
res = RegDeleteValueA ( hkey , name_win32 ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
RegCloseKey ( hkey ) ;
}
path = ( is_wow64 | | is_64bit ) ? classes_path_win32_local_wow64 : classes_path_win32_local ;
res = RegOpenKeyA ( HKEY_CLASSES_ROOT , path , & hkey ) ;
ok ( res = = ERROR_FILE_NOT_FOUND , " Expected ERROR_FILE_NOT_FOUND, got %d \n " , res ) ;
2011-01-10 09:43:34 +01:00
done :
DeleteFileA ( " msitest \\ win32.txt " ) ;
DeleteFileA ( " msitest \\ win32_local.txt " ) ;
DeleteFileA ( " msitest \\ dotnet.txt " ) ;
DeleteFileA ( " msitest \\ dotnet_local.txt " ) ;
DeleteFileA ( " msitest \\ manifest.txt " ) ;
DeleteFileA ( " msitest \\ manifest_local.txt " ) ;
DeleteFileA ( " msitest \\ application_win32.txt " ) ;
DeleteFileA ( " msitest \\ application_dotnet.txt " ) ;
2018-09-04 02:17:56 +02:00
DeleteFileA ( " msitest \\ fake_local.txt " ) ;
2011-01-10 09:43:34 +01:00
delete_test_files ( ) ;
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
2011-01-10 09:43:34 +01:00
}
2012-07-31 12:25:42 +02:00
static void test_remove_existing_products ( void )
{
UINT r ;
if ( is_process_limited ( ) )
{
skip ( " process is limited \n " ) ;
return ;
}
create_test_files ( ) ;
create_file ( " msitest \\ rep.txt " , 1000 ) ;
2018-06-15 18:54:38 +02:00
create_database ( msifile , rep_tables , ARRAY_SIZE ( rep_tables ) ) ;
2012-07-31 12:25:42 +02:00
MsiSetInternalUI ( INSTALLUILEVEL_NONE , NULL ) ;
r = MsiInstallProductA ( msifile , NULL ) ;
if ( r = = ERROR_INSTALL_PACKAGE_REJECTED )
{
skip ( " Not enough rights to perform tests \n " ) ;
goto error ;
}
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
r = MsiInstallProductA ( msifile , " REMOVE=ALL " ) ;
ok ( r = = ERROR_SUCCESS , " Expected ERROR_SUCCESS, got %u \n " , r ) ;
ok ( ! delete_pf ( " msitest \\ rep.txt " , TRUE ) , " file not removed \n " ) ;
ok ( ! delete_pf ( " msitest " , FALSE ) , " directory not removed \n " ) ;
error :
DeleteFileA ( " msitest \\ rep.txt " ) ;
delete_test_files ( ) ;
2013-10-15 13:04:45 +02:00
DeleteFileA ( msifile ) ;
2012-07-31 12:25:42 +02:00
}
2010-10-14 11:06:13 +02:00
START_TEST ( action )
{
DWORD len ;
char temp_path [ MAX_PATH ] , prev_path [ MAX_PATH ] , log_file [ MAX_PATH ] ;
STATEMGRSTATUS status ;
BOOL ret = FALSE ;
init_functionpointers ( ) ;
if ( pIsWow64Process )
pIsWow64Process ( GetCurrentProcess ( ) , & is_wow64 ) ;
GetCurrentDirectoryA ( MAX_PATH , prev_path ) ;
2013-10-15 13:04:45 +02:00
GetTempPathA ( MAX_PATH , temp_path ) ;
2010-10-14 11:06:13 +02:00
SetCurrentDirectoryA ( temp_path ) ;
lstrcpyA ( CURR_DIR , temp_path ) ;
len = lstrlenA ( CURR_DIR ) ;
if ( len & & ( CURR_DIR [ len - 1 ] = = ' \\ ' ) )
CURR_DIR [ len - 1 ] = 0 ;
2011-03-07 12:39:35 +01:00
ok ( get_system_dirs ( ) , " failed to retrieve system dirs \n " ) ;
ok ( get_user_dirs ( ) , " failed to retrieve user dirs \n " ) ;
2010-10-14 11:06:13 +02:00
/* Create a restore point ourselves so we circumvent the multitude of restore points
* that would have been created by all the installation and removal tests .
*
* This is not needed on version 5.0 where setting MSIFASTINSTALL prevents the
* creation of restore points .
*/
if ( pSRSetRestorePointA & & ! pMsiGetComponentPathExA )
{
memset ( & status , 0 , sizeof ( status ) ) ;
ret = notify_system_change ( BEGIN_NESTED_SYSTEM_CHANGE , & status ) ;
}
/* Create only one log file and don't append. We have to pass something
* for the log mode for this to work . The logfile needs to have an absolute
* path otherwise we still end up with some extra logfiles as some tests
* change the current directory .
*/
lstrcpyA ( log_file , temp_path ) ;
lstrcatA ( log_file , " \\ msitest.log " ) ;
MsiEnableLogA ( INSTALLLOGMODE_FATALEXIT , log_file , 0 ) ;
test_register_product ( ) ;
test_publish_product ( ) ;
test_publish_features ( ) ;
test_register_user ( ) ;
test_process_components ( ) ;
test_publish ( ) ;
test_publish_sourcelist ( ) ;
test_remove_files ( ) ;
test_move_files ( ) ;
test_duplicate_files ( ) ;
test_write_registry_values ( ) ;
test_envvar ( ) ;
2010-11-26 14:03:31 +01:00
test_create_remove_folder ( ) ;
2014-12-02 12:41:26 +01:00
test_start_stop_services ( ) ;
2010-10-14 11:06:13 +02:00
test_delete_services ( ) ;
2014-02-21 16:52:12 +01:00
test_install_services ( ) ;
2010-10-14 11:06:13 +02:00
test_self_registration ( ) ;
test_register_font ( ) ;
test_validate_product_id ( ) ;
test_install_remove_odbc ( ) ;
test_register_typelib ( ) ;
test_create_remove_shortcut ( ) ;
test_publish_components ( ) ;
test_remove_duplicate_files ( ) ;
test_find_related_products ( ) ;
2018-05-31 03:47:35 +02:00
test_ini_values ( ) ;
2010-10-14 11:06:13 +02:00
test_register_class_info ( ) ;
test_register_extension_info ( ) ;
2014-02-24 22:00:55 +01:00
test_register_progid_info ( ) ;
2010-10-14 11:06:13 +02:00
test_register_mime_info ( ) ;
2011-01-10 09:43:34 +01:00
test_publish_assemblies ( ) ;
2012-07-31 12:25:42 +02:00
test_remove_existing_products ( ) ;
2010-10-14 11:06:13 +02:00
DeleteFileA ( log_file ) ;
if ( pSRSetRestorePointA & & ! pMsiGetComponentPathExA & & ret )
{
ret = notify_system_change ( END_NESTED_SYSTEM_CHANGE , & status ) ;
if ( ret )
remove_restore_point ( status . llSequenceNumber ) ;
}
SetCurrentDirectoryA ( prev_path ) ;
}