Make folder hidden after Inno Setup installs it - inno-setup

My application has a folder of files that are all marked as "hidden" (including the folder itself). However, Inno Setup won't copy them for installation unless I remove the "hidden" attribute first.
Fair enough, but is there a way to make Inno Setup mark the installed folder as "hidden" after it finishes setup on my end-user's machine?
Thanks.

See the Attribs parameter for entries in the [Dirs] section.
[Dirs]
Name: "{app}\blah"; Attribs: hidden;
Note that this won't really stop people from seeing it, just make it look like you have something to hide.

First of all, ensure that ONLY the directory is hidden, and not the subdirectory. Say its name is srcHiddenDir.
Now, create another directory dstHiddenDir, but dont make it hidden now. But it should be empty.
Then, open the settings.json, and replace all the occurrences of srcHiddenDir with dstHiddenDir.
Now, Make it ready to copy files as usual. In one part of the code, you will get:
[Files]
Source: "wherethewholecodeis\phpdesktop\phpdesktop-chrome.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "wherethewholecodeis\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "wherethewholecodeis\*srcHiddenDir*\*"; DestDir: "{app}\*dstHiddenDir*"; Attribs:hidden; Flags: ignoreversion recursesubdirs createallsubdirs
Then, you need to write:
[Dirs]
Name: {app}\dstHiddenDir; Attribs:hidden;
Name: {app}\dstHiddenDir\application; Attribs:hidden;
Name: {app}\dstHiddenDir\database; Attribs:hidden;
Name: {app}\dstHiddenDir\css; Attribs:hidden;
....
...and all the subdirectories you want to hide, just for more safety. But Note those subdirectories should be genuine, and there in the source/destination. Else, when you run the setup, error will show that these directories dont exist.
Now, compile the program.
Hope this helps.

Related

Inno Setup can't handle Source path with space

my application has this directory that I need to include in the install package:
bin\Win Files\*
So, in the [Files] section, I have this line:
Source: "bin\Win Files\*"; DestDir: "{app}\bin\Win Files"; Flags: ignoreversion; Permissions: everyone-modify
But at compile time, it keeps saying it can't find that directory due to space in the path, the exact error message is:
No files found matching "C:\dev\packages\MyApp\bin\Win Files\*"
I've tried the following, all failed:
Source: """bin\Win Files\*"""
Source: "\"bin\Win Files\*\""
Source: '"bin\Win Files\*"'
That directory has to be named like that, so what should I do?
I use this:
[Files]
; Main application
Source: "{#SourceDir}\*"; DestDir: "{app}\"; Flags: recursesubdirs ignoreversion;
to copy all my files in one go to the installer. Note the recursesubdirs flag. I think spaces in the path (referenced here in the variable named SourceDir) are not actually a problem here.
This is due to the misunderstanding about the directory/file structure scanning mechanism in Inno Setup.
First of all, as #Martin Prikryl pointed out, one can include path that has space in it.
I think the following two rules are the key to this issue:
One cannot specify a folder that has no standalone files (e.g. empty folder or a folder that only has sub-directories). In my case: I have the following file structure per this question:
bin\Win Files\Libs\
bin\Win Files\Plugins\
So Source: "bin\Win Files\*"; will fail. If there is at least one standalone file under the "bin\Win Files\" folder, then the source line will work.
Inno Setup requires each folder be explicitly specified in the [Files] section as below:
Source: "bin\Win Files\Libs\*"; DestDir: "{app}\bin\Win Files\Libs";
Flags: ignoreversion; Permissions: everyone-modify
Source: "bin\Win Files\Plugins\*"; DestDir: "{app}\bin\Win Files\Plugins";
Flags: ignoreversion; Permissions: everyone-modify
as Source: "bin\Win Files\*"; will NOT include the sub-directories automatically, it is only used to include the standalone files under the bin\Win Files\ folder.

Custom Disk Spanning in Inno Setup

Is there any way Components section based custom disk spanning?
For example:
[Components]
Name: "c1"; Description: "Component 1"
Name: "sc2"; Description: "Special Component 2"
Name: "redist"; Description: "Redistributables"
[Files]
Source: component.exe; DestDir: "{app}"; Components: c1
Source: "specialfolder\*"; DestDir: "{app}"; Components: sc2
Source: redist.msi; DestDir: "{app}"; Components: redist
The files that i want to see after compile: setup.exe, c1.bin, special.bin, redist.bin
Thanks.
No it is not possible.
If your intention was to allow user to get only the pieces he/she needs, you can use the extern flag and {src} source directory instead. Though this is not really disk spanning. But it would allow the user to have just the files needed for the installation along the setup.exe. If you really need to store the files on separate disks, you can implement a prompt for additional disks and an actual installation in Pascal script.

