You are here

AppKiller

5 posts / 0 new
Last post
zomby_mann_zakk
Offline
Last seen: 11 years 5 months ago
Joined: 2010-09-12 20:43
AppKiller

I am using nsis and lazarus to create a gui ejector and appkiller script depending upon the ini file that the lazarus form spits out. I am as far as the "kill all" and the "eject" option, but I have hit a snag in the road. I need to have a list of all the installed applications. How can this be done through nsis. I was thinking something along the lines of:

ReadINIStr $0 "..\..\..\*Portable\App\AppInfo\AppInfo.ini" "Details" "AppId"
StrCpy $0 $0 + ".exe"
WriteINIStr "$EXEDIR\Data\Eject.ini" "AppsToKill$R0" "1" "$0"
${StrReplaceV4} $1 "portable.exe" ".exe" $0
WriteINIStr "$EXEDIR\Data\Eject.ini" "AppsToKill$R0" "2" "$1"

or I could have and INI file that contains all of the Apps available for download, check if they exist in the processes, try to terminate the process, eject the drive, but this would take up quite a bit more space, and takes a little longer for it to go through because it would have to parse through the ini file, and just arrange them into the eject.ini file. Is there an easier way to do this through nsis or lazarus that would be less difficult than the second way, and actually work?
-thank you for your time

Pyromaniac
Pyromaniac's picture
Offline
Last seen: 8 years 11 months ago
Developer
Joined: 2008-09-30 19:18
why?

If you kill a running portable app launcher, it will not be portable, you may lose settings, you may even leave data behind on the host computer. The "kill all" option is included in the CodySafe and I often lost settings on my portable apps when using it. It's highly unrecommended (is that a word?). Just stick to the eject function in PAM IMHO.

zomby_mann_zakk
Offline
Last seen: 11 years 5 months ago
Joined: 2010-09-12 20:43
not for appname portable

its going to take the root name of the application and search for the process and if the process matches the path then it is terminated

Pyromaniac
Pyromaniac's picture
Offline
Last seen: 8 years 11 months ago
Developer
Joined: 2008-09-30 19:18
then it'll be difficult

not all portable apps are the same. Some apps are written in PAL, and those apps will be easy to kill (just looking at [Launch]:ProgramExecutable is all you need to do). Other apps are custom coded and sometimes (but rarely) the AppName folder in App might be a different name then the AppName from AppNamePortable, for some reason or another. In a situation like that, I have no idea how you should deal with it, nor do I believe there is a way to handle a portable app like that.

Plus, even if you could do it, you would still have to wait a while for the launcher to clean up. And if you have a couple of large portable apps open (say Firefox and, say LibreOffice) having to both write to the disk at the same time, it will take longer to save the data before ejecting.

And what if your running like firefoxportable from the harddrive, and you have it on your flash drive, and you try to eject?

Also, what would you do about apps that are not in PortableApps.com Format? Many people have non-PAF apps on their drive you need to account for.

Keep that in mind.

zomby_mann_zakk
Offline
Last seen: 11 years 5 months ago
Joined: 2010-09-12 20:43
Custom Options

This is going to be a multi-purpose app for the branch of a (portableapps.com Platform inspired) lazarus portable apps menu. It will work as an add on for the ejector script making sure the apps found A) have there base app ended, B) The NSIS script will wait for the portable launcher to finish writting, C) call an ejector application

As for apps in non-PAF format or in a custom coded format, I could do one of many things including: a multi-step process of reading folder names, executable names, and other files, having lazarus create custom ends for the non-portable apps, or I could have lazarus have a popup that asks for the name of the folder, executable, and portablename.

As in the comment above I have kept that in mind information like that will be kept in "$EXEDIR\Data\Custom.ini" and will contain many advanced option for the users like custom waits for application, custom ending of applications, etc.

*Edit
I just thought it would just be a beneficial feature for an ejector script to be at least semi-automated.

Log in or register to post comments