Portable install?

Try the latest development release to test new features and bug fixes even before beta version release. Please use this section to discuss features and problems of this Preview Build version.
Forum rules
Please read forum rules and a few additional rules for this section:
1. Please take into account that Preview Build versions of Salamander and plugins could contain serious bugs. Don't use them in production environments.
2. All problems or comments regarding Preview Build versions please insert into this section of forum.
3. Each new topic mark with PB abbreviation and Preview Build number, for example "PB22: inactive panel below mouse cursor doesn't scroll while mouse wheel tilting".
Jan Rysavy
ALTAP Staff
ALTAP Staff
Posts: 5126
Joined: 08 Dec 2005, 06:34
Location: Novy Bor, Czech Republic
Contact:

Re: Portable install?

Post by Jan Rysavy » 09 Sep 2013, 16:06

SvA wrote:
Jan Rysavy wrote:Wasted time...
I disagree.
What about creating a poll on this?
Good idea! Proposed options regarding portable version:
1) Writing to registry and installing shell extension into TEMP is OK. (*)
2) Writing to registry is OK, but installing shell extension into TEMP is not possible. I can live without shell extension. (*)
3) Writing to registry and TEMP directory is not possible, I can live without Eroiica Viewer, WinSCP plugin, and shell extension.

(*) Assuming it would be cleaned on Salamander exit / Windows restart.

johnd126
Posts: 35
Joined: 19 Feb 2006, 01:05

Re: Portable install?

Post by johnd126 » 13 Sep 2013, 15:50

Petr Solin wrote:We have no experience with this, please give us more information.

Do you need to start Salamander on some protected computers where unknown applications (like Salamander) cannot write anything to registry? Or do you have some restrictions on registry keys? E.g. HKEY_CURRENT_USER\Software is OK, but HKEY_CLASSES_ROOT is forbidden?

I'm afraid that some plugins cannot work without access to registry. Eroiica registers its DLLs to registry because it is using COM model, without registering these DLLs to registry, it simply cannot work and I do not believe Parallax (author) will change COM to anything else. Next is WinSCP, it has configuration in own key in registry (not under Salamander's key), it shares configuration with standalone version of WinSCP.

Drag&drop from archives and filesystem plugins (e.g. FTP) to Explorer cannot work without registering our DLL with copy-hook in registry.

We have expected that if we place configuration in some special key ("portable" in name to avoid collision with client's installed Salamander) in registry and will create this key on start (load it from configuration file from USB) and remove this key on exit, it will be OK. We can register copy-hook to our DLL copied to TEMP directory and unregister it on Salamander's exit and schedule DLL in TEMP for deletion on Windows shutdown (or start). The same with Eroiica's registration and WinSCP configuration, simply make special support for start and exit of portable version (loading from file and cleaning from registry).
I'm the same as other posters: I can live without Eroiica or WinSCP and really don't want anything written to the registry, even temporarily. Mostly I would want the basic AS configuration settings ... nothing fancy.

I could live without drag and drop from archives ... but does the dll absolutely have to be registered in the registry? I've implemented keyboard hook dll's but they've never required any registration. They implement SetWindowsHookEx() on launch and it communicates with my main application. When the application exits the hook is removed. And as far as I know the dll can be loaded from any directory.

Keep up the good work.
jd

User avatar
Ether
Posts: 1457
Joined: 10 May 2007, 16:08
Location: Czech Republic
Contact:

Re: Portable install?

Post by Ether » 14 Sep 2013, 19:57

3) +1; I believe that writing to registry is precisely what portable applications should not do. Besides, I don't need Eroiica nor drag'n'drop.

The WinSCP application can use an INI file for configuration, so it shouldn't be a lot of work to modify the plugin to allow the same.
Ελληνικά rulez.

johnd126
Posts: 35
Joined: 19 Feb 2006, 01:05

Re: Portable install?

Post by johnd126 » 18 Sep 2013, 04:45

Petr Solin wrote:We have no experience with this, please give us more information.
Here's some pseudo code which will show the idea.

Reading values:
--------------------

Instead of this:

