Announcement

Collapse
No announcement yet.

Empty Folder

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Empty Folder

    I'm having some trouble creating an empty folder in program files. The folder is necessary with the development platform we are using.
    I tried adding a folder reference as shown in the screenshot below, but no folder is created.

    I also tried adding code to the post install using this code:
    Folder.Create("%AppFolder%\idehelp");

    but it creates a folder in program files with the %AppFolder% name and the idehelp. It's skipping the folder \.
    Is there anyway to just create an empty folder in my %AppFolder%?

  • #2
    I found that I need to use double slashes: Folder.Create("%AppFolder%\\idehelp");
    I'm still not sure why it won't work with the folder reference though.

    Comment


    • #3
      This is by design. From the product documentation:

      Note: Folder references will not include empty folders in your setup. Only folders that contain files that are included in the setup (based on the file mask), will be created by Setup Factory at runtime.

      See Program Reference > Folder References > Folder Reference Properties.

      Using Folder.Create() in the On Post Install event is a valid method. Do not forget to include the deletion of the folder and its contents in the uninstaller, or this folder and contents will not be removed from the device during uninstall.

      Ulrich

      Comment


      • #4
        Originally posted by scottcal View Post
        I also tried adding code to the post install using this code:
        Folder.Create("%AppFolder%\idehelp");

        but it creates a folder in program files with the %AppFolder% name and the idehelp. It's skipping the folder \.
        Is there anyway to just create an empty folder in my %AppFolder%?
        When using script to create the folder, you have to expand the %AppFolder% using SessionVar.Expand()

        So try this instead:
        Code:
        Folder.Create(SessionVar.Expand("%AppFolder%\\idehelp"));
        And as Ulrich pointed out, you have to remove the folder using an uninstaller action as well.

        Comment

        Working...
        X