Skip to content

Commit d15d81d

Browse files
winesynclearn-more
authored andcommitted
[WINESYNC] msi/tests: Test installation of ODBC driver.
Signed-off-by: Zebediah Figura <[email protected]> Signed-off-by: Hans Leidekker <[email protected]> Signed-off-by: Alexandre Julliard <[email protected]> wine commit id 7f69ea3c57b9caa0fd39e6cb3c0164d7b37aa21b by Zebediah Figura <[email protected]>
1 parent 49fb19d commit d15d81d

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

modules/rostests/winetests/msi/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ endif()
4343

4444
target_link_libraries(msi_winetest uuid)
4545
set_module_type(msi_winetest win32cui)
46-
add_importlibs(msi_winetest cabinet msi shell32 ole32 oleaut32 user32 advapi32 version msvcrt kernel32)
46+
add_importlibs(msi_winetest cabinet msi shell32 ole32 oleaut32 odbccp32 user32 advapi32 version msvcrt kernel32)
4747
add_pch(msi_winetest precomp.h "${PCH_SKIP_SOURCE}")
4848
add_rostests_file(TARGET msi_winetest)
4949
add_dependencies(msi_winetest custom)

modules/rostests/winetests/msi/action.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include <wtypes.h>
3333
#include <shellapi.h>
3434
#include <winsvc.h>
35+
#include <odbcinst.h>
3536

3637
#include "wine/test.h"
3738
#include "utils.h"
@@ -825,18 +826,22 @@ static const char odbc_feature_comp_dat[] =
825826
"Feature_\tComponent_\n"
826827
"s38\ts72\n"
827828
"FeatureComponents\tFeature_\tComponent_\n"
829+
"odbc\todbc64\n"
828830
"odbc\todbc\n";
829831

830832
static const char odbc_component_dat[] =
831833
"Component\tComponentId\tDirectory_\tAttributes\tCondition\tKeyPath\n"
832834
"s72\tS38\ts72\ti2\tS255\tS72\n"
833835
"Component\tComponent\n"
836+
"odbc64\t{B6F3E4AF-35D1-4B72-9044-989F03E20A43}\tMSITESTDIR\t256\tMsix64\tODBCdriver.dll\n"
834837
"odbc\t{B6F3E4AE-35D1-4B72-9044-989F03E20A43}\tMSITESTDIR\t0\t\tODBCdriver.dll\n";
835838

836839
static const char odbc_driver_dat[] =
837840
"Driver\tComponent_\tDescription\tFile_\tFile_Setup\n"
838841
"s72\ts72\ts255\ts72\tS72\n"
839842
"ODBCDriver\tDriver\n"
843+
"64-bit driver\todbc64\tODBC test driver\tODBCdriver.dll\t\n"
844+
"64-bit driver2\todbc64\tODBC test driver2\tODBCdriver2.dll\tODBCsetup.dll\n"
840845
"ODBC test driver\todbc\tODBC test driver\tODBCdriver.dll\t\n"
841846
"ODBC test driver2\todbc\tODBC test driver2\tODBCdriver2.dll\tODBCsetup.dll\n";
842847

@@ -5347,6 +5352,9 @@ static void test_validate_product_id(void)
53475352

53485353
static void test_install_remove_odbc(void)
53495354
{
5355+
int gotdriver = 0, gotdriver2 = 0;
5356+
char buffer[1000], *p;
5357+
WORD len;
53505358
UINT r;
53515359

53525360
if (is_process_limited())
@@ -5379,6 +5387,19 @@ static void test_install_remove_odbc(void)
53795387
ok(pf_exists("msitest\\ODBCtranslator2.dll"), "file not created\n");
53805388
ok(pf_exists("msitest\\ODBCsetup.dll"), "file not created\n");
53815389

5390+
r = SQLGetInstalledDrivers(buffer, sizeof(buffer), &len);
5391+
ok(len < sizeof(buffer), "buffer too small\n");
5392+
ok(r, "SQLGetInstalledDrivers failed\n");
5393+
for (p = buffer; *p; p += strlen(p) + 1)
5394+
{
5395+
if (!strcmp(p, "ODBC test driver"))
5396+
gotdriver = 1;
5397+
if (!strcmp(p, "ODBC test driver2"))
5398+
gotdriver2 = 1;
5399+
}
5400+
ok(gotdriver, "driver not installed\n");
5401+
ok(gotdriver2, "driver 2 not installed\n");
5402+
53825403
r = MsiInstallProductA(msifile, "REMOVE=ALL");
53835404
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
53845405

@@ -5389,6 +5410,20 @@ static void test_install_remove_odbc(void)
53895410
ok(!delete_pf("msitest\\ODBCsetup.dll", TRUE), "file not removed\n");
53905411
ok(!delete_pf("msitest", FALSE), "directory not removed\n");
53915412

5413+
gotdriver = gotdriver2 = 0;
5414+
r = SQLGetInstalledDrivers(buffer, sizeof(buffer), &len);
5415+
ok(len < sizeof(buffer), "buffer too small\n");
5416+
ok(r, "SQLGetInstalledDrivers failed\n");
5417+
for (p = buffer; *p; p += strlen(p) + 1)
5418+
{
5419+
if (!strcmp(p, "ODBC test driver"))
5420+
gotdriver = 1;
5421+
if (!strcmp(p, "ODBC test driver2"))
5422+
gotdriver2 = 1;
5423+
}
5424+
ok(!gotdriver, "driver not installed\n");
5425+
ok(!gotdriver2, "driver 2 not installed\n");
5426+
53925427
error:
53935428
DeleteFileA("msitest\\ODBCdriver.dll");
53945429
DeleteFileA("msitest\\ODBCdriver2.dll");

0 commit comments

Comments
 (0)