如何保护用户在安装过程中不修改文件? [英] How to secure that users does not modify files during installation?

查看:103
本文介绍了如何保护用户在安装过程中不修改文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好b $ b

我正在InstallShield中编写安装程序,在安装过程中,一些SQL脚本文件(* .sql)和一个exe文件被解压缩到用户的临时位置硬盘。 exe文件必须读取这些SQL脚本文件才能在安装期间设置数据库。我想确保用户无法抓取这些临时SQL脚本文件,并在exe文件使用这些SQL脚本文件之前修改它们。我可以在InstallShield打包之前加密这些SQL脚本文件,然后让exe文件读取加密文件并在内存中解密它们然后使用SQL脚本内容,但在这种情况下最佳做法是什么?

Hi
I'm writing an installation in InstallShield and during the installation some SQL script files (*.sql) and an exe file are unpacked to a temporary location on the users harddisk. The exe file has to read these SQL script files to setup a database during the installation. I want to make sure that the user cannot grap these temporary SQL script files and modify them before the exe file uses these SQL script files. I could encrypt these SQL script files before InstallShield packs them, then let the exe file read the encrypted files and decrypt them in memory and then use the SQL script content, but what is best practice in this case?

推荐答案

您可以将SQL脚本放在.EXE中的字符串资源中。然后无法对它们进行修改。
You could put the SQL scripts in string resources in your .EXE. They then cannot be modified.


除了将它们作为资源嵌入之外,您还可以以某种方式从脚本中获取哈希值,并且您的EXE将知道文件的哈希值应该是什么以及您的安装程序使用散列磁盘上的文件并确保散列值正确。
As well as embedding them as resources you could get a hash value from the script somehow and your EXE will know what the hash value of the files should be and your installer with hash the files on disk and make sure the hash value is correct.


这篇关于如何保护用户在安装过程中不修改文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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