• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 270
  • Last Modified:

Pocket PC Uninstall_Init functions not called second time

I have a PocketPC logon replacement app developed in eVC++3 which is installing and working fine.

However, when it is uninstalled it needs to check if it is still active and prompts the user to disable it. i.e:

codeUNINSTALL_INIT Uninstall_Init(HWND hwndparent,LPCTSTR
pszinstalldir)
{
  if (still active)
  {
    MessageBox(hwndparent, _T("Still active."), _T("App"), MB_OK);
    return codeUNINSTALL_INIT_CANCEL;
  }

  // do clean up ...
}

This works fine the first time. But if you click the 'Remove' button again in Remove Programs, it goes ahead and removes the whole app anyway without calling the Uninstall_Init function again?

Is this by design or I am missing something?

Appreciate any help!

Thanks,


Colin
0
cdmackie
Asked:
cdmackie
  • 5
  • 4
  • 2
  • +1
1 Solution
 
Mikal613Commented:
shouldnt you exit the sub and not cleanup if its still active?
0
 
cdmackieAuthor Commented:
Not sure what you meant, but if it's still active it does exit....may be my pseudo-code isn't too clear...


codeUNINSTALL_INIT Uninstall_Init(HWND hwndparent,LPCTSTR pszinstalldir)
{
  if (cannot be uninstalled yet)
  {
    MessageBox(hwndparent, _T("Still active."), _T("App"), MB_OK);
    return codeUNINSTALL_INIT_CANCEL; // **** return code to say "cancel the uninstall"
  }

  // else, if okay to uninstall...

  // do clean up of other stuff...

  return codeUNINSTALL_INIT_DONE;
}
0
 
Mikal613Commented:
Is your program still running when you run it again in the background. (alof of ppc apps are still running even though you closed it)
0
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

 
cdmackieAuthor Commented:
Thanks for the comment.

It's a logon replacement app (implemented as a Control Panel applet) so it is started when the PPC is turned on anyway - and presumably always running.

When the uninstaller loads the file and calls the functions, I just don't see why it doesn't call them again when you click 'remove program'? Plus it doesn't really have a main window so there would be no way to 'close' it down.

0
 
Mikal613Commented:
Whats the code for the Remove button?

And how do you check id you can remove the button?

The problem has to be there
0
 
cdmackieAuthor Commented:
The remove button is the 'Remove Program' in Control Panel->System->Remove Programs - not my code! The PPC application manager then calls my custom setupDLL for the functions, e.g. Uninstall_Init().

It calls my function the first time, when I return codeUNINSTALL_INIT_CANCEL to abort the uninstall.

If you click 'Remove Program' again, it doesn't call the function but just deletes the application files.

Thanks,


Colin
0
 
Mikal613Commented:
did you try upgrading to evc 4.0 SP2
0
 
chensuCommented:
Uninstall_Init() is called only before the uninstallation begins. After the uninstallation completes, Uninstall_Exit() is called.
0
 
cdmackieAuthor Commented:
There are compiler errors with eVC 4 which are being looked at separately, but I don't see why that should matter, it's still just a DLL that isn't being called.

chensu, the return code for Uninstall_Init() is to cancel the uninstall so the program is left in the Programs list. But when the uninstall is done again, it doesn't get called again. Is that by design?
0
 
chensuCommented:
Now I see what you mean. It sounds like a bug. Try writing a minimal program to reproduce the problem, then send it to Microsoft to see what they say.
0
 
nickycollinsCommented:
There is a known bug in PPC 2003, see other references:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&threadm=u8BXKnucDHA.2372%40TK2MSFTNGP09.phx.gbl&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3DUTF-8%26q%3Duninstall_init

It is logged with Microsoft but with no workarounds yet.

Sorry!


nicky
0
 
cdmackieAuthor Commented:
Humm..ok thanks for the help.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 5
  • 4
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now