Script to build App with different names

I would like to use a Xojo script to build one application multiple times (with multiple names) eg the Windows App name is called ‘BlackDog.exe’, but I want the script to build ‘BlackDog A.exe’, ‘BlackDog B.exe’, ‘BlackDog C.exe’, etc. I can bring the app to the foreground and build it, but the exe name is always just ‘BlackDog.exe’. This is for Windows, but cross platform would be useful to know. I have tried to just rename the exe, but Xojo refuses to run the app as the libraries are not named the same.

How do I change the application name?

[code]Dim path As String
Dim appNames() As String

Const kOSX32 = 7
Const kOSX64 = 16
Const kWin32 = 3
Const kWin64 = 19
Const kLin32 = 4
Const kLin64 = 17
Const kLinARM = 18

appNames = Array (“BlackDog”)
For tempInt As Integer = 0 To appNames.ubound
SelectWindow appNames(tempInt)

ConstantValue(“WindowsAppName”) = “BlackDog A.exe”
ConstantValue(“ApplicationName”) = “BlackDog A.exe”
app.WindowsAppName = “BlackDog A.exe”
path = BuildApp(kWin32, True)
Next

Speak(“Finished Building BlackDog”)
[/code]

You have to use an IDE communicator script. You can’t change the name when you are already building. Below is an example for macOS:

if ConstantValue("App.kMaxVersion") = "0" then PropertyValue("App.Application Identifier") = "com.mothsoftware.mailarchiverx" PropertyValue("App.MacOSXAppName") = "Mail Archiver X" elseif ConstantValue("App.kMaxVersion") = "1" then PropertyValue("App.Application Identifier") = "com.mothsoftware.mailarchiverxpro" PropertyValue("App.MacOSXAppName") = "Mail Archiver X Pro" end if

For Windows it is:

PropertyValue("App.WindowsAppName") = "BlackDog A" path = BuildApp(kWin32, True) PropertyValue("App.WindowsAppName") = "BlackDog B" path = BuildApp(kWin32, True)

That’s not entirely true. If you were to put a script like the one David posted into a folder named “Scripts” next to your project, you could run that by selecting it from the File > IDE Scripts menu.

If you did just want to rename the app, you could also rename the support folders to just “Resources” and “Libs” and that should work too.