Announcement

Collapse
No announcement yet.

Error 2200 when trying to create a subfolder in the %AppFolder% directory.

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

  • Error 2200 when trying to create a subfolder in the %AppFolder% directory.

    My Installer downloads some files from our website using the HTTP.DownloadSecure() call. This part works.

    I am trying to Create a folder for these files inside of %AppFolder% (which is \Program Files\MyCompany\MyApp) using the following post install action:

    Code:
    Folder.Create(SessionVar.Expand("\"%AppFolder%\"\\SampleFiles"));
    I am getting the error:
    [01/29/2020 14:29:04] Error Script: On Post Install, [29]: Folder.Create(SessionVar.Expand(""%AppFolder%"\\Sa mpleFiles")); (2200)
    So I looked up error 2200 only to find that it is generic:

    2200

    "Could not create folder."
    The execution level is Admin on the installer. We are also doing registry imports, registering DLLs, and installing shortcuts for "all users" and that stuff works.

    Any help is appreciated on how to go about figuring out why this is failing.

  • #2
    Remove these extra quotes from the string.
    Code:
    Folder.Create(SessionVar.Expand("[COLOR=#FF0000][B]\"[/B][/COLOR]%AppFolder%[COLOR=#FF0000][B]\"[/B][/COLOR]\\SampleFiles"));
    Ulrich

    Comment


    • #3
      Worked Great. Thanks!

      Followup Question. Is there a guideline for when the quotes are needed for paths with spaces vs when they aren't? For example, when doing system calls, they are necessary (at least they are for registering dll with Shell.Execute). But here they aren't necessary.

      Comment


      • #4
        You could have quotes here as well, but they were at the wrong place. The result of your string concatenation resulted in this, causing the error:

        Code:
        "C:\Program Files\MyCompany\MyApp"\SampleFiles
        This, on the other hand, would be accepted:

        Code:
        "C:\Program Files\MyCompany\MyApp\SampleFiles"
        Any of this would most likely work:

        Code:
        Folder.Create(SessionVar.Expand("%AppFolder%[B]" .. "[/B]\\SampleFiles"));
        Folder.Create(SessionVar.Expand("%AppFolder%") .. "\\SampleFiles");
        Ulrich

        Comment

        Working...
        X