Forum Discussion
powershellScriptRunner.Initialize(appConfig, currentDirectory, packageRoot);
tester2420 Good. That's what I was going to suggest. I discovered earlier this week that some of the changes in the PR didn't get integrated causing the issue you've seen. There will be a new PR shortly to fix that in the sources. I don't think any other issues from the missing changes should affect you.
- 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 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
- Sleeping_DeveloperApr 30, 2020Copper Contributor
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
- Apr 30, 2020
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.
- tester2420Apr 30, 2020Copper Contributor
Thank you so much TIMOTHY_MANGAN , i have tried this and its working, Great!
now i am wondering if we can have two fixes for the same entry points(exe).
- 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
- 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.
- 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++",...
- 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 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.