How to ship OpenAL

I am receiving a lot of people saying that they can’t open the game, I got one of the error logs from a friend end here is the exception:

In the installer of the game, I silently install the OpenAL with /S flag, this seems to work on some computers but on others the OpenAL still isn’t installed. After downloading and installing the OpenAL separately, my friend was able to run the game.

I’ve read that the best approach is include two DLLs (openal32.dll and wrap_oal.dll) directly in the game folder, should I do that? There are other dependencies?

Including those two DLLs alongside the application and removing oalinst.exe should work. I believe we’ll be removing oalinst.exe and using openal-soft which will be shipped as DLLs that sit in the same directory as the application (no installer).

Do I use the dll from System32 (120 KB) or SysWOW64 (106 KB)? And do I just paste it on the release folder along with the exe?

I’m not sure off-hand which one you would use.

Back to the installer issue. Does your installer run oalinst.exe with admin rights?

Yes, it does.

I’ve done more tests here and could be able to reproduce the bug. I uninstalled the OpenAL and tried to run the game. This is the exception I get:

Exception object: 0246ad54
Exception type:   System.DllNotFoundException
Message:          Unable to load DLL 'openal32.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
InnerException:   <none>
StackTrace (generated):
    SP       IP       Function
    00000000 00000001 UNKNOWN!OpenTK.Audio.OpenAL.AL.GenBuffers(Int32, Int32*)+0x2
    003CEB38 0217B0E1 UNKNOWN!OpenTK.Audio.OpenAL.AL.GenBuffers(Int32, Int32 ByRef)+0x59
    003CEB6C 0217BBC8 UNKNOWN!OpenTK.Audio.OpenAL.AL.GenBuffers(Int32)+0x20
    003CEB74 0217BA9A UNKNOWN!Microsoft.Xna.Framework.Audio.OggStream..ctor(System.String, System.Action, Int32)+0x52
    003CEB98 0217BA05 UNKNOWN!Microsoft.Xna.Framework.Media.Song.PlatformInitialize(System.String)+0x4d
    003CEBB0 0217B598 UNKNOWN!Microsoft.Xna.Framework.Media.Song..ctor(System.String)+0x38
    003CEBC4 0217B52E UNKNOWN!Microsoft.Xna.Framework.Media.Song..ctor(System.String, Int32)+0xe
    003CEBD4 0217B239 UNKNOWN!Microsoft.Xna.Framework.Content.SongReader.Read(Microsoft.Xna.Framework.Content.ContentReader, Microsoft.Xna.Framework.Media.Song)+0x71
    003CEBEC 021782CD UNKNOWN!Microsoft.Xna.Framework.Content.ContentTypeReader`1[[System.__Canon, mscorlib]].Read(Microsoft.Xna.Framework.Content.ContentReader, System.Object)+0x1d
    003CEC00 02178230 UNKNOWN!Microsoft.Xna.Framework.Content.ContentReader.InnerReadObject[[System.__Canon, mscorlib]](System.__Canon)+0x60
    003CEC1C 02177DB2 UNKNOWN!Microsoft.Xna.Framework.Content.ContentReader.ReadObject[[System.__Canon, mscorlib]](System.__Canon)+0x32
    003CEC34 02177D6B UNKNOWN!Microsoft.Xna.Framework.Content.ContentReader.ReadObject[[System.__Canon, mscorlib]]()+0x2b
    003CEC44 02174F75 UNKNOWN!Microsoft.Xna.Framework.Content.ContentReader.ReadAsset[[System.__Canon, mscorlib]]()+0x35
    003CEC58 02174130 UNKNOWN!Microsoft.Xna.Framework.Content.ContentManager.ReadAsset[[System.__Canon, mscorlib]](System.String, System.Action`1<System.IDisposable>)+0x148
    003CECA4 02173F63 UNKNOWN!Microsoft.Xna.Framework.Content.ContentManager.Load[[System.__Canon, mscorlib]](System.String)+0xdb
    003CECC8 0217B15C Super_Pete_The_Pirate!Super_Pete_The_Pirate.Managers.SoundManager.LoadBgm(System.String)+0x34
    003CECDC 0217AA7C Super_Pete_The_Pirate!Super_Pete_The_Pirate.Managers.SoundManager.Initialize()+0x6c
    003CECE8 02172360 Super_Pete_The_Pirate!Super_Pete_The_Pirate.SceneManager.LoadContent(Microsoft.Xna.Framework.Content.ContentManager)+0x190
    003CED00 01FDEDCC Super_Pete_The_Pirate!Super_Pete_The_Pirate.GameMain.LoadContent()+0x64
    003CED10 01FDEB61 UNKNOWN!Microsoft.Xna.Framework.Game.Initialize()+0x69
    003CED20 01FDE8F0 Super_Pete_The_Pirate!Super_Pete_The_Pirate.GameMain.Initialize()+0x78
    003CED44 006922C3 UNKNOWN!Microsoft.Xna.Framework.Game.DoInitialize()+0x23
    003CED54 00692091 UNKNOWN!Microsoft.Xna.Framework.Game.Run(Microsoft.Xna.Framework.GameRunBehavior)+0xa9
    003CED78 00250488 Super_Pete_The_Pirate!Super_Pete_The_Pirate.Program.Main()+0x40

