Jump to content

Recommended Posts

Posted

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. 

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Posted

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.

Let's build cool stuff and have fun. :)

Posted

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}"

 

Let's build cool stuff and have fun. :)

Posted

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>

 

Let's build cool stuff and have fun. :)

Posted

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.

Let's build cool stuff and have fun. :)

Posted

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"

Let's build cool stuff and have fun. :)

Posted

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.

  • Thanks 1

Let's build cool stuff and have fun. :)

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...