Now, I know I'm not supposed to ask for or about updates, but would it at all be possible for me to manually update my GIMP Portable to 2.4.1? For instance, in the GIMP Portable 2.2.17 directory, replacing the GIMP files with files from the standard app GIMP 2.4.1? As far as I know, file locations haven't really changed. Because if all the portable app needs to do is reference the app in a local manner and run it in a local manner, then I think it should work.
CAVEAT LECTOR: modifying source code and updating things yourself are two of the perks of Open Source software. You can do whatever you want with your own installation. However, the PortableApps team frowns on promoting forks of the official source tree, so I won't be providing any actual code here, just vague hints on how to do it yourself. Do note, however, that once you diverge from the official source, you can't expect the original developers to help you with any problems that crop up, so you're pretty much on your own. That being said:
Yes. You will need to recompile the launcher though, because the executable is now named gimp-2.4.exe, and (b) GTK is now no longer installed in a separate folder, so you'll need to remove the references to GTK from the installer. (It's just about as easy as deleting any line with "GTK" in it-- though do make a backup in case something goes wrong.) So you'll have to download NSIS (it's free, don't worry) and a couple plugins in order to compile it. The file you're looking to modify is GIMPPortable\Other\GIMPPortableSource\GIMPPortable.nsi . And if you try and compile the .nsi file and it complains that a certain function or whatever is missing, that means you need to download the plugin that provides that function.
Also, after you install GIMP 2.4 onto your hard drive, you'll want to download UPX and repack every .exe and .dll file in the GIMP+GTK distribution, using the command line options from https://portableapps.com/support/gimp_portable#modifications . Do make sure and test them afterwards with the -t switch, though, because some files won't work when packed. You'll have to replace those with the unpacked versions which UPX saves as .ex~ or .dl~ -- and after you've tested the rest of them to make sure they work, make sure to delete the backup unpacked files from your directory tree, otherwise they'll still be taking up all that space!
Once you've done that, copy the modified distribution tree -- minus the setup\ directory, which contains the uninstaller -- onto your thumbdrive (or wherever) in the GIMPPortable\App\gimp directory, replacing the current contents. You can delete GIMPPortable\App\gtk, since you've removed the references to that from the NSIS launcher.
You should also modify GIMPPortable\App\AppInfo\appinfo.ini to reflect the new version.
Hope that helps!
to do this. Without needing to recompile the launcher:
- Get GimpPortable and Gimp 2.4 install,
- Unpack GimpPortable, install Gimp 2.4,
- Delete files from "gimp" and "gtk" folders in GimpPortable\App\,
- Copy the "gimp" directory content from installed Gimp 2.4 to GimpPortable\App\gimp,
- Leave the "gtk" folder empty (launcher checks for existence of this dir),
- Copy all .dll files from GimpPortable\App\gimp\bin to GimpPortable\App\gimp\lib\gimp\2.0\plug-ins\ (*),
- Copy the GIMPPortable.ini from GIMPPortable\Other\GIMPPortableSource to GIMPPortable folder,
- In this ini file change GIMPExecutable parameter to "gimp-2.4.exe" value (without quotes),
- Optionally, upx all exes and dlls to save some space.
- Optionally, delete unneeded folders from GIMPPortable\App\gimp\lib\locale.
(*) This is the actual problem generating issue.
When launching gimp without the dll files copied to plugins folder, nothing works: you cannot open any graphics file. Using filemon (Sysinternals tool) I have noticed that script-fu.exe or gifload.exe (examples) cannot find some dlls located in bin folder. Instead, they look for this dlls in plug-ins, GimpPortable, windows\system32, etc.
I tried to modify the nsi script but nothing works. There is already a section:
GTKDirectory:
;=== Add GTK to the %PATH% directory if we have a path, otherwise, skip it
StrCpy $0 "$GTKDIRECTORY\bin;$PROGRAMDIRECTORY\bin"
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("PATH", "$0").r0'
System::Call 'Kernel32::SetEnvironmentVariableA(t, t) i("GTK_BASEPATH", "$GTKDIRECTORY").r0'
that adds GimpPortable\gimp\bin to the PATH EnvVar, I have checked with ProcessExplorer (Sysinternals) that GimpPortable.exe and gimp-2.4.exe are using it but somehow it is not passed to the plugins (like script-fu or gifload) and in result it does not work.
The only thing that helps is copying this dlls to plug-ins folder.
PS.
You can of course modify the nsi file and recompile the launcher so there are no GTK entries there and after that you can delete the gtk folder from GimpPortable\App directory but it is rather cosmetic step and in my opinion (after an hour of battling with this) not worth an effort.
Hope above text is understandable enough to reproduce
Cheers,
--
Leepa
That's really curious. I didn't have to copy any DLLs on mine. Though possibly one reason is because I don't set the PATH variable in my installer-- I removed the entire GTKDirectory section. Perhaps having GimpPortable\App\gimp\bin on the path actually confuses it somehow? Or maybe having GTK_BASEPATH set causes problems. See what happens if you remove that section from the .nsi file.
For reference, the lines I removed from my .nsi file were: 30, 68, 93-94, 122-131, 134, 137-140, and 207-213.
...it is not working as expected.
I have followed your suggestions and removed all GTK references from nsi script.
The plugins still call for some dlls and cannot locate it. Below you will find FileMon's output monitoring gif-load.exe (I was trying to open some gif file):
gif-load.exe:3628 OPEN D:\Downloads\_\GIMPPortable\App\gimp\lib\gimp\2.0\plug-ins\libgimp-2.0-0.dll NOT FOUND
gif-load.exe:3628 OPEN C:\WINDOWS\system32\libgimp-2.0-0.dll NOT FOUND
gif-load.exe:3628 OPEN C:\WINDOWS\system\libgimp-2.0-0.dll NOT FOUND
gif-load.exe:3628 OPEN C:\WINDOWS\libgimp-2.0-0.dll NOT FOUND
gif-load.exe:3628 OPEN D:\Downloads\_\GIMPPortable\libgimp-2.0-0.dll NOT FOUND
gif-load.exe:3628 OPEN D:\downloads\_\gimp243\bin\libgimp-2.0-0.dll PATH NOT FOUND
Background info:
Portable Gimp is located in D:\Downloads\_\GimpPortable
One can see that gif-load.exe is looking for the required dll in: plugins, system32, system, windows, GimpPortable root.
The last path (
D:\downloads\_\gimp243\
) is a path were normal Gimp 2.4.3 was installed as a source of new version. To be honest I cannot find how the portable gimp finds this path? Gimp was uninstalled, there are no references to this path in either registry or gimp configuration files, nothing...As I stated in my previous post, only copying dlls from gimp\bin to lib...plugins helps...
And replying to your I didn't have to copy any DLLs on mine:
Maybe (and I don't mean to offend you ) you have normal Gimp installed and the portable one actually opens required dlls from the installed one?
--
Leepa