NO

Author Topic: pelles c portable  (Read 16094 times)

czerny

  • Guest
Re: pelles c portable
« Reply #15 on: May 31, 2012, 09:51:41 pm »
Most of the time the ide writes in the xml file. But sometimes the registry is used. This is     inconsequent in my opinion.
AlexN: Can you confirm that the registry is used in addition to the xml file? I have observed this for example if I use a tool from tool menu. Afterwards there is an entry in the registry.

Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 383
    • Alex's Link Sammlung
Re: pelles c portable
« Reply #16 on: June 01, 2012, 08:38:50 am »
Most of the time the ide writes in the xml file. But sometimes the registry is used. This is     inconsequent in my opinion.
AlexN: Can you confirm that the registry is used in addition to the xml file? I have observed this for example if I use a tool from tool menu. Afterwards there is an entry in the registry.
Not really. I looked in the registry and searched for the entry Pelle Orinius, saved it, delete it, started portable poide, finished it and looked again in the registry. And there was an entry for Pelle Orinius, but it contains only options from the Web features addin. When I renamed the extension of web32.dll, no entries in the registry are created.
Short: poide doesn't use the registry when you use the option /xml, addins perhaps do it.
best regards
 Alex ;)

czerny

  • Guest
Re: pelles c portable
« Reply #17 on: June 01, 2012, 08:49:10 am »
Not really. I looked in the registry and searched for the entry Pelle Orinius, saved it, delete it, started portable poide, finished it and looked again in the registry. And there was an entry for Pelle Orinius, but it contains only options from the Web features addin. When I renamed the extension of web32.dll, no entries in the registry are created.
Short: poide doesn't use the registry when you use the option /xml, addins perhaps do it.
Please try opening Process Viewer or Registry Editor from the tools menu.

Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 383
    • Alex's Link Sammlung
Re: pelles c portable
« Reply #18 on: June 01, 2012, 10:06:16 am »
Please try opening Process Viewer or Registry Editor from the tools menu.
You are right, there is a little bug (please write a bug report for Pelle , so it's easier to track).
best regards
 Alex ;)

CommonTater

  • Guest
