7
2023
UnityHub: Add support for custom project title (instead of folder name) or use ProductName
This request has been open since 2018..
https://forum.unity.com/threads/renaming-projects.514061/
So had to test it myself and seems to be really simple
(*** as a proof of concept, i don’t know it the Title value affects something else)
Steps:
- Unpack app.asar from Hub folder (using 7zip Asar plugin https://www.tc4shell.com/en/7zip/asar/ or python script https://github.com/unitycoder/UnityHubPatcher )
- rename old app.asar as app.asar.bak
- Open app/ folder in VSCode/VSStudio (need to run as an Admin)
- Open localProject.js
- Add this line at top (near other definitions)
const kPCustomNamePath = path.join(ProjectSettingsFolderPath, ‘ProjectName.txt’); - modify getProjectData(projectPath) method
- Add these lines of code (inside green rectangles)

- Open projectDataHelpers.js
- Add these lines at the end
exports.getCustomProjectName = getCustomProjectName;
async function getCustomProjectName(customNamePath, defaultName) {
try {
const customName = await fileSystem_1.fs.readFile(customNamePath, ‘utf8’);
return customName.trim();
} catch (error) {
return defaultName;
}
} - Make sure Hub process is closed completely (not minimized)
- Save script changes
- You can now add ProjectName.txt file inside Project settings to some of your projects to test it
- Start hub again, if everything is correct, it should display custom title for that project

So then it uses same ProjectName.txt file like my custom launcher (which allows project rename with F2)
https://github.com/unitycoder/UnityLauncherPro
UPDATE 19.12.2023, you can add support for reading ProjectSettings Product Name field also, use this for the getCustomProjectName method:
exports.getCustomProjectName = getCustomProjectName;
async function getCustomProjectName(customNamePath, defaultName) {
try {
// if ProjectName.txt exists
const customName = await fileSystem_1.fs.readFile(customNamePath, 'utf8');
return customName.trim();
} catch (error) {
}
try {
// try to read ProjectSettings.asset next
let settingsFilePath = customNamePath.replace("ProjectName.txt",""+"/ProjectSettings.asset");
console.log(settingsFilePath);
const settingsNameRaw = await fileSystem_1.fs.readFile(settingsFilePath, 'utf8');
const settingsName = settingsNameRaw.match(/productName: (.*)/)[1];
return settingsName.trim();
} catch (error) {
//console.log(error.Error);
}
return defaultName;
}
*08.12.2023 Generic disclaimer: For Education Purposes Only.
Related Posts
Leave a comment
Recent posts
- Adding Real World Location to Ice Fishing Prototype
- [web tool] Image Channel Inspector : AlphaScope
- Editor Tool: Smart Recompile (don’t recompile if edit comments)
- Editor Tool: Scene Size Analyzer
- LudumDare 60: Old Tech
- uBasic Scripting Language for Unity
- GreaseMonkey+Editor Plugin: 1-Click Copy script from ChatGPT (Web) to Unity Editor (as script)
- Editor Tool: Property Watcher
- .unityignore : Hide files from Project window
- PostBuild Script to Create Single exe Standalone File
- Game Loop Designer
- Favorites in PackageManager
Recent Comments
Coin:
CUgDSbRqFcAumDSAcdKDvuXsw26VdkJe8C8WGUQHBAGS
An article by











