Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Temporary files directory cannot be created #5920
If this issue is a bug:
I use Gitlab and its CI pipelines to build, test and deploy an application. I have created a project in Gitlab where I use Wix to produce an installer. Everything goes fine when I build the installer myself (when I log in as a normal user) but when the Gitlab runner (installed as service) tries to build the installer an error occurs. (The Gitlab runner is installed on a similiar Windows machine and the runner is an administrative user).
When I run the pipeline a strange error occurs. The runner cannot create a temporary directory , see stack trace below;:
light.exe : error LGHT0001: A required privilege is not held by the client [C:\Multi-Runner\builds\2eac19ee\0\SES\Installation\WindowsInstaller\WindowsInstaller.wixproj]
Exception Type: System.ComponentModel.Win32Exception
According to the documentation it is possible override temporary directory with an enviromental variable:
Following the stack trace above and looking at the source code I see that a object of class Binder is created and Binder inherits from WixBinder. In the constructor of WixBinder the TempFilesLocation property is called. Then the property BasePath of TempFileCollection is used which causes after some steps a directory to be created
The code tries to set the path later (see row
My suggestion is to rewrite the code to use the contructor
The whoami returns
Relatered to this user I have also seen that the nuget package cache is under C:\Windows\System32\config\systemprofile folder which can also be problematic.