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
0xFFFFFFFFbecomes4294967295, and hexadecimal floats (0x1p4) aren't accepted. autoplay2c does the same. - Setup Factory 10's
lua5.3.dllis built the same way as AutoPlay Media Studio 9's, with the same compatibility options (module,package.loadersandbit32are available). Asuf10-x86module is the same as anams9one, and asuf9-x86module the same as anams8one: 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 alsomsvcrt.dll, which every Windows version has).