After pasting the OpenAL32.dll from System32 into the release folder, I get it:

Exception object: 028aa998
Exception type:   System.BadImageFormatException
Message:          An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
InnerException:   <none>
StackTrace (generated):
    SP       IP       Function
    00000000 00000001 UNKNOWN!OpenTK.Audio.OpenAL.AL.GenBuffers(Int32, Int32*)+0x2
    002FF188 00EFB0E1 UNKNOWN!OpenTK.Audio.OpenAL.AL.GenBuffers(Int32, Int32 ByRef)+0x59
    002FF1BC 00EFBBC8 UNKNOWN!OpenTK.Audio.OpenAL.AL.GenBuffers(Int32)+0x20
    002FF1C4 00EFBA9A UNKNOWN!Microsoft.Xna.Framework.Audio.OggStream..ctor(System.String, System.Action, Int32)+0x52
    002FF1E8 00EFBA05 UNKNOWN!Microsoft.Xna.Framework.Media.Song.PlatformInitialize(System.String)+0x4d
    002FF200 00EFB598 UNKNOWN!Microsoft.Xna.Framework.Media.Song..ctor(System.String)+0x38
    002FF214 00EFB52E UNKNOWN!Microsoft.Xna.Framework.Media.Song..ctor(System.String, Int32)+0xe
    002FF224 00EFB239 UNKNOWN!Microsoft.Xna.Framework.Content.SongReader.Read(Microsoft.Xna.Framework.Content.ContentReader, Microsoft.Xna.Framework.Media.Song)+0x71
    002FF23C 00EF82CD UNKNOWN!Microsoft.Xna.Framework.Content.ContentTypeReader`1[[System.__Canon, mscorlib]].Read(Microsoft.Xna.Framework.Content.ContentReader, System.Object)+0x1d
    002FF250 00EF8230 UNKNOWN!Microsoft.Xna.Framework.Content.ContentReader.InnerReadObject[[System.__Canon, mscorlib]](System.__Canon)+0x60
    002FF26C 00EF7DB2 UNKNOWN!Microsoft.Xna.Framework.Content.ContentReader.ReadObject[[System.__Canon, mscorlib]](System.__Canon)+0x32
    002FF284 00EF7D6B UNKNOWN!Microsoft.Xna.Framework.Content.ContentReader.ReadObject[[System.__Canon, mscorlib]]()+0x2b
    002FF294 00EF4F75 UNKNOWN!Microsoft.Xna.Framework.Content.ContentReader.ReadAsset[[System.__Canon, mscorlib]]()+0x35
    002FF2A8 00EF4130 UNKNOWN!Microsoft.Xna.Framework.Content.ContentManager.ReadAsset[[System.__Canon, mscorlib]](System.String, System.Action`1<System.IDisposable>)+0x148
    002FF2F4 00EF3F63 UNKNOWN!Microsoft.Xna.Framework.Content.ContentManager.Load[[System.__Canon, mscorlib]](System.String)+0xdb
    002FF318 00EFB15C Super_Pete_The_Pirate!Super_Pete_The_Pirate.Managers.SoundManager.LoadBgm(System.String)+0x34
    002FF32C 00EFAA7C Super_Pete_The_Pirate!Super_Pete_The_Pirate.Managers.SoundManager.Initialize()+0x6c
    002FF338 00EF2360 Super_Pete_The_Pirate!Super_Pete_The_Pirate.SceneManager.LoadContent(Microsoft.Xna.Framework.Content.ContentManager)+0x190
    002FF350 00B5EDCC Super_Pete_The_Pirate!Super_Pete_The_Pirate.GameMain.LoadContent()+0x64
    002FF360 00B5EB61 UNKNOWN!Microsoft.Xna.Framework.Game.Initialize()+0x69
    002FF370 00B5E8F0 Super_Pete_The_Pirate!Super_Pete_The_Pirate.GameMain.Initialize()+0x78
    002FF394 006422C3 UNKNOWN!Microsoft.Xna.Framework.Game.DoInitialize()+0x23
    002FF3A4 00642091 UNKNOWN!Microsoft.Xna.Framework.Game.Run(Microsoft.Xna.Framework.GameRunBehavior)+0xa9
    002FF3C8 00450488 Super_Pete_The_Pirate!Super_Pete_The_Pirate.Program.Main()+0x40

