This repository provides a template for creating Windows XP-compatible software using NW.js 15.4 (the last XP-supported version) and SvelteKit for a lightweight and efficient UI framework.
- Install NVM and Node.js v6.2.2 (matching NW.js 0.15.4’s internal Node.js version).
- This ensures that incompatible code is detected early.
BuiltApp/
└── XPlor/
├── locales/
├── package.nw/
│ ├── fonts/
│ ├── images/
│ ├── public/
│ │ ├── build/
│ │ ├── data/
│ │ ├── ignore/
│ │ ├── images/
│ │ ├── scripts_compiled/
NW_Cache/
├── nwjs-sdk-v0.15.4-win-ia32/
│ ├── locales/
│ ├── pnacl/
├── nwjs-sdk-v0.93.0-win-x64/
│ ├── locales/
│ ├── swiftshader/
├── nwjs-v0.12.3-win-ia32/
│ ├── locales/
├── NWTemp/
│ ├── nwjs-sdk-v0.15.4-win-ia32/
│ │ ├── locales/
│ │ ├── pnacl/
│ ├── nwjs-v0.12.3-win-ia32/
│ │ ├── locales/
│ ├── nwjs-v0.15.4-win-ia32/
│ ├── locales/
├── package.nw/
│ ├── public/
│ │ ├── scripts/
│ │ ├── executables/
SourceCode/ <== 🗂 This Repository
├── rollup.config.js
├── package.json
├── CompileBabel.js
├── BuildApp.js
├── .env
├── .gitignore
├── BuildAppTools/
│ ├── npmInstall.cmd
├── fonts/
├── images/
├── lib/
│ ├── dts/
│ │ ├── jquery/
├── node_modules/
├── public/
│ ├── index.html
│ ├── package.json
│ ├── global.css
│ ├── devTools.js
│ ├── build/
│ │ ├── bundle.js
│ │ ├── bundle.css
│ ├── scripts_compiled/
│ │ ├── executables/
│ │ ├── main/
│ │ ├── modules/
├── src/
│ ├── main.js
│ ├── App.svelte
│ ├── components/
│ ├── scripts/
│ │ ├── main/
│ │ ├── modules/
npm run dev- This compiles
src/intopublic/build/bundle.js - Refresh the app to see changes.
node BuildApp.js- Modify
BuildApp.jsbefore running. - Output location:
BuiltApp/{YourProjectName}/{YourProjectName}.exe
Include multipleInstances.js in index.html:
<script src="multipleInstances.js"></script>Why?
- NW.js prevents multiple instances of the same package.json by default.
- This script generates a UUID-based app name per run.
⚠ Issue: NW.js fills %LOCALAPPDATA% with {AppName}-{RandomNumber} folders.
Solution: Use the following launch parameter:
--user-data-dir=./NWProfile- This anchors all profiles into
NWProfile/, avoiding clutter.
To hide your source code inside the executable:
- Navigate to
package.nw - Select all files → Zip them
- *Rename
package.zip* → *package.nw - Merge into the executable:
copy /b YourProject.exe+package.nw FinalExecutable.exe
- Done! Your code is now embedded in the EXE.
⚠ Warning: NW.js extracts the package on launch, so this slows down startup
depending on file count and size.
Any NW.js version higher than 0.12.3 has an issue on Windows XP:
- If you use
child_process,http, orhttps, and there is no internet, the application will crash. - For offline applications, use NW.js 0.12.3.
- For online applications, use NW.js 0.15.4.
| File | Description |
|---|---|
element.js |
Utility functions for HTML element calculations. |
multipleInstances.js |
Enables multiple NW.js instances at once. |
- Open
package.json, add available NW.js versions. - Set the desired version in
.env(setAPPLICATION_NAMEhere). - Run:
npm run dev
If you're using custom .js scripts:
- Place them inside:
src/scripts/**/*
npm run watch_js_modules- For NW.js
0.15.4and earlier → Transpiled with Babel
→ Stored inpublic/scripts_compiled/**/* - For NW.js
0.16+→ Only copied, no transpilation.
<script src="public/scripts_compiled/my_script.js"></script>- Modify
public/package.json - Adjust & run:
node BuildApp.js
- Final portable version in:
BuiltApp/{YourProjectName}/ - Optional: Create an installer in the root directory.
- Configure
.envwithAPPLICATION_NAME - Use
Inno Setupor similar to package everything. - For reference, check the XPCode repository.
- Configure
- SCSS support
- Enhanced build automation
- Better XP compatibility