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 can i hide in game view a ui button and show the button when pressing the escape key?
TCP Connection. best way to handle multiple connections [duplicate]
Send POST request with Image from Unity3D
How to make default Password Reset functionality work in ASP.NET Core
UriTemplate Matching Email
Error handling between web api and angular 2 client
Get Duplicates in List and Edit Item
Should I await a 'async Task' function if I don't care its return value? [duplicate]
Autofac open generics: factory IIndex based on <U>
string with StingBuilder error c#
Mono SQLite with CF 3.5
EWS Oauth Exception: The request failed. The remote server returned an error: (401) Unauthorized
Reports in MS Word. Any library? [closed]
Display two model in a View?
How to Install Visual Studio Extension into specific folder?
Accessing a variable from player prefs in another scene

Categories

HOME
oop
leaflet
ns2
locale
openacc
azure-eventhub
esxi
thermal-printer
segmentation-fault
google-my-business-api
point-of-sale
comma
google-closure-compiler
background-image
loss
passbook
gpo
summernote
procedural-generation
adobe-captivate
emr
jms-topic
ds-5
slim-lang
minitest
azure-vm-scale-set
campaign-monitor
multi-user
anypoint-studio
stdin
ngrok
wicket-tester
socketcluster
java-5
amazon-fire-tv
line-endings
emacs24
extjs3
sharpssh
typewriter
programming-pearls
addressbook
easy-thumbnails
gevent
mavlink
visual-web-developer
user-profile
paypal-subscriptions
jcomponent
edgar
self-join
exchange-server-2007
roslyn-code-analysis
properties-file
transparentproxy
page-refresh
tidesdk
diffmerge
conditional-comments
vundle
xpand
smartxls
lettuce
jsmpp
farpoint-spread
iwork
git-subtree
logo-lang
infinity.js
nsautoreleasepool
cloudmade
rbm
gpl
volatility
xcode4.6.3
nserror
parsec
jqueryi-ui-buttonset
sqlbuddy
apache-commons-email
funambol
viewdata
arraycollection
chars
linq-to-mysql
glassfish-embedded
onresize
paperless

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
Mobile App
Mobile App
Mobile App