inno-setup OR javafx packager changes my desktop icon, jagged edges

So I'm using Innosetup with javafxpackager, I specify a desktop icon (.ico) in the iss file with 'SetupIconFile'.
After installing the application (Win7) the icon on the desktop has jagged edges. At first I thought something was wrong with my icon, but if I right-click the icon and change the icon to the file I specified in the iss file, it has crispy clean edges.
So I'm guessing either Inno-Setup, or javafxpackager does something to my icon (tried with all manner of sizes and multi-layered ico files btw). And I'm guessing the chances are higher it has something to do with Inno-Setup, since I specify the icon in the iss.
Any ideas what could be wrong?
Edit: I said I specify the icon with 'SetupIconFile' but I didn't look correctly in my iss file, I actually do:
[Files]
Source: "MyApp\MyApp.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "MyApp\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
[Icons]
Name: "{group}\MyApp"; Filename: "{app}\MyApp.exe"; IconFilename: "{app}\MyApp.ico"; Check: returnTrue()
Name: "{userdesktop}\MyApp"; Filename: "{app}\MyApp.exe"; IconFilename: "{app}\MyApp.ico"; Check: returnTrue()

Recursive setting of folder permissions with InnoSetup

I have a folder tree that I copy to C:\ProgramData The software that I am installing (don't blame me for this, I did not architect, write or design it) requires full control for everyone for this data.
So I put the following line in [Files] sectionL
Source: "C:\ProgramData\PFPS\MapDataServer\*"; DestDir: "C:\ProgramData\PFPS\FalconViewCommand"; Flags: ignoreversion createallsubdirs recursesubdirs; Permissions: everyone-full; Excludes: "*.LDF"
yes, this does give everyone full control of each individual file, but the program needs to create files and the folder permissions (directory) are not set for everyone.
I tried to add a [Dirs] section but that did not work:
[Dirs]
Name: "C:\ProgramData\PFPS\FalconViewCommand"; Flags: uninsalwaysuninstall; Permissions: everyone-full
What do the guru's say?
This works for me:
[Dirs]
Name:"{app}\"; Permissions:everyone-modify
What I have been doing is the following RUN at the end, I was finding that the Dirs was not working (yes, I always do a full unistall, when testing install scripts), otherwise how do you know what will happen when the product ships?
I agree with you about {commonappdata} but I am trying to remove randomness till I get to the bottom of the issue.
Here is what I have been trying:
[Run]
Filename: "C:\Windows\System32\icacls.exe"; Parameters: "C:\ProgramData\PFPS\FalconViewCommand /grant:r Users:(OI)(CI)F"; WorkingDir: "{tmp}"; Description: "Changing Directory Permissions"; StatusMsg: "Changing Directory Permissions"

Exclude files working not as expected?

I want to exclude 2 folders by default, unless a component is checked. I don't have all the files individually listed in the [Files] section, as some of them might be added/removed in the future, but there are 2 folders that I need to control.
Here's the code I have:
Source: "source\*"; DestDir: {app}; Excludes: "\plugins\api,\plugins\shared memory"; Flags: ignoreversion recursesubdirs createallsubdirs;
Source: "source\plugins\api\*"; DestDir: {app}; Flags: recursesubdirs createallsubdirs;
Source: "source\plugins\shared memory\*"; DestDir: {app}; Components: plugins_api; Flags: recursesubdirs createallsubdirs;
What I want:
Those subfolders (api and shared memory) should only be copied if
plugins_api is selected.
If the component plugins_api is not
checked, they should not be copied.
I'd rather avoid including
every file in the .iss file. It is not an option.
What I get with this code:
If the component is not checked, the folders are not copied. Ok.
If the component was checked, the folders are not copied. Not ok.
So it seems the exclude in the first line affects the other 2 lines. How can I avoid this?
2 points:
1) You only have the Components entry on one of the special folders.
2) The special folders, as you have them will be installing their contents direct into the {app} folder.
If you follow the folders in use:
Source: "source\plugins\api\*"; DestDir: {app};
Put contents of source\plugins\api\ in {app}
I expect you want something like:
Source: "source\plugins\api\*"; DestDir: {app}\plugins\api\; Components: plugins_api; Flags: recursesubdirs createallsubdirs;
Source: "source\plugins\shared memory\*"; DestDir: {app}\plugins\shared memory\; Components: plugins_api; Flags: recursesubdirs createallsubdirs;

Resources