Forum Discussion
Can we have multiple fixes at the same time
tester2420 When the PSF is not in use, you can do whatever you want in the manifest for the AppID field, but not so when the PSF is in use.
The PsfLauncher uses an algorithm that takes the name of its process and turns it into an AppID that matches how the MSIX Packaging tool would have created it. It then looks for an application entry in the config.json file that matches that AppId. The algorithm is still undocumented to the best of my knowledge, but James Pike provided an unofficial summary of it in this reply on the community portal.
So if your PsfLauncher64.exe is the process, the config.json entry for the application should have an appid of "PSFLAUNCHERSIXFOUR". Totally obvious, right?
Thanks once again for the reply, I was trying to update the config file to see the success but PSFLauncher64.exe is haunting me, its continue to crash, so i took the latest branch and was trying to compile
I see initialize has 3 arguments
void Initialize(const psf::json_object* appConfig, const std::filesystem::path& currentDirectory, const std::filesystem::path& packageRootDirectory)
but only 2 params are passed.
powershellScriptRunner.Initialize(appConfig, currentDirectory);
the branch I cloned is :
https://github.com/microsoft/MSIX-PackageSupportFramework/tree/develop
and its a compilation error.
Anything I am missing?
Thank you,
Vikas
- 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