And with the OpenAL32.dll from SysWOW64:

Exception object: 0262b094
Exception type:   Microsoft.Xna.Framework.Audio.InstancePlayLimitException
Message:          External component has thrown an exception.
InnerException:   <none>
StackTrace (generated):
    SP       IP       Function
    0057EBA4 0213C2E3 UNKNOWN!Microsoft.Xna.Framework.Audio.OpenALSoundController.ReserveSource()+0x5b
    0057EBB4 0213C151 UNKNOWN!Microsoft.Xna.Framework.Audio.OggStream..ctor(System.String, System.Action, Int32)+0x69
    0057EBD8 0213BF45 UNKNOWN!Microsoft.Xna.Framework.Media.Song.PlatformInitialize(System.String)+0x4d
    0057EBF0 0213BAD8 UNKNOWN!Microsoft.Xna.Framework.Media.Song..ctor(System.String)+0x38
    0057EC04 0213BA6E UNKNOWN!Microsoft.Xna.Framework.Media.Song..ctor(System.String, Int32)+0xe
    0057EC14 0213B781 UNKNOWN!Microsoft.Xna.Framework.Content.SongReader.Read(Microsoft.Xna.Framework.Content.ContentReader, Microsoft.Xna.Framework.Media.Song)+0x71
    0057EC2C 0213815D UNKNOWN!Microsoft.Xna.Framework.Content.ContentTypeReader`1[[System.__Canon, mscorlib]].Read(Microsoft.Xna.Framework.Content.ContentReader, System.Object)+0x1d
    0057EC40 021380C0 UNKNOWN!Microsoft.Xna.Framework.Content.ContentReader.InnerReadObject[[System.__Canon, mscorlib]](System.__Canon)+0x60
    0057EC5C 02138042 UNKNOWN!Microsoft.Xna.Framework.Content.ContentReader.ReadObject[[System.__Canon, mscorlib]](System.__Canon)+0x32
    0057EC74 02137FFB UNKNOWN!Microsoft.Xna.Framework.Content.ContentReader.ReadObject[[System.__Canon, mscorlib]]()+0x2b
    0057EC84 02134E4D UNKNOWN!Microsoft.Xna.Framework.Content.ContentReader.ReadAsset[[System.__Canon, mscorlib]]()+0x35
    0057EC98 02134010 UNKNOWN!Microsoft.Xna.Framework.Content.ContentManager.ReadAsset[[System.__Canon, mscorlib]](System.String, System.Action`1<System.IDisposable>)+0x148
    0057ECE4 02133E43 UNKNOWN!Microsoft.Xna.Framework.Content.ContentManager.Load[[System.__Canon, mscorlib]](System.String)+0xdb
    0057ED08 0213B6A4 Super_Pete_The_Pirate!Super_Pete_The_Pirate.Managers.SoundManager.LoadBgm(System.String)+0x34
    0057ED1C 0213A90C Super_Pete_The_Pirate!Super_Pete_The_Pirate.Managers.SoundManager.Initialize()+0x6c
    0057ED28 02132240 Super_Pete_The_Pirate!Super_Pete_The_Pirate.SceneManager.LoadContent(Microsoft.Xna.Framework.Content.ContentManager)+0x190
    0057ED40 006DEF6C Super_Pete_The_Pirate!Super_Pete_The_Pirate.GameMain.LoadContent()+0x64
    0057ED50 006DED01 UNKNOWN!Microsoft.Xna.Framework.Game.Initialize()+0x69
    0057ED60 006DEA90 Super_Pete_The_Pirate!Super_Pete_The_Pirate.GameMain.Initialize()+0x78
    0057ED84 00462423 UNKNOWN!Microsoft.Xna.Framework.Game.DoInitialize()+0x23
    0057ED94 004621F1 UNKNOWN!Microsoft.Xna.Framework.Game.Run(Microsoft.Xna.Framework.GameRunBehavior)+0xa9
    0057EDB8 001D0488 Super_Pete_The_Pirate!Super_Pete_The_Pirate.Program.Main()+0x40

wrap_oal.dll seems to do no difference.

Ok, I figured out that the .exe that we shipped wasn’t installing the OpenAL correctly, sorry for your time, my fault :confounded:
The best approach seems to be install the OpenAL silently in the install of the game, there is no issue with that. Taking advantage of the post, the OpenAL is the unique dependency that I must install on the player’s computer?

At this time, yes. It will be removed at some point.