reepblue Posted November 18, 2023 Share Posted November 18, 2023 Can the installer create a System Environment Variable for where Ultra Engine is installed? I think this will help make installing tools and sharing C++ projects easier if we can just reference something like %ULTRAENGINEPATH% in batch scripts or the PropertiesSheet.props file. This is now more important as there's the Steam install and the standalone version. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted November 18, 2023 Share Posted November 18, 2023 I have considered this, but it either requires admin permissions or requires the user to manually add the key, so I am hesitant to start building anything on this. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted November 18, 2023 Share Posted November 18, 2023 Okay, I figured out how to add this into the installer with Inno setup: [Setup] ChangesEnvironment=yes [Registry] Root: HKLM; Subkey: "System\CurrentControlSet\Control\Session Manager\Environment"; ValueType: string; ValueName: "ULTRAENGINE"; ValueData: "{app}" Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted November 18, 2023 Share Posted November 18, 2023 With the env variable set, you can replace propertysheet.props with this, and it does actually work: <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ImportGroup Label="PropertySheets" /> <PropertyGroup Label="UserMacros"> <UltraEnginePath>$(ULTRAENGINE)</UltraEnginePath> </PropertyGroup> <PropertyGroup /> <ItemDefinitionGroup /> <ItemGroup> <BuildMacro Include="UltraEnginePath"> <Value>$(UltraEnginePath)</Value> <EnvironmentVariable>true</EnvironmentVariable> </BuildMacro> </ItemGroup> </Project> Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted November 18, 2023 Share Posted November 18, 2023 If you open the vcxproj in a text editor and do a search and replace to replace "$(UltraEnginePath)" with "$(ULTRAENGINE)" then you can get rid of the propertysheet.props file and Visual Studio will be able to compile using the env variable that is set. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted November 19, 2023 Share Posted November 19, 2023 Looks like this can be used in a bat to set a value. I think set is user and setx is system: setx /m ULTRAENGINE "C:\Program Files\Ultra Engine" Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted November 19, 2023 Share Posted November 19, 2023 Okay, this is implemented now. The environment variable will be set when a C++ project is created, only if it does not already exist. The C++ project template is updated to use the env var and the property sheets file is removed. This will not affect your existing projects. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.