1*32b1fd08SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*32b1fd08SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*32b1fd08SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*32b1fd08SAndrew Rist * distributed with this work for additional information 6*32b1fd08SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*32b1fd08SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*32b1fd08SAndrew Rist * "License"); you may not use this file except in compliance 9*32b1fd08SAndrew Rist * with the License. You may obtain a copy of the License at 10*32b1fd08SAndrew Rist * 11*32b1fd08SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*32b1fd08SAndrew Rist * 13*32b1fd08SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*32b1fd08SAndrew Rist * software distributed under the License is distributed on an 15*32b1fd08SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*32b1fd08SAndrew Rist * KIND, either express or implied. See the License for the 17*32b1fd08SAndrew Rist * specific language governing permissions and limitations 18*32b1fd08SAndrew Rist * under the License. 19*32b1fd08SAndrew Rist * 20*32b1fd08SAndrew Rist *************************************************************/ 21*32b1fd08SAndrew Rist 22*32b1fd08SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #define _WIN32_WINNT 0x0401 25cdf0e10cSrcweir 26cdf0e10cSrcweir #ifdef _MSC_VER 27cdf0e10cSrcweir #pragma warning(push, 1) /* disable warnings within system headers */ 28cdf0e10cSrcweir #endif 29cdf0e10cSrcweir #define WIN32_LEAN_AND_MEAN 30cdf0e10cSrcweir #include <windows.h> 31cdf0e10cSrcweir #include <msiquery.h> 32cdf0e10cSrcweir #ifdef _MSC_VER 33cdf0e10cSrcweir #pragma warning(pop) 34cdf0e10cSrcweir #endif 35cdf0e10cSrcweir 36cdf0e10cSrcweir #include <malloc.h> 37cdf0e10cSrcweir #include <assert.h> 38cdf0e10cSrcweir 39cdf0e10cSrcweir #ifdef UNICODE 40cdf0e10cSrcweir #define _UNICODE 41cdf0e10cSrcweir #define _tstring wstring 42cdf0e10cSrcweir #else 43cdf0e10cSrcweir #define _tstring string 44cdf0e10cSrcweir #endif 45cdf0e10cSrcweir #include <tchar.h> 46cdf0e10cSrcweir #include <string> 47cdf0e10cSrcweir #include <queue> 48cdf0e10cSrcweir #include <stdio.h> 49cdf0e10cSrcweir 50cdf0e10cSrcweir #include <systools/win32/uwinapi.h> 51cdf0e10cSrcweir #include <../tools/seterror.hxx> 52cdf0e10cSrcweir 53cdf0e10cSrcweir static void SetMsiProperty(MSIHANDLE handle, const std::_tstring& sProperty) 54cdf0e10cSrcweir { 55cdf0e10cSrcweir MsiSetProperty(handle, sProperty.c_str(), TEXT("1")); 56cdf0e10cSrcweir } 57cdf0e10cSrcweir 58cdf0e10cSrcweir extern "C" UINT __stdcall SetAdminInstallProperty(MSIHANDLE handle) 59cdf0e10cSrcweir { 60cdf0e10cSrcweir SetMsiProperty(handle, TEXT("ADMININSTALL")); 61cdf0e10cSrcweir return ERROR_SUCCESS; 62cdf0e10cSrcweir } 63