Page 1 of 1

UAC: how to manage?

Posted: Mon Sep 05, 2011 3:00 pm
by dejudicibus
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.

Re: UAC: how to manage?

Posted: Mon Sep 05, 2011 3:45 pm
by okurtsev
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.

Re: UAC: how to manage?

Posted: Mon Sep 05, 2011 4:27 pm
by doublemax
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.

Re: UAC: how to manage?

Posted: Sun Oct 30, 2011 6:44 pm
by dejudicibus
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!

Re: UAC: how to manage?

Posted: Sun Oct 30, 2011 6:48 pm
by dejudicibus
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!

Re: UAC: how to manage?

Posted: Sun Oct 30, 2011 8:39 pm
by doublemax
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.