Is it possible to build a 32-bit and a 64-bit Windows app in a single Build process?

I’ve been shipping a MacOS/Windows 32-bit desktop utility app for many years. I’m starting to run into some issues on Windows 10/11 64-bit which are resolved if I build a 64-bit Windows version of my app. So I now want to ship 3 installers – MacOS, Windows 32-bit and Windows 64-bit.

Is there any way to make Xojo build both a Windows 32-bit and a Windows 64-bit version in a single Build process, ie with just one click on the Build button in the toolbar?

Of course.

In the “Build Settings” section (on the left side), select Windows. The “Architecture” property appears to your right.

In the latter, select the “x86 64-Bit” option.

You need to create a Build Script as:

// IDE Script Build macOS, Win32 and Win64

Const kOSX64 = 16
Const kWin32 = 3
Const kWin64 = 19

Var path As String
path = BuildApp(kOSX64)
path = BuildApp(kWin32)
path = BuildApp(kWin64)

Var result As String
result = ShowDialog("Building All", _
"Finished.", _
"OK", "", "", -1)

Save as BuildMacAndWindows.xojo_script into your Scripts folder.

Fire it from here:

4 Likes

Thank you @Rick_A , it works perfectly. :slightly_smiling_face: :rocket:

2 Likes

Just for completeness, if you were building this as part of a CI/CD pipeline, the IDE also supports a remote control mechanism. You can read more about this here.

How do you know this parameters? I would like to do the same as I build for WIN64 and MacIntel and MacARM (2 builds for Mac, not 1 universal).
I would like to see the list, write them all in the script and make comment ’ to those I don’t want.

Once we are there, is there a possibility to build in one click all my projects which are open?

Just look at the docs

https://documentation.xojo.com/topics/build_automation/ide_scripting/building_commands.html#topics-build-automation-ide-scripting-building-commands-buildapp-buildtype-as-doc-integer-api-data-types-integer-reveal-as-doc-boolean-api-data-types-boolean-as-doc-string-api-data-types-string

1 Like

Thanks Greg for the doc link and Rick for the example. I reached to do what I wanted (I dream of it for a long time). I have 13 applications which are build for Mac Intel and Mac ARM and some others for Windows too. One of my app is only for me then not for Mac ARM as I have a Mac Intel and a PC Windows.
Here is my script if someone find this topic and want some example:


Var RsultA, RsultB, RsultC, RsultD, TpTextA, TpTextB, TpTextC, TabCesProj(), TabMesProj() As String
Var iNbre, Fin_iNbre, Pos As Integer
Dim TpDrapReveal as Boolean

TabMesProj = Array("MacSerializer", "ManageNameExt", "MemoDate", "MngXplaneSpack", "MyPopBarrier", "NbreConvert", "Neuronyx", "NrxCreator", "ScreenCaptCoord", "SquareBid", "SyncTwoFolders", "TextBatchConv", "ToroMind", "ToroNess") ' Fin
'                                               0                         1                           2                           3                              4                           5                      6                     7                        8                           9                         10                            11                         12                13
TpDrapReveal = False ' True pour révéler les applis une fois compilées
Fin_iNbre = WindowCount - 1
For iNbre = 0 To Fin_iNbre
  TabCesProj.Add WindowTitle(iNbre)
Next iNbre
' For iNbre = 0 To Fin_iNbre ' L'exemple ne marche pas, car sélectionner la fenêtre change son n° d'index, même en prenant à l'envers
' SelectWindow(iNbre)
' CeTexte = CeTexte + EndOfLine + TabCesProj(iNbre)
' ' DoCommand("SaveFile")
' Next iNbre
RsultA = "Builded WinIntel64 MacIntel64 :"
RsultB = "Builded WinIntel64 MacIntel64 MacArm64 :"
RsultC = "Builded MacIntel64 MacArm64 :"
RsultD = "Not Builded :"
Fin_iNbre = TabCesProj.LastIndex
For iNbre = 0 To Fin_iNbre
  TpTextA = TabCesProj(iNbre)
  Pos = TpTextA.IndexOf(" ")
  ' Print(TpTextA + " " + str(TpTextA.Length) + " " + str(Pos))
  If Pos > -1 Then
    TpTextB = TpTextA.Left(Pos)
    Pos = TabMesProj.IndexOf(TpTextB)
    If Pos > -1 Then
      SelectWindow(TpTextA)
      Select Case pos
      Case 0 ' MacSerializer
        TpTextC = BuildApp(19, TpDrapReveal) ' Windows 64-bit Intel
        TpTextC = BuildApp(16, TpDrapReveal) ' MacOS 64-bit Intel
        ' Non : TpTextC = BuildApp(24, TpDrapReveal) ' MacOS 64-bit Arm
        RsultA = RsultA + EndOfLine + " • " + TpTextB
        ' DoCommand("SaveFile")
      Case 1, 3, 4, 5, 6, 7, 9, 11, 12, 13 ' ManageNameExt MngXplaneSpack MyPopBarrier NbreConvert Neuronyx NrxCreator SquareBid TextBatchConv ToroMind ToroNess
        TpTextC = BuildApp(19, TpDrapReveal) ' Windows 64-bit Intel
        TpTextC = BuildApp(16, TpDrapReveal) ' MacOS 64-bit Intel
        TpTextC = BuildApp(24, TpDrapReveal) ' MacOS 64-bit Arm
        RsultB = RsultB + EndOfLine + " • " + TpTextB
        ' DoCommand("SaveFile")
      Case 2, 8, 10 ' MemoDate ScreenCaptCoord SyncTwoFolders
        ' Non : TpTextC = BuildApp(19, TpDrapReveal) ' Windows 64-bit Intel
        TpTextC = BuildApp(16, TpDrapReveal) ' MacOS 64-bit Intel
        TpTextC = BuildApp(24, TpDrapReveal) ' MacOS 64-bit Arm
        RsultC = RsultC + EndOfLine + " • " + TpTextB
        ' DoCommand("SaveFile")
      Else
        RsultD = RsultD + EndOfLine + " # " + TpTextB ' Ne devrait pas arriver
      End Select
    Else
      RsultD = RsultD + EndOfLine + " ? " + TpTextA ' Ne devrait pas arriver
    End If
  Else
    RsultD = RsultD + EndOfLine + " ? " + TpTextA ' Ne devrait pas arriver
  End If
Next iNbre
Print(RsultA + EndOfLine + RsultB + EndOfLine + RsultC + EndOfLine + RsultD)
1 Like