Forum Discussion
Can we have multiple fixes at the same time
Dear Tim Mangan
I have another doubt, let say there is more than one entry point and i want to apply fix, Id will be
"id": "PSFLAUNCHERSIXFOUR" for each entry point and this will lead to schema validation error.
How to handle this situation.
Kind regards,
Vikas
Sleeping_Developer The solution to the multiple entrypoints to the same exe issue I solve by making copies of the PsfLauncherxx.exe file. Each entrypoint gets a unique name, and thus unique munged ID.
In PsfTooling they get copied as Psflauncher1.exe, PsfLauncher2.exe, and so on for the shortcuts; PsfLauncherFTA1.exe and so on for the FTAs (when necessary). You could keep the bitness in those names, but the munched ID is capped at 16 characters so watch out.
- tester2420May 11, 2020Copper Contributor
- May 07, 2020
tester2420 The syntax looks OK (assuming the filename for the launcher is PsfLauncher321.exe); the concept of flattening the structure to have everything at the root of the package is OK. So it is something else.
A ProcessMonitor trace of the file activity should help.
Alternative debug output is available from the launcher includes diagnostic telemetry that is output to the debug port -- use DebugView to see that. [Note: For this type of problem you don't need the Debug PSF build to get good info into DebugView. PsfLauncher emits in both release and debug builds; the other fixup dlls only emit in debug builds].
- tester2420May 07, 2020Copper Contributor
Dear TIMOTHY_MANGAN
Good Morning,
I was trying with applications that have flatten structure and everything ie executable, appxmanifest.xml, and config.json is on the same level.
i have tried both
---------------------------------------------------------------------------------
{
"applications": [
{
"id": "PSFLAUNCHERTHREETWOONE",
"executable": "MyApps.exe""workingDirectory": ""
}
],
"processes": [
{
"executable": "MyApps",------------------------------------------------------------------
and this
--------------------------------------------------------------------
{
"applications": [
{
"id": "PSFLAUNCHERTHREETWOONE",
"executable": "MyApps.exe"
}
],
"processes": [
{
"executable": "MyApps",---------------------------------------------------------------
but I see the same error in both case.
---------------------------
Package Support Framework
---------------------------
ERROR: Failed to create detoured process
Path: "MyApps.exe"
Error: The system cannot find the file specified (2)
---------------------------
OK
---------------------------please let me know if i am missing anything
Thanks,
Vikas
- May 06, 2020
tester2420 Some thoughts on those questions...
1) The term AnyCPU is what I think you mean by neutral, a single exe that can either run as 32 or 64 bit. This is only possible with .Net based executables, and the Psf components (except for PsfMonitor) are all written in "unmanaged" code, meaning that those components must be built in a specific bitness.
So you have to determine what bittness will be used and then use those components. MSIX has a concept of a bundle, so you can build two packages, one with the 32bit and one with the x64 ones, and then combine them into a bundle. When the bundle gets delivered, the appropriate package for the target architecture will be applied.
2) If you exclude the entire entry for WorkingDirectory, the PSFLauncher will launch your program using the MSIX default of the System32 folder. If you have an entry, but with an empty value, PsfLauncher will use the directory of the PsfLauncher instead. If you have a non empty value, it may be an absolute reference to a folder, or a relative one from the root of the package.
- tester2420May 06, 2020Copper Contributor
Thank you TIMOTHY_MANGAN ,
The suggested fix worked well for Notepad++, I have two more questions,
1)Its possible to have processor architecture as "neutral", in that case, what should be the bitness of our fix.
2) it's possible that MSIX does not have any folder inside and all exe's and Manifest(AppxManifest.xml) can be on the same level, so while applying fix what should be the value of "workingDirectory"
{
"id": "PSFLAUNCHERTHREETWO",
"executable": "MyTestExe.exe",
"workingDirectory": "??"
}Thank you so much in advance, have a nice day.
Kind Regards,
Vikas
- May 04, 2020
For anyone wanting to know the full syntax, you can search the web for Regex syntax info, but keep in mind that there are several dialects; Microsoft is using the ECM variant. https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-options
- marcinotorowskiMay 04, 2020Brass Contributor
Like TIMOTHY_MANGAN replied, but with a short extra bit of info. You can use Notepad$ to indicate everything that ends with Notepad, or ^Notepad to indicate things that start with Notepad. Plus (+) is a special regexp character denoting one or more repetitions of the previous token, so you cannot use it literally. Instead, you should escape it by escaping it with a backslash character. However, since JSON file on its own uses backslash as an escaping sequence you should actually use two backslashes, like:
executable: "Notepad\\+\\+"
This should produce a correct regex for PSF runtime.
- May 01, 2020
tester2420 Regarding your Notepad++ json. The item in Bold below is the issue. That field is a RegEx pattern field so the ++ are special characters. Replace with something like "Notepad$" (meaning any process name starting with the character string "Notepad") and you should be fine.
tester2420 wrote:
I am having another encoding problem with notepad++
my config.json looks like this
"applications": [
{
"id": "PSFLAUNCHERSIXFOUR",
"executable": "VFS/ProgramFilesX86/Notepad++/notepad++.exe",
"workingDirectory": "VFS/ProgramFilesX86/Notepad++"
}
],
"processes": [
{
"executable": "notepad++",...
- May 01, 2020
tester2420 The fixups are applied and configured on the basis of the filename of the launched process, so while you can use the launcher for different command arguments to the same target process, the target process will get the same fixups and fixup configuration. But you really should be able to have a single configuration that works for both launch points.
- tester2420May 01, 2020Copper Contributor
Dear Tim,
I am having another encoding problem with notepad++
my config.json looks like this
"applications": [
{
"id": "PSFLAUNCHERSIXFOUR",
"executable": "VFS/ProgramFilesX86/Notepad++/notepad++.exe",
"workingDirectory": "VFS/ProgramFilesX86/Notepad++"
}
],
"processes": [
{
"executable": "notepad++",and once i build the msix and launch it is giving regex error around encoding(i believe) regex_error
---------------------------
Package Support Framework
---------------------------
regex_error(error_badrepeat): One of *?+{ was not preceded by a valid regular expression.
---------------------------
OK
---------------------------Please let me know if there is any solution for this i have tried escaping and encoding + by %20.
Kind Regards,
Vikas