c#


Exception while installing VFPOLEDB programmatically


I am trying to install VFPOLEDB driver via a console application.
I tried doing something like this
public void InstallVfpOledb()
{
Type type = Type.GetTypeFromProgID("WindowsInstaller.Installer");
try
{
Installer installer = (Installer)Activator.CreateInstance(type);
installer.InstallProduct(#"C:\VFPOLEDBSetup.msi");
}
catch (Exception e)
{
Console.Write(e.ToString());
}
}
So when I run the program I get the following exception:
System.Runtime.InteropServices.COMException (0x80004005):
InstallProduct,PackagePath,PropertyValues at
System.RuntimeType.ForwardCallToInvokeMember(String memberName,
BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&
msgData) at WindowsInstaller.Installer.InstallProduct(String
PackagePath, String PropertyValues) at
installtest.Program.Main(String[] args) line 22
I believe InstallProduct method has path and property values as parameters.
I am missing those values I guess.
Can anyone point me in the correct direction for the same?
This one works for me:
// using Microsoft.Deployment.WindowsInstaller in
// Microsoft.Deployment.WindowsInstaller.dll
try
{
Installer.InstallProduct(#"C:\VFPOLEDBSetup.msi","");
}
catch (Exception e)
{
Console.Write(e.Message);
}
It asks for permission if not run as administrator.

Related Links

How to run DirectX code samples on Visual Studio 2015 and Windows 10?
How to backup the database from the server to the client computer using asp.net page
How to convert Android.Net.Uri path to physical path in xamarin?
WPF Datagrid has data in the rows but not displaying text
c#.net Word add-in
How to select only content in the sheet rather all unused/empty cell value
Only Half of a Deck of Cards Being Created [closed]
C# string Dictionary sorting
Using ToListAsync on an IQueryable
TFS API Console Application opens and closes
return File (memory stream) encoding
XslCompiledTransform.Transform: pass a list of strings as input parameter and check “input array contains”
C# OpenCV: Detecting a Stop Sign
Not understanding the purpose of memory barriers in C#
EntityValidationErrors Property??? Validation failed for one or more entities. See 'EntityValidationErrors' property for more details
Webrequest looks identical but won't log in?

Categories

HOME
url
google-cloud-pubsub
algolia
blob
okhttp3
assign
bitbucket
crash
css-selectors
swap
opacity
kendo-asp.net-mvc
hibernate-mapping
schema
scapy
ejb-3.0
phpexcel
suitecrm
point-of-sale
guidewire
email-attachments
github-flavored-markdown
orange
caldav
typedef
angular2-pipe
inline-assembly
ecmascript-2017
aspxgridview
poisson
hierarchy
folder
selenium3
edsdk
key-bindings
apache-falcon
repeat
yelp
susy
noise
cancan
jcifs
liferay-ide
bipartite
indoor-positioning-system
universe
vga
recurring
airwatch
queuing
mrunit
clique
jsondoc
bluetooth-lowenergy-4.2
commercetools
biginsights
exchange-server-2007
pagecontrol
pdcurses
android-networking
minko
nexusdb
crystal-reports-7
vundle
disparity-mapping
parallel-port
mdp
mysql-error-1146
xcode6.1-gm-seed
cab
caroufredsel
maven-webstart-plugin
uikit-dynamics
proj4
exi
auctex
shapado
ios6-maps
automapper-2
wdm
vectorwise
windows-xp-embedded
netbeans7.0
azure-appfabric
time-management
expander
cross-cutting-concerns
software-update
asp.net-1.1
tracd

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html