You are here

PAL 2.1.1 : Temp\AppnamePortableTemp\.. - Left over

9 posts / 0 new
Last post
Ambimind
Offline
Last seen: 13 years 1 month ago
Joined: 2010-10-20 18:39
PAL 2.1.1 : Temp\AppnamePortableTemp\.. - Left over

Working on porting a java app.
Filesystem and Registry are clean apart from said.
In the manual under "CleanTemp" we are told this should not happen; Is this a bug or am I doing something wrong?(Note: Atm I'm cleaning it using [DirectoriesCleanupForce])

Here is my launcher.ini:

[Launch]
ProgramExecutable=PhpStorm\bin\PhpStorm.exe
DirectoryMoveOK=yes
RunAsAdmin = force

;[Environment]
;IDEA_PROPERTIES=c:\ideaconfig\idea.properties

[FileWrite1]
Type=ConfigWrite
File=%PAL:AppDir%\PhpStorm\bin\idea.properties
Entry=idea.config.path=
Value=%PAL:DataDir:ForwardSlash%/.WebIde10/config

[FileWrite2]
Type=ConfigWrite
File=%PAL:AppDir%\PhpStorm\bin\idea.properties
Entry=idea.system.path=
Value=%PAL:DataDir:ForwardSlash%/.WebIde10/system

[FileWrite3]
Type=ConfigWrite
File=%PAL:AppDir%\PhpStorm\bin\idea.properties
Entry=idea.plugins.path=
Value=%PAL:DataDir:ForwardSlash%/.WebIde10/config/plugins

[DirectoriesCleanupForce]
1=%LOCALAPPDATA%\Temp\PhpStormPortableTemp

John T. Haller
John T. Haller's picture
Online
Last seen: 11 min 18 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
App Not Running

Phpstorm.exe isn't the app. It's just the file to kick it off. As such, the launcher sees it exit and tries to clean up as soon as it does, which is wrong. You need to handle Java apps very specifically. See this section of the manual and particularly the example at the end with details on launching the JAR properly with the commandline and the WaitFor information.
https://portableapps.com/manuals/PortableApps.comLauncher/topics/java/

Sometimes, the impossible can become possible, if you're awesome!

Ambimind
Offline
Last seen: 13 years 1 month ago
Joined: 2010-10-20 18:39
Interesting

Unfortunately doing this has the consequence that :

From Manual :

Caveat: With require, if you can possibly help it, set [Launch]:WaitForProgram or [Launch]:WaitForOtherInstances to false if you use java.exe or javaw.exe. Otherwise you’ll run into problems cleaning up if other Java applications get run, as it’ll look for instances of the application, and find javaw.exe, even though it’s another application’s javaw.exe instance.

The problems this can cause far out way my original issue.

In addition, I wonder why I should use "[Activate]:Java", when I am now on my second java application, successfully ported without using this setting?

Thanks.

John T. Haller
John T. Haller's picture
Online
Last seen: 11 min 18 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Right

Right, so you just disable WaitForOtherInstances because you're only concerned with waiting for the instance of javaw.exe that you're starting. Then it'll work without issue.

Sometimes, the impossible can become possible, if you're awesome!

Ambimind
Offline
Last seen: 13 years 1 month ago
Joined: 2010-10-20 18:39
I see, looks like I

I see, looks like I misunderstood the "WaitForOtherInstances" setting. I understand your suggestion and the setting now, thank you.

Although, I'm having difficulty finding the correct javaw.exe cmd argument, and as I said, I can't see the point of going to this trouble, when its already working?

John T. Haller
John T. Haller's picture
Online
Last seen: 11 min 18 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
It's Not

The fact that that directory remains means it's not working. That EXE just calls Javaw.exe with a specific commandline to start the JAR file. That's all it does. So you need to duplicate it in the launcher.ini.

Sometimes, the impossible can become possible, if you're awesome!

Ambimind
Offline
Last seen: 13 years 1 month ago
Joined: 2010-10-20 18:39
So , I found this in

So Smile , I found this in phpstorm.exe dir, seems there are some clue in the batch file - but beyond me to figure it out. I'm posting it just for interests sake, I don't expect you to come up with an answer :

@echo off

::----------------------------------------------------------------------
:: webide Startup Script
::----------------------------------------------------------------------

:: ---------------------------------------------------------------------
:: Before you run webide specify the location of the
:: JDK 1.5 installation directory which will be used for running Webide
:: ---------------------------------------------------------------------
IF "%WEBIDE_JDK%" == "" SET WEBIDE_JDK=%JDK_HOME%
IF "%WEBIDE_JDK%" == "" goto error

:: ---------------------------------------------------------------------
:: Before you run webide specify the location of the
:: directory where webide is installed
:: In most cases you do not need to change the settings below.
:: ---------------------------------------------------------------------
SET WEBIDE_HOME=..

SET JAVA_EXE=%WEBIDE_JDK%\jre\bin\java.exe
IF NOT EXIST "%JAVA_EXE%" goto error

IF "%WEBIDE_MAIN_CLASS_NAME%" == "" SET WEBIDE_MAIN_CLASS_NAME=com.intellij.idea.Main

IF NOT "%WEBIDE_PROPERTIES%" == "" set WEBIDE_PROPERTIES_PROPERTY="-Didea.properties.file=%WEBIDE_PROPERTIES%"

:: ---------------------------------------------------------------------
:: You may specify your own JVM arguments in PhpStorm.exe.vmoptions file. Put one option per line there.
:: ---------------------------------------------------------------------
SET ACC=
FOR /F "delims=" %%i in (%WEBIDE_HOME%\bin\PhpStorm.exe.vmoptions) DO call %WEBIDE_HOME%\bin\append.bat "%%i"

set REQUIRED_WEBIDE_JVM_ARGS=-Xbootclasspath/a:%WEBIDE_HOME%/lib/boot.jar -Didea.no.jre.check=true %WEBIDE_PROPERTIES_PROPERTY% %REQUIRED_WEBIDE_JVM_ARGS%
SET JVM_ARGS=%ACC% %REQUIRED_WEBIDE_JVM_ARGS%

SET OLD_PATH=%PATH%
SET PATH=%WEBIDE_HOME%\bin;%PATH%

SET CLASS_PATH=%WEBIDE_HOME%\lib\bootstrap.jar
SET CLASS_PATH=%CLASS_PATH%;%WEBIDE_HOME%\lib\util.jar
SET CLASS_PATH=%CLASS_PATH%;%WEBIDE_HOME%\lib\jdom.jar
SET CLASS_PATH=%CLASS_PATH%;%WEBIDE_HOME%\lib\log4j.jar
SET CLASS_PATH=%CLASS_PATH%;%WEBIDE_HOME%\lib\extensions.jar
SET CLASS_PATH=%CLASS_PATH%;%WEBIDE_HOME%\lib\trove4j.jar

:: TODO[yole]: remove
SET CLASS_PATH=%CLASS_PATH%;%WEBIDE_JDK%\lib\tools.jar

:: ---------------------------------------------------------------------
:: You may specify additional class paths in WEBIDE_CLASS_PATH variable.
:: It is a good idea to specify paths to your plugins in this variable.
:: ---------------------------------------------------------------------
IF NOT "%WEBIDE_CLASS_PATH%" == "" SET CLASS_PATH=%CLASS_PATH%;%WEBIDE_CLASS_PATH%

"%JAVA_EXE%" %JVM_ARGS% -cp "%CLASS_PATH%" %WEBIDE_MAIN_CLASS_NAME% %*

SET PATH=%OLD_PATH%
goto end
:error
echo ---------------------------------------------------------------------
echo ERROR: cannot start webide.
echo No JDK found to run webide. Please validate either WEBIDE_JDK or JDK_HOME points to valid JDK installation
echo ---------------------------------------------------------------------
pause
:end 

Thanks for your assistance.

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 3 months ago
Joined: 2007-04-15 21:08
General comments:

John's right about Java. But some extra comments on what you've posted:

  • Why do you have RunAsAdmin=force?
  • You shouldn't ever be doing this:
    [DirectoriesCleanupForce]
    1=%LOCALAPPDATA%\Temp\PhpStormPortableTemp

    There's no need. The PortableApps.com Launcher creates that, the PortableApps.com Launcher takes care of that. You should probably never even be using [DirectoriesCleanupForce] at all.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

Ambimind
Offline
Last seen: 13 years 1 month ago
Joined: 2010-10-20 18:39
Chris Morgan said: "Why do

Chris Morgan said: "Why do you have RunAsAdmin=force?"
Your right, I can see how this might be a problem. I was concerned for it to be able to make changes to the wind 7/vista firewall settings, as I will be bundling it with a portable version of XAMP.

Chris Morgan said: "You shouldn't ever be doing this:[...]"
Because as mentioned, it wasn't being cleaned up.

Log in or register to post comments