Inno Setup将目录和文件设为只读 [英] Inno Setup Make dirs and files read only
本文介绍了Inno Setup将目录和文件设为只读的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是Inno Setup中的新用户.我的问题是我有一些文件夹和一个文件.我想制作一个安装程序包来安装所有的程序包.这是我的代码
I'm new user in Inno Setup. My problem is that I have some folders and one file. I want to make a setup package to install all of them. Here is my code
[Files]
Source: "D:\POS CAD Standard\CAD\*"; DestDir: "C:\POS CAD Standard"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "D:\POS CAD Standard\acad.lsp"; DestDir: "{userappdata}\Autodesk\AutoCAD 2014\R19.1\enu\support"; Flags: ignoreversion
[Dirs]
Name: "C:\POS CAD Standard"; Attribs:readonly hidden system; Permissions: users-readexec;Flags:
[Icons]
Name: "{group}\{cm:UninstallProgram,POS CAD Standard}"; Filename: "{uninstallexe}"
它工作正常,但是当我尝试安装到另一台PC时,找不到我的源文件,并且我想将某些文件(不是文件夹)设置为只读.
It works fine, but when I'm trying to setup to another PC my source file is not found, and I want to make some files (not folder) to be read only.
推荐答案
Source: "D:\POS CAD Standard\CAD\*"; DestDir: "{sd}\POS CAD Standard"; \
Flags: ignoreversion recursesubdirs createallsubdirs; Attribs: readonly
请注意,我已经使用了 {sd}
常量而不是对C:
驱动器进行硬编码(这是一种不好的做法).
Note that I've used the {sd}
constant instead of hardcoding the C:
drive (what is a bad practice).
这篇关于Inno Setup将目录和文件设为只读的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文