Solved

Pocket PC Uninstall_Init functions not called second time

Posted on 2004-08-23
12
222 Views
Last Modified: 2013-12-27
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
Comment
Question by:cdmackie
  • 5
  • 4
  • 2
  • +1
12 Comments
 
LVL 48

Expert Comment

by:Mikal613
ID: 11871243
shouldnt you exit the sub and not cleanup if its still active?
0
 
LVL 1

Author Comment

by:cdmackie
ID: 11871574
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
 
LVL 48

Expert Comment

by:Mikal613
ID: 11871632
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
 
LVL 1

Author Comment

by:cdmackie
ID: 11872161
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
 
LVL 48

Expert Comment

by:Mikal613
ID: 11872334
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
 
LVL 1

Author Comment

by:cdmackie
ID: 11872646
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 48

Expert Comment

by:Mikal613
ID: 11872692
did you try upgrading to evc 4.0 SP2
0
 
LVL 23

Expert Comment

by:chensu
ID: 11873448
Uninstall_Init() is called only before the uninstallation begins. After the uninstallation completes, Uninstall_Exit() is called.
0
 
LVL 1

Author Comment

by:cdmackie
ID: 11874317
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
 
LVL 23

Expert Comment

by:chensu
ID: 11874780
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
 
LVL 1

Accepted Solution

by:
nickycollins earned 500 total points
ID: 11885628
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
 
LVL 1

Author Comment

by:cdmackie
ID: 11885652
Humm..ok thanks for the help.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Progress means simplifying, not complicating. Bruno Munari Preface How to detect the name of the internal storage or an SD-card on Windows Mobile device from the desktop application? I got this question, when I was working on a PC applicati…
With Windows Embedded Handheld, called Windows Mobile, Microsoft re-designed the user interface. The Start Icon moved down to the bottom, inside the menu bar area.   If you need to hide the Start Icon and/or the SIP (soft input panel, softwar…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now