/build/static/layout/Breadcrumb_cap_w.png

MsiReinstallProduct

Hello

I created installer written in C#. It is exe file with MSI package as embedded resource.During installation is MSI package copied from exe to current directory, run and after installation is deleted from current directory.
If on target computer is installed some of previous version of product, so it is listed in runtime of exe. If user want to upgrade to newer version of application, so he choode it, click button and then copied from exe updated msi package and called method MsiReinstallProduct with productcode of that upgraded as first paramater, and next parameters are REINSTALLMODE_PACKAGE, REINSTALLMODE_FILEREPLACE, REINSTALLMODE_MACHINEDATA, REINSTALLMODE_USERDATA, and REINSTALLMODE_SHORTCUT.
As result, everything is working correctly except for dialog which asks to find msi package, it looks for package in the current directory from when that application was installed. this dialog should be removed.
Do you know solution of this problem?

0 Comments   [ + ] Show comments

Answers (7)

Posted by: anonymous_9363 12 years ago
Red Belt
0
I'd wager the package was installed by CD/DVD or a now defunct share/mapped drive. You'll need to manipulate the package's SourceList. Easily done.

BTW, you could avoid a whole world of pain by using the WindowsInstaller.Installer object model instead of using the APIs...
Posted by: Sorg 12 years ago
Senior Yellow Belt
0
Thanks, but one question. I met this source list also in connection with security policies of Windows server systems. how can I manage this source list. I think this is row in PROPERTY table, but I wonder what values should be there. Because I also need generate secure transforms, and there should be listed at this source list. Plesae do you have some example hoew to handle this? I looked at MSDN, but information there are without examples.
So my question is: if I have Property SOURCELIST in property table how to define values of this property. Thank you.
Posted by: pjgeutjens 12 years ago
Red Belt
0
The SOURCELIST property is a semicolon-delimited list of network or URL source paths to the application's installation package

so, a simicolon delimited list of source locations, like \\SERVER1\SHARE1;\\SERVER2\SHARE2 ... etc

be aware though that

The installer only checks the SOURCELIST property if the product has not already been advertised or installed. In all other cases the installer uses the existing source list that is in the registry.


so this list will only work on initial install, not on subsequent installs, then Windows Installer goes back to the SourceList as stored in the registry.

PJ
Posted by: anonymous_9363 12 years ago
Red Belt
0
I was referring to your situation where users are being prompted for the location of the source media for an existing installation that needs to be removed. As I mentioned, using the WindowsInstaller.Installer object makes it easy:With objInstaller
blnStatus = .ClearSourceList(strProductCode, "")
blnStatus = .AddSource(strProductCode, "", strTempPath & "\" & strMSITempPath)
End With
Posted by: pjgeutjens 12 years ago
Red Belt
0
Ian,

Good one on the vbs code first of all
I was wondering, does that code bypass the "only checked on first install" behaviour, or would you need to add an

blnStatus = .ForceSourceListResolution(strProductCode,"")


I know I could test this, but maybe you know this by heart [:)]

PJ
Posted by: anonymous_9363 12 years ago
Red Belt
0
Not a clue, I'm afraid, Pieter. It was something I'd added as a pilot in code I built years ago for a client who, as far as I know, never implemented it. Adding that method wouldn't hurt, though.
Posted by: pjgeutjens 12 years ago
Red Belt
0
Just tested it myself, it seems the new source gets added directly to the SourceList in the registry, so it should work right away...
It's been AGES since I worked with the WindowsInstaller.Installer object myself (it's really the kind of code you only write once, and then you save it somewhere convenient), I was curious [:)]
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