Home

GetShortPathName

%3CLINGO-SUB%20id%3D%22lingo-sub-386370%22%20slang%3D%22en-US%22%3EGetShortPathName%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-386370%22%20slang%3D%22en-US%22%3E%3CP%3ENOTE%3A%20This%20might%20not%20be%20a%20PSF%20issue%20but%20one%20that%20needs%20to%20be%20solved%20elsewhere%20in%20the%20system%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERepackaged%20Blender%202.7.6%20x64%20using%20the%20MPT%20and%20the%20PSF%20for%20File%20Redirection%20so%20that%20the%20app%20can%20see%20its%20config%20file.%26nbsp%3B%20The%20app%20fails%20before%20getting%20to%20that%20point%20and%20running%20a%20ProcessMonitor%20trace%20I%20think%20I%20see%20the%20problem.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAt%20one%20point%20the%20app%20seems%20to%20be%20calling%20GetShortPathNameW%20against%20%22C%3A%5CProgram%20Files%5CWindowsApps%5C%5B%7BPackageName%7D%5D%5C2.76%5Cdatafiles%5C%E2%80%A6%22.%26nbsp%3B%20The%20issue%20is%20that%20the%20WindowsApps%20(which%20is%209%20characters%20long)%20has%20NO%20shortname.%26nbsp%3B%20So%20somehow%20the%20app%20then%20tries%20to%20open%20%22C%3A%5CProgra~1%5CWindow~1%5C%E2%80%A6%22%20which%20is%20actually%20a%20different%20folder!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EScreen%20shot%20attached.%20%231%20is%20the%20call%20through%20GetShortPathNameW%2C%20%232%20is%20the%20failed%20call%20using%20the%20return%20information%20from%20GetShortPathW..%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-389343%22%20slang%3D%22en-US%22%3ERe%3A%20GetShortPathName%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-389343%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F147478%22%20target%3D%22_blank%22%3E%40Johannes%20Freundorfer%3C%2FA%3E%20Thanks.%26nbsp%3B%20But%20we%20are%20repacking%20a%20vendor%20installer%20into%20MSIX%2C%20so%20we%20don't%20have%20access%20to%20the%20source%20code.%26nbsp%3B%20...and%20it's%20probably%20unmanaged%20code%20anyway...%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-389230%22%20slang%3D%22en-US%22%3ERe%3A%20GetShortPathName%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-389230%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F149589%22%20target%3D%22_blank%22%3E%40Tim%20Mangan%3C%2FA%3EHi%20Tim%2C%3C%2FP%3E%3CP%3EI%20saw%20this%20kind%20of%20issues%20as%20well.%20Some%20applications%20might%20work%20with%20a%20workaround.%20Try%20this%3A%3C%2FP%3E%3CP%3Einvoke%20a%20process%20inside%20the%20Namespace%26nbsp%3B%3CFONT%3EInvoke-CommandInDesktopPackage%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESample%20for%20FreeCommander%3CBR%20%2F%3E%3CFONT%3EInvoke-CommandInDesktopPackage%20-PackageFamilyName%20FreeCommanderXE-32_dcsc6zw6cdwca%20-AppId%20%22FREECOMMANDER%22%20-Command%20cmd.exe%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EInside%20try%20to%20execute%20the%20app%20from%20within%20the%20native%20path%20i.e.%3A%3C%2FP%3E%3CP%3EC%3A%5Cprogram%20files%20(x86)%5C...%3C%2FP%3E%3CP%3Eor%20the%208.3%20path%3C%2FP%3E%3CP%3EC%3A%5Cprogra~1%5C..%3C%2FP%3E%3CP%3EThis%20helps%20quite%20often%20and%20can%20be%20solved%20with%20a%20standard%20wrapper%20-%20or%20psf%20in%20the%20future.%3C%2FP%3E%3CP%3EI'll%20try%20Blender%20myself%20later%20the%20week.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEnjoy%3C%2FP%3E%3CP%3E%2FJohannes%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-416663%22%20slang%3D%22en-US%22%3ERe%3A%20GetShortPathName%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-416663%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F146612%22%20target%3D%22_blank%22%3E%40TIMOTHY%20MANGAN%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20made%20a%20test%20with%20Blender%20in%20%3CA%20href%3D%22https%3A%2F%2Fwww.dropbox.com%2Fs%2Fgg9mhipy46bx26i%2Fadvinst-2ee7b9cc-15.9.msi%3Fdl%3D1%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAdvanced%20Installer%2015.9%3C%2FA%3E%20(%20I%20included%20a%20link%20for%20you%20to%20get%20this%20RC)%20and%20the%20MSIX%20packaged%20app%20runs%20ok.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAre%20we%20missing%20something%20from%20your%20test%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.dropbox.com%2Fs%2Fgg9mhipy46bx26i%2Fadvinst-2ee7b9cc-15.9.msi%3Fdl%3D1%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EFrom%20here%3C%2FA%3E%20you%20can%20get%20the%20package%20and%20project%20built%20with%20AI%2015.9.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-417037%22%20slang%3D%22en-US%22%3ERe%3A%20GetShortPathName%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-417037%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F147865%22%20target%3D%22_blank%22%3E%40Bogdan%20Mitrache%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETraining%20folks%20this%20week%20so%20I%20won't%20be%20able%20to%20look%20at%20it%20(I'm%20often%20brave%20about%20updating%20software%20on%20the%20fly%20but%20I'd%20rather%20show%20these%20folks%20the%2015.6%20I%20know%20on%20our%20first%20training%20class%20on%20MSIX).%26nbsp%3B%20My%20package%20was%20made%20using%20the%20MPT%2C%20so%20maybe%20you%20are%20doing%20some%20great%20magic%2C%20or%20maybe%20it%20is%20the%20version%20I%20used%20(2.76b)%20or%20how%20I%20test.%26nbsp%3B%20I%20can%20privately%20send%20you%20my%20package%20and%20the%20installer%20for%20that%20version%20in%20the%20interim.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Tim Mangan
MVP

