Editing TXT file: curly brackets missing - Advanced Installer Community
Antarctica
Posts: 110
Joined: Tue Jul 08, 2014 9:24 am

Editing TXT file: curly brackets missing

Hello Team,

I have a problem that "Text File Update" does produce nonsense.

I have created a test project for you from scratch.

-> New Enterprise Project
-> Add TXT File
-> Modified "Create/Append"
-> Deleted "Update"
-> Provided values for the 6 properties used

The Create/Append content is as follows:

Code: Select all

{
  "": {
    "databases": {
      "timeflexConnection": {
        "connectionString": "user id=[SQLTIMEFLEX];password=[SQLTIMEFLEXPWD];server=[SQLSERVER];database=[SQLDB];connection timeout=10",
        "providerName": "System.Data.SqlClient"
      }
    },
    "settings": {
      "privilegedUserName": "[ADtimeflex]",
      "privilegedUserPass": "[ADtimeflexpwd]",
      "disabledAppModules": "3",
      "enabledAppModules": "6",
      "enableEWSTrace": false,
      "logging": "db",
      "ewsCacheEngine": "Memcached",
      "cacheEngine": "memcached"
    }
  }
}
The resulting file is as follows:

Code: Select all

  "": {
    "databases": {
      "timeflexConnection": {
        "connectionString": "user id=USER;password=CRED;server=SERV;database=BASE;connection timeout=10",
        "providerName": "System.Data.SqlClient"
      
    },
    "settings": 
      "privilegedUserName": "TEST",
      "privilegedUserPass": "PASS",
      "disabledAppModules": "3",
      "enabledAppModules": "6",
      "enableEWSTrace": false,
      "logging": "db",
      "ewsCacheEngine": "Memcached",
      "cacheEngine": "memcached"
    
  }
}
If you look closely, there are two opening parens and two closing parens missing. Why is that?

I have attached the project for you.

The "resolved value" is shown correctly, by the way, and in the docs I haven't found anything that documents this behaviour.

Kind regards,

Alexander
Attachments
Test App.back.aip
AI 12.6.1
(14.64 KiB) Downloaded 404 times
Test App.back (1).aip
AI 12.7.1
(14.49 KiB) Downloaded 460 times
Test App.aip
AI 12.7.2
(14.49 KiB) Downloaded 450 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Editing TXT file: curly brackets missing

Hi Alexander,

I tested the projects that you attached and, indeed, I reproduced the problem. This seems to be an Advanced Installer issue. A fix will be available in a future version of Advanced Installer, thank you for bringing it to our attention.

Meanwhile, you can create two properties that contains the { and } curly brackets and use them in the text file where you need the brackets like in the attached project.

Best regards,
Eusebiu
Attachments
Test App.aip
(14.65 KiB) Downloaded 395 times
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Antarctica
Posts: 110
Joined: Tue Jul 08, 2014 9:24 am

Re: Editing TXT file: curly brackets missing

Thank you for the workaround. Thumbs up! :)
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Editing TXT file: curly brackets missing

You're welcome Alexander. I'm glad I could help.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Editing TXT file: curly brackets missing

Hi Alexander,

We investigated this behavior and we found that this is not actually a bug. The field that contains the text of the "Text File Update" operation is a formatted field and the curly brackets {} have a meaning for formatted strings, so they must be escaped as follows when using them in a formatted field: [\{], [\}]

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”