wixtoolset / issues

WiX Toolset Issues Tracker
http://wixtoolset.org/
129 stars 24 forks source link

light.exe : error LGHT0103 : The system cannot find the file #4364

Closed wixbot closed 8 years ago

wixbot commented 10 years ago

If I run light in WiX 3.7 and 3.8.1128.0:

"%WIX%bin\heat.exe" dir ".\SourceDir\%SourceDirVersion%" -out Files-%FileName%.wxs -gg -sfrag -scom -sreg -srd -ke -cg "AppFiles" -var var.Eclipse -dr APPLICATIONFOLDER -platform %Platform%
"%WIX%bin\candle.exe" -arch %Platform% Main.wxs Files-%FileName%.wxs -ext WixUIExtension -ext WixUtilExtension -dEclipse="SourceDir\%SourceDirVersion%"
"%WIX%bin\light.exe" Main.wixobj Files-%FileName%.wixobj -ext WixUIExtension -ext WixUtilExtension -out "ReleaseDir\%MsiName%.msi" -loc "Lang\%ProductSku%.%Culture%.wxl" -cultures:%Culture%

I'm getting this error:

light.exe : error LGHT0103 : The system cannot find the file '.\SourceDir\eclipse-jee-kepler-SR2-win32-x86_64\plugins\com.google.appengine.e
clipse.sdkbundle_1.9.1\appengine-java-sdk-1.9.1\docs\testing\javadoc\com\google\appengine\tools\development\testing\LocalTaskQueueTestConfig
.DeferredTaskCallback.html' with type ''.

The file is there. The root cause is the long path name. It's very difficult or impossible to shorten the path name as it is out of my hand. Currently I can workaround by renaming ".\SourceDir\eclipse-jee-kepler-SR2-win32-x86_64\" to ".\SourceDir\eclipse\", but I suspect I will run into these issues again once Google may change anything and the path get's longer inside the plugins folder. Than I'm out of luck as I cannot change the structure.

Can you fix this issue, please?

Originally opened by marc.bau

wixbot commented 10 years ago

.NET doesn't support long file names. Fixing this would require abstracting all the i/o and P/Invoke-ing to Win32 equivalents. http://wixtoolset.org/issues/4365/

Resolution set to notabug Status changed from Untriaged to Resolved

wstaelens commented 6 years ago

.NET does support long file names (>=4.6.2)

robmen commented 6 years ago

Unfortunately, the MSI APIs (an old Win32) does not support long filenames either. It's an issue all the way down.

PatrickGrub commented 3 years ago

This solved my Problem, thanks!

On our buildserver it was building, but on my dev machine I could not build it since my local checkout folder full path was too long.

It would be nice from WiX that at least it shows a warning or any log output that the paths are too long, this would have saved me some time for solving it!

szakib commented 3 years ago

It's 2021, six years later, this bug is still unsolved, there is still a dependency on .Net 2.0/3.5.

robmen commented 3 years ago

@szakib read a couple comments up and you will see the fundamental issue is that WiX uses some Windows APIs (namely the ones that edit the MSI file format) that do not accept long file paths.

Please go guilt trip Microsoft before trying to make us feel bad about all the effort we put into writing a few hundred thousand lines of code that you use for free.

szakib commented 3 years ago

@robmen If you tell me which MS product team to guilt trip, I gladly will! :) Meeting this 260 character limit so many years after Windows has officially done away with this limitation is increasingly unacceptable.

I might be misunderstanding something, please clarify this: if you upgraded the .Net framework that your code uses to 4.x or 5.x, would this issue cease to exist as the first comment above suggests?

robmen commented 3 years ago

@szakib You want to follow up with the Windows Installer team which is part of Windows. They control the MSI APIs. Simply upgrading the .NET Framework will not fix the problem.

szakib commented 3 years ago

@robmen Thank you.

JCcanizares commented 11 months ago

After encountering this same error and being unable to find a proper fix, I can verify that the error occurs when the file path exceeds 255 characters. Specifically, I encountered an error because it was unable to locate a file within a path that was 264 characters long. However, I managed to resolve the issue by renaming the application's folder and shortening the path to 250 characters.

After that change, the MSI build succeeded without any problems.