Can anyone help?
I need to set a number of folders included in my install as hidden. I cannot see anyway to do this.
Any help would be appreciated.
Thanks
Code: Select all
Function MakeFolderHidden()
Dim filespec
filespec = Session.property("APPDIR")
Dim fso, folder
Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetFolder(filespec)
folder.attributes = folder.attributes Or 2
End Function
You can use the same VB script and change only the folder attribute code to 1 for Read Only.I need the attribute "Read Only" instead "Hidden" because I will integrate icons in folders that includes desktop.ini, desktop.ico and I wouldn't use a batch.
You can add an Execute inline script code custom action with sequence with the following properties:What steps are required?
Code: Select all
Dim filespec
filespec = Session.property("CustomActionData")
Dim fso, folder
Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetFolder(filespec)
folder.attributes = folder.attributes Or 2
I've attached a project sample with the MakeFolderHidden custom action. This project was tested successfully on Windows 8.I use the script above. Support the newest OS this variant of VBS?
Of course, you can set multiple attributes with the same VB script like this:Can per script added more attributes? (read, hidden, ...)
Code: Select all
folder.attributes = folder.attributes Or 1 Or 2 Or 4
I'm afraid I don't understand your question. Can you give more details about what you want to achieve?But why read only instead system for folder icons?
OK, thank you.M.Teodor wrote:Of course, you can set multiple attributes with the same VB script like this:Can per script added more attributes? (read, hidden, ...)This example will set three attributes: Read Only, Hidden, System.Code: Select all
folder.attributes = folder.attributes Or 1 Or 2 Or 4
I mean, why does this works only with Read Only attribute and not with System attribute to see the folder icons and some information of desktop.ini? I mean, many years ago, this was still working with the system attributes in WindowsI'm afraid I don't understand your question. Can you give more details about what you want to achieve?But why read only instead system for folder icons?
I'm afraid it's unclear what you mean by "this". Maybe the article How to Customize Folders with Desktop.ini could help you.I mean, why does this works only with Read Only attribute and not with System attribute to see the folder icons and some information of desktop.ini?
Windows Installer has support for setting properties on files. In Advanced Installer go to Files and Folders page, select the file(s), press ENTER and from the File Properties Tab and select the file(s) attributes.A question. How can I set a file attribute e.x. desktop.ini file that was imported in AI?
Code: Select all
Dim filespec
filespec = Session.property("CustomActionData")
Dim fso, folder
Set fso = CreateObject("Scripting.FileSystemObject")
Dim dataArray
dataArray = split (filespec, "|")
for each x in dataArray
Set folder = fso.GetFolder(x)
folder.attributes = folder.attributes Or 2
Next
Code: Select all
[APPDIR]|[test_Dir]