Win7中的部署问题 [英] Deployment issue in Win7

查看:79
本文介绍了Win7中的部署问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们安装Windows应用程序安装文件时,它将给出不同的结果.

如果我安装在Windows XP中,它将复制路径C \ Programme Files \ Application中的文件.在XP中,应用程序可以在所有机器上正常运行.

但是如果我在Win7中安装了相同的安装程序,那么它将仅在C \ Programme Files \中复制.所有文件都放在C:\ Programe文件中,并且应用程序无法正常运行.

如果我复制单个文件并将其粘贴到C:\ Programme Files \ Application中,则它将再次开始工作.

请您帮助我解决此问题.

在此先谢谢您.

When we install the Windows application setup file then it is giving different results.

If I install in Windows XP it is copying the files in the path C\Programme Files\Application. In XP application is working without any issues in all machines.

But if I install same setup in Win7 then it is copying in the C\Programme Files\ only.All the files are placed in C:\Programe files and application is not working.

If I copy individual files and paste inside the C:\Programme Files\Application then again it started working.

Request you to help me in resolving this issue.

Thanks in advance.

推荐答案

不同的操作系统的行为会有所不同.您的应用程序不应依赖绝对路径.

您只需添加几行代码即可实现此目的.检查路径是否存在.如果没有创建.但是在选择路径时必须非常小心.您可能不知道您的应用程序将在何种权限下运行.所以,正确的选择你的目录结构.例如,如果您的应用程序不是以管理员权限运行的,或者具有更高安全性的防病毒保护,则可能不允许您在系统目录甚至Windows和Program Files文件夹中创建文件/文件夹. .但是通常您将有权在应用程序文件夹中创建文件/文件夹.因此,请相应地设计您的应用.
Different operating system will behave differently. Your application should NOT rely on absolute paths.

You can achieve this by adding just a few lines of code. Check if a path exists or not. If not create it. But you must be very careful while choosing a path. You may not know under what permissions your application will run. So choose your directory structure appropriately. For ex - if your application isn''t running under administrator privilege or if there is a antivirus protection on with a higher security, you may not be allowed to create files/folder in the system directory and even in the windows and program files folder. But you will usually have rights to create files/folders inside you application folder. So design your app accordingly.


这篇关于Win7中的部署问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