NOTE: This might not be a PSF issue but one that needs to be solved elsewhere in the system?

 

Repackaged Blender 2.7.6 x64 using the MPT and the PSF for File Redirection so that the app can see its config file.  The app fails before getting to that point and running a ProcessMonitor trace I think I see the problem.

 

At one point the app seems to be calling GetShortPathNameW against "C:\Program Files\WindowsApps\[{PackageName}]\2.76\datafiles\…".  The issue is that the WindowsApps (which is 9 characters long) has NO shortname.  So somehow the app then tries to open "C:\Progra~1\Window~1\…" which is actually a different folder!

 

Screen shot attached. #1 is the call through GetShortPathNameW, #2 is the failed call using the return information from GetShortPathW..

 

 

4 Replies

@Tim ManganHi Tim,

I saw this kind of issues as well. Some applications might work with a workaround. Try this:

invoke a process inside the Namespace Invoke-CommandInDesktopPackage

 

Sample for FreeCommander
Invoke-CommandInDesktopPackage -PackageFamilyName FreeCommanderXE-32_dcsc6zw6cdwca -AppId "FREECOMMANDER" -Command cmd.exe

 

Inside try to execute the app from within the native path i.e.:

C:\program files (x86)\...

or the 8.3 path

C:\progra~1\..

This helps quite often and can be solved with a standard wrapper - or psf in the future.

I'll try Blender myself later the week.

 

Enjoy

/Johannes

@Johannes Freundorfer Thanks.  But we are repacking a vendor installer into MSIX, so we don't have access to the source code.  ...and it's probably unmanaged code anyway... 

Hi @TIMOTHY MANGAN 

 

We made a test with Blender in Advanced Installer 15.9 ( I included a link for you to get this RC) and the MSIX packaged app runs ok.

 

Are we missing something from your test?

 

From here you can get the package and project built with AI 15.9.

@Bogdan Mitrache

 

Training folks this week so I won't be able to look at it (I'm often brave about updating software on the fly but I'd rather show these folks the 15.6 I know on our first training class on MSIX).  My package was made using the MPT, so maybe you are doing some great magic, or maybe it is the version I used (2.76b) or how I test.  I can privately send you my package and the installer for that version in the interim.

Related Conversations
Power Query Source from Relative Paths
Magnus Vegem Dahle in Excel on
10 Replies
Teams and Power Query Excel file
Mark_Adams in Microsoft Teams on
6 Replies
Reading .csv stored in Azure Blob Storage from Excel
Federico Fontana in Excel on
1 Replies
MS Teams for Virtual classroom
Tanya Arora in Driving Adoption on
9 Replies
Skype for Business to Teams Adoption Strategy
Tanya Arora in Driving Adoption on
3 Replies