DWORD Type = REG_DWORD, Size = sizeof(DWORD);
RegOpenKey((HKEY_CURRENT_USER, "Software\\Altap\\Altap Salamander 3.0 beta 3\\Configuration", &hKey);
RegQueryValueEx(hKey, "Always On Top", NULL, &Type, (PBYTE)Value, &Size);
RegCloseKey(hKey);

Use this:

char buf[MAX_PATH];
int Value;
GetPrivateProfileString("Configuration", "Always On Top", "0", buf, MAX_PATH, IniFile);
Value = atoi(buf);

Writing values:
------------------

Instead of this:

DWORD Value = 1;
RegOpenKey(HKEY_CURRENT_USER, "Software\\Altap\\Altap Salamander 3.0 beta 3\\Configuration", &hKey);
RegSetValueEx(hKey, "Always On Top", 0, REG_DWORD, (PBYTE)&Value, sizeof(Value));
RegCloseKey(hKey);

Use this:

char buf[MAX_PATH];
lstrcpy(buf, "1");
WritePrivateProfileString("Configuration", "Always On Top", buf, IniFile);

Which will create this in the IniFile:

[Configuration]
Always On Top=1

Jan Rysavy
ALTAP Staff
ALTAP Staff
Posts: 5126
Joined: 08 Dec 2005, 06:34
Location: Novy Bor, Czech Republic
Contact:

Re: Portable install?

Post by Jan Rysavy » 18 Sep 2013, 09:41

What about system libraries and shell extensions - tens of DLLs every process is loading anyway? How can we disable writing to the registry there?

You can use Process Monitor to get idea, there is A LOT activity on process background.

Please let us know exactly why do you see (runtime/temporary) writing into registry as problem. It will help us find proper solution for Salamander...

User avatar
SvA
Posts: 439
Joined: 29 Mar 2006, 02:41
Location: DE

Re: Portable install?

Post by SvA » 18 Sep 2013, 20:32

Jan Rysavy wrote:What about system libraries and shell extensions - tens of DLLs every process is loading anyway? How can we disable writing to the registry there?
Don't care about those. That's what the system thinks it needs to do, let it do it. Only make sure you do not register any dlls nor write to the registry explicitly.
Jan Rysavy wrote:Please let us know exactly why do you see (runtime/temporary) writing into registry as problem.
Is there any part of the registry denoted by windows to hold temporary values, something that take the same role within the registry as does the TEMP directory in the file system? If there is, you may use it. But since there is not you ought not.

And regarding the code johnd126 gave. I suppose you know, not to do it just like that. Instead you should encapsulate operations to the config store such, that you easily can replace the config storage to whatever you choose, such as
  • an INI file
  • an XML file
  • a plist file
  • a JSON file
  • a database (e.g. SQLite
  • the registry
  • ...

Jan Rysavy
ALTAP Staff
ALTAP Staff
Posts: 5126
Joined: 08 Dec 2005, 06:34
Location: Novy Bor, Czech Republic
Contact:

Re: Portable install?

Post by Jan Rysavy » 18 Sep 2013, 23:06

SvA wrote:
Jan Rysavy wrote:Please let us know exactly why do you see (runtime/temporary) writing into registry as problem.
Is there any part of the registry denoted by windows to hold temporary values, something that take the same role within the registry as does the TEMP directory in the file system? If there is, you may use it. But since there is not you ought not.
Is any reference available? I didn't find guidelines for Windows portable apps.
SvA wrote: And regarding the code johnd126 gave. I suppose you know, not to do it just like that. Instead you should encapsulate operations to the config store such, that you easily can replace the config storage to whatever you choose, such as
Yes, we know, we already have this layer implemented and partially used in Salamander (for now it is handling command Option > Export Configuration).

johnd126
Posts: 35
Joined: 19 Feb 2006, 01:05

Re: Portable install?

Post by johnd126 » 25 Sep 2013, 17:47

Jan Rysavy wrote:
SvA wrote:
Jan Rysavy wrote:Please let us know exactly why do you see (runtime/temporary) writing into registry as problem.
Is there any part of the registry denoted by windows to hold temporary values, something that take the same role within the registry as does the TEMP directory in the file system? If there is, you may use it. But since there is not you ought not.
Is any reference available? I didn't find guidelines for Windows portable apps.
There is no such thing as a temporary section in the registry. Anything put in the registry stays there until it's removed. Truly portable apps simply just don't use the registry.

Jan Rysavy
ALTAP Staff
ALTAP Staff
Posts: 5126
Joined: 08 Dec 2005, 06:34
Location: Novy Bor, Czech Republic
Contact:

Re: Portable install?

Post by Jan Rysavy » 25 Sep 2013, 19:03

We are not talking about some imaginary temporary registry key. We are just proposing we will use registry when Salamander will be running with cleaning it on close.

Until someone show us some real guidelines / specifications for portable Windows applications, I still consider it as good solution for Salamander. Switch to file-only solution is much more complicated with existing code base.

Post Reply