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

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

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...
Answered 09/02/2011 by: VBScab
Red Belt

Please log in to comment
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.
Answered 09/02/2011 by: Sorg
Senior Yellow Belt

Please log in to comment
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
Answered 09/02/2011 by: pjgeutjens
Red Belt

Please log in to comment
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
Answered 09/02/2011 by: VBScab
Red Belt

Please log in to comment
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
Answered 09/02/2011 by: pjgeutjens
Red Belt

Please log in to comment
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.
Answered 09/02/2011 by: VBScab
Red Belt

Please log in to comment
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 [:)]
Answered 09/02/2011 by: pjgeutjens
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity