Error installing Winbatch due to StrCat

Started by WBpk9, July 07, 2021, 03:00:52 PM

Previous topic - Next topic

WBpk9

I get an error message when I try to install WinBatch into folder that has both parentheses () and {}. How can I get around this issue. I need to have () and {} which are exceptable folder names.

td

The problem isn't the parentheses or braces.  It is the grave accent character in a string delimited by grave accent characters.  You are very strongly encouraged to only install WinBatch into the program files (x86) directory and yes, we know that you have been installing it for years in another directory without issue. If you continue to do that, it will eventually come back to bite you. So your options are to get rid of the grave accent character in the name or install WinBatch in the correct directory.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

This does illustrate the evils of using WIL substitution in a script. The setup script has been around for almost as long as WinBatch. But while most of it has been rewritten more than once, a few bits still linger from the early versions. You have encountered one of those early bits and it is still using substitution. That legacy code will be corrected in the next release.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

WBpk9

Thank you TD for the quick reply and how to resolve. One of the great things about WinBatch.
For my education why do you recommend using the default install folder. Is there hard coding to those folders that will bite me in the future.
Kind regards

td

It's not a matter of hard coding.  It has to do with how MSFT has implemented security in Windows.  Applications that interact with the user interface (like WinBatch) have special requirements in order to execute correctly when performing some tasks.  One of those requirements is that they must be launched from a "secure" folder. "Program Files (x86)" and "Program Files" have access restrictions that make them "secure" by default. Most other folders do not by default have those settings.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

WBpk9

Thank you for the description.
Does that mean that compiled WinBatch scripts need to be installed and run from these folders "Program Files (x86)" and "Program Files".
Thank you

td

That would depend on what they do and how they are manifested. If the script is compiled with "UIAccess" set to "true" then it should be installed into a "secure" folder. If tested and confirm that the script does not need that setting in any of its run environments and user accounts then you can likely get by without "secure" folder installation. However, some antimalware programs take a dim view of compiled scripts not installed in "secure" folders so that is something you need to consider as well.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade