|
| >> The issue is there's not way to know if a user is uninstalling or[color=darkred]
Hi,
I am asnwering my own question - there are ways to tell uninstall from
reinstall,
I just wanted to check whether there is an official, blessed way to do that.
In my original post I didn't show all the picture.
According to my observations, the full sequence of calls is:
Install on PPC 2005 (either from AS or using CAB on device):
1. Loaded setup.dll into tmarshaller.exe
2. Install_Init(hwnd,1,0,)
hwnd: Class "Dialog" txt "Installation" app "Wceload.exe"
3. Install_Exit(same hwnd, , 0, 0, 0, 0, 0)
4. Unloaded setup.dll
Reinstall on PPC 2005 (either from AS or using CAB on device):
1. Loaded "New" setup.dll into tmarshaller.exe
2. Install_Init(hwnd,1,1,)
hwnd: Class "Dialog" txt "Installation" app "Wceload.exe"
3. Unloaded "New" setup.dll
4. - OS shows message "The previous version ... will be removed ..."
5. Loaded "Old" setup.dll into a different instance of tmarshaller.exe
6. Ininstall_Init(same hwnd,)
7. Uninstall_Exit(same hwnd)
8. Unloaded "Old" setup.dll
9. Loaded "New" setup.dll into yet another instance of tmarshaller.exe
10. Install_Init(same hwnd,0,0,)
11. Install_Exit(same hwnd, , 0, 0, 0, 0, 0)
12. Unloaded "New" setup.dll
Uninstall (either from AS or from Settings app):
1. Loaded "Old" setup.dll into tmarshaller.exe
2. Uninstall_Init(hwnd,)
- when running from Settings:
hwnd Class "REMOVEWORKER" txt "" app Shell32.exe
- when running from AS: hwnd == NULL
3. Uninstall_Exit(same hwnd)
So, I see two ways:
1. Simplest: get class of the hwnd in Ininstall_Init. If hwnd is NULL
or class is "REMOVEWORKER", then this is Uninstall, otherwise -
reinstall.
2. In Install_Init save hwnd to the registry. In Uninstall_Init compare.
If hwnd is the same (as well as process ID, which owns hwnd),
then this is reinstall, otherwise - uninstall.
My questions to MS:
1. Can I rely on the sequence of calls during reinstall to stay the same:
Install_Init(,1,1,)
Uninstall_Init
Uninstall_Exit
Install_Init(,0,0,)
Install_Exit
2. Can I rely on the hwnd during this sequence to stay the same?
3. Can I rely on the window class for hwnd passed to Ininstall_Init
during uninstall to be "REMOVEWORKER" (or hwnd == NULL),
while during reinstall the class is different.
4. What is the best way to tell uninstall from reinstall?
Thank you
John
|
|