4

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}"

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.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Mohamed Ahmed
  • 113
  • 11
  • So what is your actual problem? That *"source file is not found"* or that you *"want to make some files (not folder) to be read only"*? – Martin Prikryl Mar 30 '16 at 12:39

1 Answers1

4

Use Attribs: readonly parameter.

It is supported both in the [Files] and [Dirs] sections.

Source: "D:\POS CAD Standard\CAD\*"; DestDir: "{sd}\POS CAD Standard"; \
    Flags: ignoreversion recursesubdirs createallsubdirs; Attribs: readonly

Note that I've used the {sd} constant instead of hardcoding the C: drive (what is a bad practice).

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
  • another question please.how to make uninstall for old version automatically before install new version. – Mohamed Ahmed Apr 03 '16 at 07:30
  • See [InnoSetup: How to automatically uninstall previous installed version?](http://stackoverflow.com/q/2000296/850848) – Martin Prikryl Apr 03 '16 at 08:00
  • thanks martin i did. and go to this answer but did't work because the folder attribs set read only it won't delete automatically – Mohamed Ahmed Apr 03 '16 at 13:31
  • Ok, I see. So please ask a new question on automatic deletion of read only folder. – Martin Prikryl Apr 03 '16 at 16:39
  • Though, do you really want to have the folders readonly? Wouldn't it be more meningful to to revoke modify permissions from regular users? This would still allow the uninstaller from removing the folder. – Martin Prikryl Apr 03 '16 at 18:30