Forum Discussion
Shortcut pointing to Batch script (.bat file) - PSF Tool not worked.
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?
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.
- PollewopsSep 16, 2021Iron ContributorHi @tmangan, i also today tried to create msix application. Before the exe starts, a java.exe version needs to start as startup script. I can’t get it working. Is something similar appears with you?
- Sep 17, 2021Generically Java shouldn't be a problem, however the app I mentioned was using a 1.4 version of Java which has lots of problems. Once I clear out some other PSF issues I will be looking at scripting to see what is up. Generally, scripts are working, so posting specifics on problems is always helpful.
So what version of Java, is it inside the package or locally installed, what does the script look like.- PollewopsSep 20, 2021Iron Contributor
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.