UAC: how to manage?

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
User avatar
dejudicibus
Knows some wx things
Knows some wx things
Posts: 32
Joined: Mon Dec 20, 2004 10:28 am
Location: Rome, Italy (EU)
Contact:

UAC: how to manage?

Post by dejudicibus » Mon Sep 05, 2011 3:00 pm

I recently upgraded to the latest version of wxWidget and decided to use CodeBlocks as IDE. My opjective is to port Unicode Dictionary to Windows Vista/7 too, and in future to Ubuntu 10. Currently it works for any Windows version from 95 to XP. I also use Inno Setup and ISTool to create the installation package.

When I first compiled for Windows 7 I had bad news: the program workedm but since it was used to install dictionaries in the program folder, that is «Program Files\Unicode Dictionary», it got blocked by the infamous UAC. So, unless user disables UAC, it gets the well-known prompt. The problem is that UAC complains in install too. So, the question is: which is the best way to manage UAC by wxWidgets? I have not only to move elsewhere data folders, but to manage previous install too. What if the user upgraded to Vista and still have dictionaries in program folder? How should I manage that? I need a strategy for both existing users and new users.

okurtsev
Experienced Solver
Experienced Solver
Posts: 54
Joined: Mon Jan 25, 2010 3:26 pm
Location: Ukraine, Kiev

Re: UAC: how to manage?

Post by okurtsev » Mon Sep 05, 2011 3:45 pm

I think it is a question about Inno Setup, not wxWidgets. I don't know how Inno Setup works with UAC, but NullSoft Installer which I use works with UAC beautifully. And actually Windows 7 doesn't have any problems with UAC, maybe Vista does, but I don't remember complains from Vista users of my software as well.
C++, Win XP-32, Win7-64, WinVista-32, MS VS 2005, 2008, 2010

User avatar
doublemax
Moderator
Moderator
Posts: 15173
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: UAC: how to manage?

Post by doublemax » Mon Sep 05, 2011 4:27 pm

I think it's not a problem if the installer requires administrator privileges and Inno Setup handles that fine.
What if the user upgraded to Vista and still have dictionaries in program folder? How should I manage that? I need a strategy for both existing users and new users.
If you need to write user-specific files under Windows 7, use wxStandardPaths to find a proper directory, e.g. wxStandardPaths::GetUserConfigDir()
http://docs.wxwidgets.org/stable/wx_wxs ... serdatadir

If you find data in the program directory, but not in the user directory, just copy the files over.
Use the source, Luke!

User avatar
dejudicibus
Knows some wx things
Knows some wx things
Posts: 32
Joined: Mon Dec 20, 2004 10:28 am
Location: Rome, Italy (EU)
Contact:

Re: UAC: how to manage?

Post by dejudicibus » Sun Oct 30, 2011 6:44 pm

okurtsev wrote:I think it is a question about Inno Setup, not wxWidgets. I don't know how Inno Setup works with UAC, but NullSoft Installer which I use works with UAC beautifully. And actually Windows 7 doesn't have any problems with UAC, maybe Vista does, but I don't remember complains from Vista users of my software as well.
It is a problem of InnoSetup for install, but it is a problem of my program for files. I was used to install dictionaries in the same directory of program, but it seems that UAC does not like that!

User avatar
dejudicibus
Knows some wx things
Knows some wx things
Posts: 32
Joined: Mon Dec 20, 2004 10:28 am
Location: Rome, Italy (EU)
Contact:

Re: UAC: how to manage?

Post by dejudicibus » Sun Oct 30, 2011 6:48 pm

doublemax wrote:If you find data in the program directory, but not in the user directory, just copy the files over.
I use InnoSetup to install the program. How can I upgrade old installations if I have to completely change the folder structure, that is, if the previous version of program has already a lot of dictionaries installed? I cannot even remove the previous install because the dictionaries re installed one by one by user after program install, so there are not two users with the same list of dictionaries!

User avatar
doublemax
Moderator
Moderator
Posts: 15173
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: UAC: how to manage?

Post by doublemax » Sun Oct 30, 2011 8:39 pm

I use InnoSetup to install the program. How can I upgrade old installations if I have to completely change the folder structure, that is, if the previous version of program has already a lot of dictionaries installed?
I don't know if this is possible with INNO setup. My idea was to do that in your application when it starts.
Use the source, Luke!

Post Reply