Cannot change name or move Vassal.App on a Mac

I downloaded Vassal 3.7.29 and installed it on my Macbook Air running Tahoe 26.6.2. Went through the usual security approval process and the Vassal app would run in my applications folder. When I moved it to a separate folder for just my Vassal Apps ( I keep the last 4-5 on my computer) , it would not run at all. I also tried to change the name to identify which version it is, it would not run as well regardless of where it was( main application or separate folder) This also happened to the two beta versions when I tired to install them but since they were beta, it didn’t matter. Now with the current module acting up, here we are..

Ideas??

This was copied from the dialog I had with ChatGPT and it seems to cure the problem of moving the file and renaming With or WITHOUT spaces in the nameI spent some time on ChatGPT and came up with this solution to the problem.

VASSAL Mac launcher fails when application path contains spaces or file is moved

VASSAL version: 3.7.29
Platform: macOS on MacBook Air
Problem: VASSAL will not launch if the application name or any parent directory in its path contains a space.

I have been using VASSAL on Mac computers for many years. This behavior appears to be new with the recent VASSAL versions. I first encountered it with the 3.8.0 beta versions, and it is also present in the current 3.7.29 release.

Reproduction

A newly downloaded VASSAL application will launch normally from:

/Applications/VASSAL.app

However:

  1. Renaming the application to VASSAL copy.app causes it not to launch.

  2. Renaming it to VASSALcopy.app (no space) allows it to launch from /Applications.

  3. Moving VASSALcopy.app to:

/Applications/Vassal Apps/VASSALcopy.app

causes it not to launch because the parent directory contains a space.
4. Moving the application back to /Applications allows it to launch again.
5. I modified only one line in the launcher script, changing:

cd $path

to:

cd "$path"

After that change, VASSALcopy.app successfully launches from /Applications/Vassal Apps/.

Exact error

Running the launcher directly from Terminal before the modification produced:

/Applications/VASSAL copy.app/Contents/MacOS/VASSAL.sh: line 112: cd: /Applications/VASSAL: No such file or directory

followed by:

arch: Contents/MacOS/jre/bin/java isn't executable

The relevant portion of VASSAL.sh is:

path="$(dirname "$0")/../.."

and later:

cd $path

Because $path can contain spaces, the shell splits the pathname. Changing the latter to:

cd "$path"

fixes the problem.

Additional testing

I checked the code signature of both the working original application and the failing copy. Both returned:

code object is not signed at all

I also checked extended attributes with xattr -l; neither application had a com.apple.quarantine attribute.

The macOS system log showed the VASSAL process being launched and then exiting rather than being rejected by Gatekeeper.

Conclusion

This appears to be a bug in the Mac VASSAL.sh launcher: $path is quoted when it is created but is not quoted when passed to cd.

The one-line change:

cd $path

to:

cd "$path"

correctly handles application paths containing spaces.

I hope this can be corrected in the next release.

@cholmcc Was this broken by 10542 in 3.7.28?

Yes and no. The path needed to be quoted when changing the directory, but the path was expanded correctly earlier on.

Sigh, why people keep putting spaces in their file names is beyond me. Use CamelCase or _ to distinguish parts.

There’s a pr to fix the issue.

Yours,
Christian

Which one? I don’t see it.

Sorry, I was doing it from my phone - didn’t click on to actually create the PR. It is there now as Quote path variable in VASSAL.sh by cholmcc · Pull Request #15151 · vassalengine/vassal · GitHub

Thanks. It’s merged.

The fix will be in 3.7.30.