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

What is “88-type” in C# and how can i use it?
C# Regex to convert yyyyMMddhhmm
EntityFramework package version=“6.1.3” and Web config version 6.0.0.0?
How to read a binary formatted string from a file?
Why My combobox binding not working
convert timespan to datetime
call to method inside code behind file(aspx.cs file) from controller method
Casting exposes private data via getter method
How to get a proper date from a text?
Problems converting an Oracle plsql stored procedure call to C# (invalid array bind size)
How to handle null value in entity framework sum function
Audio stream requested using HttpClient doesn't play until file is completely downloaded
Complex grouping in Linq? C#.net
How to prevent duplicate items from being added to an IRepository?
C# Convert All Dependency Properties to INotifyPropertyChanged
Why won't my program open on Pocket PC?

Categories

HOME
actionscript-3
joomla
kendo-ui
locale
mysqli
snappy
x86-64
ubuntu-14.04
pip
wavefront
dcos
velocity
elastalert
jetbrains
fine-uploader
logstash-configuration
appsettings
nsoperation
ringcentral
autologin
bootstrap-datetimepicker
url-parameters
datasource
jq
bug-reporting
fibonacci
connectiq
fastboot
google-drive-android-api
inline-assembly
prepros
gsuite
aspxgridview
jira-zephyr
scalatest
nsopenpanel
akavache
libxml2
csproj
undo
multilanguage
webmock
pyenv
ragel
leaderboard
console.readline
icu
pyexcel
grails-2.0
line-endings
infovis
g77
ear
typewriter
stringbuilder
easy-thumbnails
android-music-player
racket-student-languages
mac-app-store
settext
boost-range
require-handlebars
mate-desktop
vga
syslog4j
recurring
avi
jde
window.location
pebble-js
nugetgallery
nonblocking
angular-promise
windows-kernel
om
azure-mobile-app
p4python
accpac
dockerpy
sony-xperia
pysvn
launcher
javadb
qf-test
formbuilder
system.net
twitter-finagle
connections
lastinsertid
pechkin
panelgrid
proj4
system.transactions
zepto
tasklist
invalidoperationexception
junit-rule
m3u
teamsystem
netbiscuits
netzke
states
filedialog
beep
motorola-droid
jqzoom
capitalization
windows-xp-embedded
funambol
excellibrary
database-agnostic
projectgen
scalable

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