Pkg not appearing in Add/Remove
Hello,
I have a sample package that I am trying to install from the service using CreateProcess something like this,
I can see that it is getting installed at the correct location but I can't see its entry in Add/Remove programs list. If directly run, SampleMsi.msi gets installed correctly with an entry in Add/Remove program.
I have a sample package that I am trying to install from the service using CreateProcess something like this,
CreateProcess(
NULL,
"msiexec.exe /i C:\\SampleMsi.msi /quiet",
NULL, NULL,
FALSE,0 ,
NULL,NULL,
&si,
&pi);
I can see that it is getting installed at the correct location but I can't see its entry in Add/Remove programs list. If directly run, SampleMsi.msi gets installed correctly with an entry in Add/Remove program.
0 Comments
[ + ] Show comments
Answers (34)
Please log in to answer
Posted by:
milindsm
14 years ago
I am using hard coded path for Pkg_B.msi.
Even more simplified flow,
1. Pkg_A.msi has installed one service
2. The service is running smoothly.
3. When it (The service) comes across Pkg_B.msi at HARD CODED path (I am copying it manually at this moment for testing), it (the service) should install Pkg_B.msi
4. Service calls CreateProcess with application = msiexec.exe and args as HARD CODED Pkg_B.msi path (of course with appropriate switches)
Even more simplified flow,
1. Pkg_A.msi has installed one service
2. The service is running smoothly.
3. When it (The service) comes across Pkg_B.msi at HARD CODED path (I am copying it manually at this moment for testing), it (the service) should install Pkg_B.msi
4. Service calls CreateProcess with application = msiexec.exe and args as HARD CODED Pkg_B.msi path (of course with appropriate switches)
Posted by:
anonymous_9363
14 years ago
Posted by:
milindsm
14 years ago
Posted by:
anonymous_9363
14 years ago
Posted by:
milindsm
14 years ago
I think you are getting me wrong. I am using ServiceInstall and ServiceControl. The scenario is something like this,
1. Pkg_A.msi installs the service.
2. Once the service is installed and started, it installs Pkg_B.msi (using ShellExecute/CreateProcess) which is already there on the disk.
3. Now my problem is, Pkg_B.msi gets installed at the correct location but it does not appear in Add/Remove program list.
1. Pkg_A.msi installs the service.
2. Once the service is installed and started, it installs Pkg_B.msi (using ShellExecute/CreateProcess) which is already there on the disk.
3. Now my problem is, Pkg_B.msi gets installed at the correct location but it does not appear in Add/Remove program list.
Posted by:
anonymous_9363
14 years ago
Posted by:
milindsm
14 years ago
Posted by:
spartacus
14 years ago
Have you had a look in the registry in the key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
(Do a search of all subkeys for the ProductCode of Pkg_B.msi)
Also, does the service which installs Pkg_B.msi run under the Local System account, or a specific user account? I'm just wondering whether this may be a Per-User / Per Machine related issue (?)
Regards,
Spartacus
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
(Do a search of all subkeys for the ProductCode of Pkg_B.msi)
Also, does the service which installs Pkg_B.msi run under the Local System account, or a specific user account? I'm just wondering whether this may be a Per-User / Per Machine related issue (?)
Regards,
Spartacus
Posted by:
milindsm
14 years ago
Posted by:
spartacus
14 years ago
OK, well heres a method you could try to see if your Add/Remove Programs entry for the package is only visible to the Local System account.
1) Log on as Administrator
2) Click Start .. Run .. "cmd.exe" to start a command window
3) At the command prompt enter
[font="courier new"]sc create testsvc binpath= "cmd /K start" type= own type= interact
[font="courier new"]
4) Now type [font="courier new"]sc start testsvc
[font="courier new"]
5) This will launch a second command window running in Local System context
(ignore the error "The service did not respond to the start or control request in a
timely fashion" which appears in the first command window)
6) In the second command window, type the following
[font="courier new"]rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,1
This should give you the Local System account's "view" of Add/Remove Programs.
Is your application listed in this view ? If it is, I don't think it should be ....
Regards
Spartacus
1) Log on as Administrator
2) Click Start .. Run .. "cmd.exe" to start a command window
3) At the command prompt enter
[font="courier new"]
[font="courier new"]
4) Now type [font="courier new"]
[font="courier new"]
5) This will launch a second command window running in Local System context
(ignore the error "The service did not respond to the start or control request in a
timely fashion" which appears in the first command window)
6) In the second command window, type the following
[font="courier new"]
This should give you the Local System account's "view" of Add/Remove Programs.
Is your application listed in this view ? If it is, I don't think it should be ....
Regards
Spartacus
Posted by:
milindsm
14 years ago
Posted by:
anonymous_9363
14 years ago
Posted by:
milindsm
14 years ago
Posted by:
spartacus
14 years ago
Posted by:
MSIPackager
14 years ago
Posted by:
milindsm
14 years ago
Posted by:
michaelnowell
14 years ago
I have a question. Why do you need to run the MSI as a service?
If you run Sample.msi directly it appears in Add/Remove Programs or Programs and Features.
If you run it from within the service then it doesn't appear in Add/Remove Programs or Programs and Features.
Either your package is installing as per-user or it failing when run as the System account.
I assume that you are using logging and have looked at them thoroughly.
If you run Sample.msi directly it appears in Add/Remove Programs or Programs and Features.
If you run it from within the service then it doesn't appear in Add/Remove Programs or Programs and Features.
Either your package is installing as per-user or it failing when run as the System account.
I assume that you are using logging and have looked at them thoroughly.
Posted by:
milindsm
14 years ago
Posted by:
mitrokin
14 years ago
Posted by:
anonymous_9363
14 years ago
Posted by:
milindsm
14 years ago
Posted by:
anonymous_9363
14 years ago
Posted by:
milindsm
14 years ago
Posted by:
anonymous_9363
14 years ago
Posted by:
milindsm
14 years ago
Product code is different for both. Let me make the flow clear
1. I run Pkg_A.msi.
2. Pkg_A.msi installs a service on the machine (ServiceInstall & ServiceControl Table approach) and it is started immediately.
3. This service when started, calls CreateProcess with following arguments,
I have purposely kept Pkg_B.msi at C:\ for testing purpose.
Observations
1. I run Pkg_A.msi.
2. Pkg_A.msi installs a service on the machine (ServiceInstall & ServiceControl Table approach) and it is started immediately.
3. This service when started, calls CreateProcess with following arguments,
CreateProcess(
NULL,
"msiexec.exe /i C:\\Pkg_B.msi /quiet /l* C:\\Pkg_B.log",
NULL, NULL,
FALSE,0 ,
NULL,NULL,
&si,
&pi);
I have purposely kept Pkg_B.msi at C:\ for testing purpose.
Observations
- Pkg_B.msi doesn't appear in "Programs & Features"
- Pkg_B.msi is present at C:\Programs Files.
- After verifying this, if I try to install Pkg_B.msi manually (double click), it doesn't show Remove/Repair Dialog. Does that mean the pkg is not getting registered properly ?
Posted by:
milindsm
14 years ago
Posted by:
anonymous_9363
14 years ago
Posted by:
milindsm
14 years ago
After verifying this, if I try to install Pkg_B.msi manuallyDoing that is pointless, since B is already installed.
There is no other way as B is not in the "Programs & Features" list and if I run Pkg_B.msi, ideally it should directly go to Repair/Remove but it goes to New Installation.
So whats happening is, B is not properly getting installed, its files are just being copied to "Program Files"
Posted by:
anonymous_9363
14 years ago
We're going round in circles here. My opinion now is that to have a service which attempts to install an MSI is all wrong. To begin with, doing it that way, your MSI must live alongside the Pkg_A's EXE or, worse, in a hard-coded path.
Re-work Pkg_A so that it tests for the presence of Pkg_B and bombs with an appropriate message it it's not found. Change your doucmentation so that Pkg_B is installed first, or whichever is the correct order.
Re-work Pkg_A so that it tests for the presence of Pkg_B and bombs with an appropriate message it it's not found. Change your doucmentation so that Pkg_B is installed first, or whichever is the correct order.
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.