Variable in GetFolder - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

TomD
Posts: 19
Joined: Wed Mar 11, 2009 10:26 pm

Variable in GetFolder

It's not just Advanced Installer specific but I cannot get it work...

I use a script to set a folder "hidden"

Code: Select all

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("X:\Folder")
If objFolder.Attributes = objFolder.Attributes AND 2 Then
    objFolder.Attributes = objFolder.Attributes OR 2 
End If
But here's the problem...

"X:\Folder" is specified with "APPDIR\Folder"

So I need to set "X:\" to APPDIR.

I tried several steps but nothing works.


Greets
Tom
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Variable in GetFolder

Hi Tom,

To mark the "APPDIR\Folder" as hidden you can try using this code:

Code: Select all

Dim folder
folder = Session.Property("APPDIR") + "Folder"

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(folder)
If objFolder.Attributes = objFolder.Attributes AND 2 Then
    objFolder.Attributes = objFolder.Attributes OR 2 
End If
Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
TomD
Posts: 19
Joined: Wed Mar 11, 2009 10:26 pm

Re: Variable in GetFolder

Sorry... doesn't work.

I replaced "Folder" with "Test" ("Test" exists) and with "\Test".

Setup breaks.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Variable in GetFolder

Hi,

I'm not sure why you are encountering this behavior. Can you please send us the AIP (project) file you are using and a verbose log of the install process to support at advancedinstaller dot com so we can investigate it?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”