Re: pelles c portable
« Reply #19 on: June 01, 2012, 03:17:50 pm »
Please try opening Process Viewer or Registry Editor from the tools menu.
You are right, there is a little bug (please write a bug report for Pelle , so it's easier to track).

Hi Alex and czerny...
 
With respect to the Web Features AddIn (and the C++ and ExtraButtons) that's not actually a bug.  I simply didn't consider portable use when creating the software.  Those addins are going to write to the registry no matter what you do since there is no way to make them aware of POIDE's use of the /xml option.  I'm not going to swith them over to use INI or CFG files, because of the increased complexity of the software and the likelihood of running afoul of virtualization in Win7 and Vista (as in: I really don't want to have to go searching for my settings each time the DLL starts up).

The same might be true of many of the niceities, including Pelle's registry editor and process viewer which are free-standing programs that would be equally unaware of the /xml option in POIDE.
« Last Edit: June 01, 2012, 03:23:59 pm by CommonTater »

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1828
Re: pelles c portable
« Reply #20 on: June 01, 2012, 03:39:48 pm »
Those addins are going to write to the registry no matter what you do since there is no way to make them aware of POIDE's use of the /xml option.
Maybe you can look xml option with GetCommandLine() in AddIn dll ?
EDIT: Compile this to dll:
Code: [Select]
// GetCommandLine.c
#define UNICODE
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <addin.h>

ADDINAPI BOOL WINAPI AddInMain(HWND hwnd, ADDIN_EVENT eEvent)
{
// This is the only required export function in an Add-In.
switch (eEvent) {
// Application events.
case AIE_APP_CREATE:
AddIn_WriteOutput(hwnd, GetCommandLine());
return FALSE;
}
}
« Last Edit: June 01, 2012, 08:52:24 pm by timovjl »
May the source be with you

CommonTater

  • Guest
Re: pelles c portable
« Reply #21 on: June 01, 2012, 04:50:16 pm »
Those addins are going to write to the registry no matter what you do since there is no way to make them aware of POIDE's use of the /xml option.
Maybe you can look xml option with GetCommandLine() in AddIn dll ?

Maybe so, Timo... but I'm really not all that keen on the added complexity.  That is... I know how to do it, I'm just not sure I want to.  It is not unreasonable to expect a portable version to be considerably less complex or comprehensive than a desktop installation...
 
That said... if anyone wants to do a "portable" mod of any of my AddIns... you have the source code, knock yourselves out! 
 

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1828
Re: pelles c portable
« Reply #22 on: June 01, 2012, 07:07:59 pm »
Here is StartPellesC project for testing.
Options are read from StartPellesC.ini
Code: [Select]
[Paths]
PellesC=:\Program Files\PellesC\
[Files]
Config=PellesC.xml
[Command]
Run=poide.exe -x
drive letter is read from current drive.
Copy StartPellesC.exe and StartPellesC.ini to stick and edit StartPellesC.ini for your configuration.

BTW:
As we know PellesC is good for portable use:
Is it possible to release PellesC to portable users in ZIP file ?
- PellesC folder both versions (32/64) in separated ZIP ?
- 32 bit user can test linking 64-bit program if 64-bit libraries is available.

EDIT: UNICODE


« Last Edit: June 02, 2012, 05:30:26 pm by timovjl »
May the source be with you

Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 383
    • Alex's Link Sammlung
Re: pelles c portable
« Reply #23 on: June 01, 2012, 10:40:44 pm »
I tried in a silent hour something similar and very simple (and only 32-bit and no unicode).

Put the p_poIDE.exe in the bin directory and call it with the parameters you use for poide.exe.
best regards
 Alex ;)

czerny

  • Guest
Re: pelles c portable
« Reply #24 on: June 02, 2012, 11:21:31 am »
I have further searched for a simple batch solution and have tried the following:

Code: [Select]
@echo off
set _drive=%~d0
set drive=%_drive:~0,1%
subst x: %drive%:\
x:\programme\pellesc\bin\poide.exe /xml pellesc-x.xml
subst x: /D
pause

where in pellesc-x.xml drive chars can be set to 'x' (removeable drive) or something else (fixed drives). One has to give poide.EXE explicite. Start via poide.com seems not to work.

Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 383
    • Alex's Link Sammlung
Re: pelles c portable
« Reply #25 on: June 02, 2012, 06:56:08 pm »
This batch could be a little bit simpler:
Code: [Select]
@echo off
subst x: %~d0\
poide.exe /xml pellesc-x.xml
subst x: /D
pause
best regards
 Alex ;)

czerny

  • Guest
Re: pelles c portable
« Reply #26 on: June 03, 2012, 01:34:49 pm »
I have written a little step by step tutorial how to build a portable version. If this works for you all, I will put this or a corrected version to the wiki.

« Last Edit: June 03, 2012, 07:28:18 pm by czerny »

Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 383
    • Alex's Link Sammlung
Re: pelles c portable
« Reply #27 on: June 03, 2012, 05:55:53 pm »
I have written a little step by step tutorial how to build a portable version. If this works for you all, I will put this or a corrected version to the wiki.
I have read your make-portable.txt.
1.) I am not sure why you use their a  ..\usr\.. directory. I think the common directory for all is ..\PellesC\.. and you don't use it in your batch.
2.) You write, that the drive letter has to be changed. I (\PortableApps\) and perhaps other will use different directories, so the description will be more common, when you write you have to adapt the first time drive and path.

I think, it is a great idea to write such thing into the so that it became a knowledge base for Pelles C! ;)
best regards
 Alex ;)

czerny

  • Guest
Re: pelles c portable
« Reply #28 on: June 03, 2012, 07:02:41 pm »
1.) I am not sure why you use their a  ..\usr\.. directory. I think the common directory for all is ..\PellesC\.. and you don't use it in your batch.
You are right, I should have made this clearer. I would like to have a place for user tools (Message Cracker Wizard ...) and user dlls in 'PellesC\Usr\Bin'. Further I like to have a place for own librarys and header files in 'PellesC\Usr\Lib' and 'PellesC\Usr\Include' resp. It would be nice to have a small set of usefull example files to make this clear.
2.) You write, that the drive letter has to be changed. I (\PortableApps\) and perhaps other will use different directories, so the description will be more common, when you write you have to adapt the first time drive and path.
I will change this.

czerny

  • Guest
Re: pelles c portable
« Reply #29 on: June 03, 2012, 07:30:35 pm »
have updated the batch (parameter forward) and the tutorial. Hope it is more clear now.