Solved

Pocket PC Uninstall_Init functions not called second time

Posted on 2004-08-23
12
232 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I recently asked a question (http://www.experts-exchange.com/Programming/Smartphones/Android/Q_28684946.html) about Computer Inventory applications for Mobile Devices.  I was specifically interested in an app I could use on my android phone.  The be…
A short article about problems I had with the new location API and permissions in Marshmallow
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

943 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

16 Experts available now in Live!

Get 1:1 Help Now