ianpatt / f4se

Fallout 4 Script Extender
https://f4se.silverlock.org
120 stars 24 forks source link

"Fallout4Path" macro causing build issues #22

Closed achekery closed 11 months ago

achekery commented 11 months ago

If you see any build errors like "The command copy ... exited with code 1", then visual studio needs help understanding the "Fallout4Path" macro in the copy command. One way to do this is to define this as a new "dist" folder next to the sln file as described below:

  1. From the property manager, add a new property sheet for the "f4se" project. Open the property pages for your new property sheet and set user macro "Fallout4Path: $(SolutionDir)dist" and pre-build event "Command Line: if not exist $(Fallout4Path) mkdir $(Fallout4Path)".

  2. From the property manager, add the same property sheet to the "f4se_loader" and "f4se_steam_loader" projects.

  3. Now, run "Rebuild solution" to confirm the build errors have gone away.

  4. Also, add the new "dist" folder to your gitignore file if you have one..

ianpatt commented 11 months ago

This is intended to point to your Fallout 4 installation folder. If I recall correctly, it doesn't fail the build if not defined.

achekery commented 11 months ago

This is intended to point to your Fallout 4 installation folder. If I recall correctly, it doesn't fail the build if not defined.

Thanks for reading my issue. Although it could be helpful to copy the f4se build outputs directly into the Fallout4 game directory, unfortunately the post-build step fails if the macro is not defined because it will try to copy into the "/" directory which is not allowed. This causes the "Build solution" and "Build project" commands to fail in the post-build step. Note it does not affect the build step and the build outputs are indeed created as expected.

ianpatt commented 11 months ago

If you are using the old unsupported project files, it is assumed that you have this environment variable set. The cmake build has more detailed options.