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?
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)
Please log in to answer
Posted by:
anonymous_9363
13 years ago
Posted by:
Sorg
13 years ago
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.
So my question is: if I have Property SOURCELIST in property table how to define values of this property. Thank you.
Posted by:
pjgeutjens
13 years ago
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
13 years ago
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
13 years ago
Posted by:
anonymous_9363
13 years ago
Posted by:
pjgeutjens
13 years ago
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 [:)]
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.
so that the conversation will remain readable.