Solved

Pocket PC Uninstall_Init functions not called second time

Posted on 2004-08-23
12
258 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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
 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Account Lockout 12 36
Unable to configure new exchange accounts on any smartphone. 4 167
Tablets in POS (point of sale) environment 5 181
triangle challenge 4 196
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
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

697 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