Skip to content

Targets

A module is always built for one host, which means one Lua DLL, one Lua version and one architecture. That choice is called the target.

Target Host Lua Architecture Lua DLL
ams8 AutoPlay Media Studio 8 5.1.4 x86 (32-bit) lua5.1.dll
ams9 AutoPlay Media Studio 9 5.3.6 x86 (32-bit) lua5.3.dll
suf9-x86 Setup Factory 9.7, 32-bit 5.1.4 x86 (32-bit) lua5.1.dll
suf9-x64 Setup Factory 9.7, 64-bit 5.1.4 x64 (64-bit) lua5.1.dll
suf10-x86 Setup Factory 10, 32-bit 5.3.6 x86 (32-bit) lua5.3.dll
suf10-x64 Setup Factory 10, 64-bit 5.3.6 x64 (64-bit) lua5.3.dll

suf10 is short for suf10-x64.

A module only loads in the host it was built for. A 32-bit host can't load a 64-bit module (and the other way around), and a module built for Lua 5.1 can't run in a Lua 5.3 host.

AutoPlay Projects

You don't need to choose a target for an AutoPlay project. A project records which version of AutoPlay Media Studio saved it, and autoplay2c builds for that one, ams8 or ams9. You can still name the target, for instance in a build script, but naming a host other than the project's own is an error.

Lua Files and Setup Factory

A Lua file has no host, so it always needs a target. Setup Factory projects (.suf) aren't supported. Instead, you compile the Lua you want to protect into a module and require it from your Setup Factory scripts. Read more in Lua Modules.

Lua 5.1 or Lua 5.3

The target decides which Lua your code is compiled as. Your code is read the way the host reads it, so Lua 5.3 code with integer division (//), bitwise operators or goto is an error for a Lua 5.1 target, just like it would be in AutoPlay Media Studio 8.

Technical details
  • autoplay2c reads numbers exactly the way each host's Lua DLL reads them. The Lua 5.1 hosts were built with an old C runtime, so a hexadecimal number above 0xFFFFFFFF becomes 4294967295, and hexadecimal floats (0x1p4) aren't accepted. autoplay2c does the same.
  • Setup Factory 10's lua5.3.dll is built the same way as AutoPlay Media Studio 9's, with the same compatibility options (module, package.loaders and bit32 are available). A suf10-x86 module is the same as an ams9 one, and a suf9-x86 module the same as an ams8 one: the names are there so you can pick your host by name.
  • The module exports one function, luaopen_<module>, and imports only the host's Lua DLL (on rare occasions also msvcrt.dll, which every Windows version has).