您的批评和鼓励都是我把编程无限办好的动力! 您编程时遇到困难,或遇到不顺心的事想发发牢骚尽管到这里来吧! 虽然本网力求全面,但也不能包罗万象,这些我筛选出的优秀网站连接就是对本站最好的补充! 学习编程当然也离不开书本了,这里收集大量编程书籍! 编程无限之源码超市,这里收集的代码令你意想不到的全面! 欢迎光临编程网校,这里专门收集VB/CB入门文章及技术文章! 欢迎光临编程无限!
     
       
 
当前位置:英文资料 >> System
VB6 Apps and Windows Vista
  资料类型: System 上传时间: 2006-10-28 阅读次数: 5386




While this is not a 'code' article per say, I believe it is worth posting here, since most of us want our applications to work on Vista (right?). No votes necessary - just some food for thought to perhaps assist you in making your applications work on Vista, or, so you know what to expect. I hope you find it helpful.

I (like perhaps many of you) am trying to figure out how we can use our apps on Vista. The vb6 apps themselves will work on Vista. The largest 'snag' of it all is, in Vista, ALL applications get run as a standard (non-admin) user.

While some Win2000 and XP systems are set up like this, typically, they are in large corporate environments where workers UNDERSTAND they cannot install or run any software they want. On Vista, ALL USERS will be faced with this limitation, and I fear, will not understand how to get software installed (I am beginning to wonder if Vista will be successful at all).

So, over the past several weeks, I have been tinkering around, trying to resolve the following objectives:

1) Enable a standard (non-admin) user to INSTALL our software.

2) Enable a standard (non-admin) user to RUN our software.

I want do discuss each one, because I believe they are very important to understand, and, I am looking for any additional opinions and thoughts on these very essential topics:



=========== 1) The first one (INSTALLING as non-admin) is perhaps a bit contraversial. The whole purpose (I presume) of a standard user is to NOT allow them to install software. However, our users right now pretty much ALL run on single-user (non-corporate) systems, which means, whether they realize it or not, they are operating with full admin priviledges, and can therfore install any software they choose.

Installers typically WRITE FILES to the c:\program files\ folder, and make several registry entries (ocx and dll files). Both of these tasks are impossible as a standard user. Therefore, a standard user under Vista (again, this is THE DEFAULT), in order to install most software, will need to run the installer as admin.

Will our users understand how to do that? Hmm.. I think they might just think its broke, or, doesn't work with Vista, and move on to another piece of software.

People don't read instructions -- they double click, and click OK OK OK. If the message says RUN THIS INSTALLER AS ADMIN etc etc, they are just going to click OK. Nothing will happen, and they will wonder what is going on. They will not understand what 'AS ADMIN' means, and my guess is, we will lose half of our prospects!

Our solution?
Well, still working it out, but here is what we KNOW WILL WORK:

1) Wrap the OCX and DLL files into the EXE. There is a very nice software program called molebox that enables you to wrap your dll and ocx files into your vb6 exe. When your user runs the exe, the dll and ocx are extracted into MEMORY instead of getting registered with the registry. We are still testing it out, but so far, it has been a dream come true. Highly recommended!

2) Set the default install path to the Vista equivalent of c:\documents and settings\all users\application data\appname\ (I believe it is c:\users\public\application data\).
I don't like doing this, but right now, I dont see any other way to enable Vista users to be able to install software without having to understand the admin rights system. The net result of installing here is what a user running Win98 or WinME or XP-with-admin-rights gets - just double-click the installer, click NEXT NEXT NEXT or OK OK OK, and it gets installed.



========== 2) Enabling a standard user to RUN the application is highly dependent on WHERE the application is installed.

Up until now, we have installed all applications and its data files together -- in other words, everything gets installed into c:\program files\appname\, and the .exe expects to be able to read and write files and folders within that directory.

Apparently since Windows 2000, the recommended methodology is to write the data files to c:\documents and settings\all users\application data\{companyname}\{appname}\ or c:\documents and settings\{your_user_name}\application data\{companyname}\{appname}\.

YUK! No offense, but our users are not developers or very technical. Add the fact that the \application data\ folder is HIDDEN by default, there was just no hope to using this.

Vista changes (or forces upon us) a revisit to this. You see, in Vista, EVEN IF YOU ARE THE ADMINISTRATOR running an application, the application itself DOES NOT RUN with admin rights. This means that the application CAN NOT WRITE to its own folder in the c:\program files\ folder. In other words, if you application sits inside of c:\program files\app1\, and tries to write a file named c:\program files\app1\data.txt, it will fail in Vista! Note: You can FORCE the application to run using admin rights, but most users will not know how to do that, and, it takes several extra steps to do it.

The solution:

1) Recode our software to point all of its reading and writing to the ..\application data\ folder mentioned above. I personally don't like this, but, perhaps in the long run, users will get used to it. I think the application, and its data, should be in one place - I may be in the minority on this though.

2) Install the application as well as the data files into the ..\application data\ folder. I talked about this above. Not sure this is a good way to do it, but it is transparent to the user, and more importantly, easier for users to get INSTALLED since they wont need to be admin to install the files there.

=============== I hope this is helpful to some of you, and, I hope some of you will contribute to the thread. I am certainly not an expert at any of this, and am hopeful some of you guru's out there can contribute some godly logic to this.

Thanks - -- Anthony Dunleavy http://onenerd.blogspot.com/

推荐给朋友 点 评( 2 ) 返回前页 关闭此页
   
  本类最热文章排名:
  1.Icon to tray
2.Printer Control
3.Run Time Error Handling Code
4.Printing Binary Files
5.Validation at Control-level
6.Mouse swap buttons
7.Turns on Cap’s Lock ...
8.Mouse doubleclick time
9.Creating Screen Savers
10.Justification Of Text On A Printout
   
   
  评论:
  1.怎么没有中文版的?
  2.要中文的
 
 
 

 

关于本站 版权声明 联系方法
编程无限 V4.1 Copyright © 1999-2008 21code.com

京ICP备05006938号