Aug 26 2021 09:02 AM - edited Aug 26 2021 09:02 AM
Hi All,
Scenario: I have an app with multiple shortcuts, in those one shortcut's Target is "cmd.exe" and argument is path of a batch script file(.bat file). I have tried to create MSIX package with the help of PSF Tool. while testing I am able to launch every shortcut, except this one (which has batch script).
I tried the below things:
1. As we know there is no communication between MSIX container and the native cmd.exe file, I have copied cmd.exe (which is not recommendable) file into msix package and tried to launch the shortcut. It didn't work.
2. In config.json file, replaced cmd.exe with the psflauncher.exe in place of target, which mean this psflauncher will call the .bat file to execute. It didn't work
3. In config.json file, placed .bat file path in Target place with out any arguments. It didn't work.
Is there any thing else to try other than above, please advise and guide.
Thanks in Advance.
Aug 27 2021 08:33 AM - edited Aug 27 2021 08:38 AM
Can anyone help me on this situation.......frequently I am facing the scenario, where target has cmd.exe and argument has a .bat file or sometimes directly .bat file in target, there type of shortcuts were not working even with psf tool also.
Aug 28 2021 02:50 PM
Sep 14 2021 01:02 PM
Sep 14 2021 11:04 PM
Sep 15 2021 07:12 AM
Sep 16 2021 02:39 AM
Sep 16 2021 06:49 AM - edited Sep 16 2021 02:12 PM
Try this config.json file to start the test.bat file. Create a dummy AppLauncher.ps1 and put that one in the root of the package.
{
"applications": [
{
"id": "PSFLAUNCHERSIXFOUR",
"executable": "VFS\\ProgramFilesX64\\Test\\cmd.exe",
"arguments": "\/c VFS\\ProgramFilesX64\\Test\\test.bat",
"workingDirectory": "",
"stopOnScriptError": true,
"startScript":
{
"scriptPath": "AppLauncher.ps1",
"scriptArguments": "",
"runInVirtualEnvironment": true,
"showWindow": false,
"waitForScriptToFinish": true,
"runOnce": false
},
"endScript":
{
"scriptPath": "AppLauncher.ps1",
"scriptArguments": "",
"runInVirtualEnvironment": true,
"showWindow": false,
"waitForScriptToFinish": true,
"runOnce": false
}
}
]
}
i put the cmd.exe in the package. This to be able to start the script in the bubble. If i used c:\windows\system32\cmd.exe it runs outside the bubble. Also to let the cmd.exe work correctly, a subfolder en-us with cmd.mui.exe is required.
@tmangan is this expected behavior?
Sep 16 2021 12:37 PM
@Siva116 If you could post your bad version, that would be helpful. I've been working on some PSF FRF issues seen in your Java App and plan to hit up scripting issues in the Launcher before releasing.
Sep 16 2021 02:23 PM
Sep 17 2021 05:49 AM
Sep 20 2021 07:20 AM
@TIMOTHY MANGAN thanks for your responses.....we have Zulu Java 1.8 version installed in the package. The current config.json we use looks like:
{
"applications": [{
"id": "PSFLAUNCHERSIXFOUR",
"executable": "c:\\windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe",
"arguments": "-ExecutionPolicy Bypass -Command \"& {Invoke-CommandInDesktopPackage Test-0607.01-ENG_fg0t8wag126gc PSFLAUNCHERSIXFOUR cmd.exe '\/c c:\\progra~1\\Test\\Test\\bin\\runclient.bat' -PreventBreakaway}\"",
"workingDirectory": "",
"stopOnScriptError": true,
"startScript": {
"scriptPath": "AppLauncher.ps1",
"scriptArguments": "",
"runInVirtualEnvironment": true,
"showWindow": false,
"waitForScriptToFinish": true,
"runOnce": false
},
"endScript": {
"scriptPath": "AppLauncher.ps1",
"scriptArguments": "",
"runInVirtualEnvironment": true,
"showWindow": false,
"waitForScriptToFinish": true,
"runOnce": false
}
}]
}
AppLauncher.ps1 is just a dummy file since without a startScript it seems to fail.
runclient.bat is a command file which starts the java.exe with arguments.
Above seems to work although it looks terrible due to the popup boxes of PowerShell and CMD.
But maybe you have some additional tips to make this easier configured. The final situation should be that the JAVA.EXE should be started in the bubble.
Sep 20 2021 08:23 AM
Sep 20 2021 10:30 AM
Sep 21 2021 05:45 AM
Sep 22 2021 01:54 AM
@TIMOTHY MANGAN related to your answer, you posted: Thanks for posting the json. I'm not sure why the main bat file is started via cmd inside a powershell, but the scripting portion looks fine.
Is there another way of starting the BAT file, which is located in the bubble and should be run in the bubble? This seems to be the only way we could find. Another way was to use CMD.exe, but then it works only when we used a cmd.exe copy added to the package. When we ran c:\windows\system32\cmd.exe it seems the BAT file does not start in the bubble, but outside :(
Sep 27 2021 01:40 PM
Sep 27 2021 01:44 PM
Sep 28 2021 02:30 AM
Sep 29 2021 05:18 AM - edited Sep 29 2021 05:18 AM
Tested by colleague of mine and new psflauncher seems to work and BAT/CMD files can be started directly by psflauncher32.exe in json file