AutoHotkey Community

It is currently May 27th, 2012, 10:12 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: March 22nd, 2007, 12:51 pm 
Offline

Joined: October 3rd, 2005, 10:02 pm
Posts: 40
Location: DE, Berlin
majkinetor wrote:
Quote:
Also you can temporarily change the PATH variable - only for that specific application.

That is not the soluton.

What if I put bunch of console utilities on the stick and I want them to be available anywhere in the system.... like i do...


Then tell me how you change to global PATH variable using a cmd script. You can only use "set PATH=%PATH%:C:\somewhere" ... but this would only work for this single console window. Same with using my U3Helper: you could change the PATH variable and then launch a cmd.exe with these settings. This way you'd have a console window where you have your tools globally available and it wouldn't affect any other application and the changes to the PATH var would be automagically undone on eject.

Cheers,
-mARKUS


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 22nd, 2007, 12:58 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
I was using resource kit utility setx and bellow is myu script that initialise my portabile environment.
Setx is not required as you can do that with WMIC, but setx is faster and easier to use.

The script doesn't add into the PATH if dir is already there.
MM_NN are folders that are to be added into the path.

Code:
@echo off
setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
goto Intro
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: PURPOSE:   Sets UTILS enviroment variables in Machine Registry.
::      Variables can imeddiately be used except in current
::      command window.
::
:: NOTE:   This is must in order for many programs in Utils folder
::      to work correctly.
::
:: Created by M. Milic on WinXP SR1
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:main
   
  set UTILS=%CD%
  set X=%UTILS%\_Console\Rkit\SetX.exe
  if NOT EXIST %X% (
     echo FATAL ERROR: %X% does not exist
     pause
     exit
  )

  :: PATH VARIABLES :::::::::::::::::::::::::::::::::::::::::::::::::::
  :: Will be added to path if not already in it

   set MM_1=%UTILS%\_Console
   set MM_2=%UTILS%\_Console\Rkit
   set MM_3=%UTILS%\_Console\SysInternals
   set MM_4=%UTILS%\_Console\SysInternals\PSTools
   set MM_5=%UTILS%\_Scripts\
   set MM_6=%UTILS%\_Tools

   echo Directories added to PATH:
   set P_ADD=
   for /F "delims==" %%i in ('set MM_') do call :AddDir "!%%i!" P_ADD

   if "%P_ADD%"=="" echo     None
   echo.
  :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


  echo UTILS
  echo     %UTILS%&echo.
  %X% UTILS "%UTILS%" -m

  echo COMMANDER_PATH
  echo     %UTILS%\Total Commander&echo.
  %X% COMMANDER_PATH "%UTILS%\Total Commander" -m

  echo PATH
  echo     %PATH%%P_ADD%&echo.
  %X% PATH "%PATH%%P_ADD%" -m

goto Outro


:Intro
  echo.
  echo Instalation of UTILS enviroment variables.
  echo Press ^<CTRL^>+C to exit or any other key to continue.
  echo.&echo.
  echo WILL BE SET TO:    %CD%&echo.
  pause >nul
  cls
goto main



:Outro
  echo.&echo.&echo.&echo.
  echo  INSTALLATION COMPLETE
  echo  Press any key to exit&echo.
  pause >nul
  echo  Created by M. Milic on WinXP PRO SP1
  ping -n 3 127.0.0.1 >nul
goto :EOF



::======================================================================
:AddDir DIR
::
:: PURPOSE:   Check if DIR is already in the PATH. If it's not,
::      remove trailing spaces and add it to %2 (P_ADD) variable
::
::======================================================================
@echo off&setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
 set FP=%~1

 if "%PATH%"=="!PATH:%FP%=!" endlocal&set %2=!%2!;%FP%&echo    %FP%

goto :EOF


_________________
Image


Report this post
Top
 Profile  
Reply with quote  
PostPosted: April 12th, 2007, 12:15 pm 
Hi mbirth,

thanks a lot for your work. I have downloaded the U3 version of truecrypt from your ftp server and it works fine.

I have even succeeded in modifying the manifest in order to have truecrypt launch with mounting a specific container.

The one thing missing from perfection is to have truecrypt automatically unmount the volume when the U3 eject sequence is processed. This would require truecrypt to be called with certain command line parameters ("/d /q"). I actually found links to a "U3Action.exe" tool which would allow that as part of its "appstop" functionality but I don't know how that would fit in with the U3Helper stuff.

Is there a way to include a user-defined call of an application to be part of U3Helper's appstop skript? Or will you be able to add that functionality some time? That would be really excellent!

Martin


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 12th, 2007, 8:48 pm 
Offline

Joined: October 3rd, 2005, 10:02 pm
Posts: 40
Location: DE, Berlin
majkinetor wrote:
I was using resource kit utility setx and bellow is myu script that initialise my portabile environment.
Setx is not required as you can do that with WMIC, but setx is faster and easier to use.

The script doesn't add into the PATH if dir is already there.
MM_NN are folders that are to be added into the path.


I thought about the whole stuff and I think I don't like messing with the global PATH variable. I'd prefer opening a single command window where the PATH variable is set correctly so that I can use my tools in that cmd.exe-window and the whole system doesn't get affected.


mabu wrote:
Is there a way to include a user-defined call of an application to be part of U3Helper's appstop skript? Or will you be able to add that functionality some time? That would be really excellent!


You could enter your needed call into the <appStop>-section of the manifest.u3i. Or download the U3Helper from the first posting. I updated it today and it now has 2 new options: RunBeforeStop and RunBeforeEject. Take a look at the U3Helperex.ini in that ZIP-file to get the idea. (So just copy the new U3Helper.exe to the TrueCrypt.u3p and add the line
Code:
RunBeforeStop=%U3_HOST_EXEC_PATH%\truecrypt.exe ... /d /q
to the U3Helper.ini there.

Cheers,
-mARKUS


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Auto update ini files
PostPosted: April 13th, 2007, 9:56 am 
Offline

Joined: April 13th, 2007, 9:50 am
Posts: 1
mbirth,

Your application is fantastic. I am using it now to make my applications portable. Thank you!

The only problems I am now experiencing relates to updating the paths to specific directories in the ini files. As far as I can see, using environment variables such as %windir% in ini files does not work.

Do you know of a possible solution to this problem?

Thanks,
Robert


Report this post
Top
 Profile  
Reply with quote  
PostPosted: April 13th, 2007, 2:27 pm 
Offline

Joined: October 3rd, 2005, 10:02 pm
Posts: 40
Location: DE, Berlin
Robertfi wrote:
The only problems I am now experiencing relates to updating the paths to specific directories in the ini files. As far as I can see, using environment variables such as %windir% in ini files does not work.

Do you know of a possible solution to this problem?


I just added this feature to U3Helper. (See ParseIniFiles-section of U3Helperex.ini.) Since my site is down due to maintenance for today, I'll update the file tomorrow. You might try to download it from my Home-FTP here for now. Maybe you can upload your custom U3-packages there, too. This FTP is not 24/7 ... so if it's offline, try again some hours/days later.

Cheers,
-mARKUS


Report this post
Top
 Profile  
Reply with quote  
PostPosted: April 14th, 2007, 9:35 pm 
Offline

Joined: October 30th, 2006, 10:17 pm
Posts: 43
I cannot download your script that you have at the top

http://pphl.birth-online.de/dlcount.php?id=markus.birth-online.de&url=http://files.birth-online.de/ahk_U3Helper.zip

so if you could put up a new link please
thanks in advance.

_________________
Tex© Click here to mail me


Report this post
Top
 Profile  
Reply with quote  
PostPosted: April 14th, 2007, 9:48 pm 
Offline

Joined: October 3rd, 2005, 10:02 pm
Posts: 40
Location: DE, Berlin
Justineo14 wrote:
I cannot download your script that you have at the top

http://pphl.birth-online.de/dlcount.php?id=markus.birth-online.de&url=http://files.birth-online.de/ahk_U3Helper.zip

so if you could put up a new link please
thanks in advance.


Try again. My hoster had some downtime the last 2 days.

Cheers,
-mARKUS


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2007, 9:52 pm 
Offline

Joined: October 30th, 2006, 10:17 pm
Posts: 43
just got it you were right

_________________
Tex© Click here to mail me


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 17th, 2007, 5:16 pm 
Offline

Joined: October 3rd, 2005, 10:02 pm
Posts: 40
Location: DE, Berlin
I updated U3Helper to version 2.0 and from now on, U3Helper works as a separate U3-Application. So you have to install U3Helper in order to use my U3-apps. Those of you who "convert" applications to U3 now have two choices:

- put U3Helper.exe into every package - traditional way, only the U3-package is needed

or

- do not include U3Helper.exe in your package, but require installation of U3Helper separately


I encourage you to use the latter method because of these advantages:

-package size shrinks about 220KiB per package
-if more apps using U3Helper are installed to the stick, U3Helper still is only once
-if there's an update to U3Helper, all you have to do is install the new U3Helper instead of putting it into all of your packages


U3Helper can be downloaded from the first posting.


Cheers,
-mARKUS


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 25th, 2007, 9:13 am 
Offline

Joined: October 3rd, 2005, 10:02 pm
Posts: 40
Location: DE, Berlin
I wrote a tutorial and put it online:

http://vanilla.birth-online.de/discussi ... r-support/


This is the procedure for 90% of all applications.

Cheers,
-mARKUS


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 30th, 2007, 11:06 pm 
Offline

Joined: February 9th, 2007, 12:36 am
Posts: 5
mbirth wrote:
majkinetor wrote:
I think that your script can not handle all situations. For instance, some apps copy things in profile, and Common Data and your script can handle only %U3_HOST_EXEC_PATH%.

Didn't check your script but is the PATH env var handled correctly if dir already exists there and are those paths later removed?


There's the possibility to launch your app using this command:

Code:
<appStart workingdir="%U3_APP_DATA_PATH%" cmd="%U3_HOST_EXEC_PATH%\U3Helper.exe">appstart</appStart>


This way, U3Helper will replace the env vars USERPROFILE, HOMEPATH and APPDATA with paths pointing to %U3_APP_DATA_PATH% so that everything gets instantly stored to the stick instead to the host computer. It's the way, Ceedo works.

Also you can temporarily change the PATH variable - only for that specific application.

Cheers,
-mARKUS

Hi mARKUS,
I've been using your U3Helper to package some apps that I have for networking and system admin; such as DebugView, TcpView and Process Explorer etc.
I am trying to make a package for Regshot (it takes a before and after snapshot of the registry and then does a compare). Now this doesn't use the registry it uses an ini file but it seems to use the %TEMP% variable for it's output path can I use the above (quoted) method to redirect it to %U3_APP_DATA%? and if so could you explain this a little bit more?

Thanks for a great app and I look forward to your reply.

Rochey

P.S. you're welcome to have the packages that I have made. I would upload them to you're ftp but it seems down.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 1st, 2007, 11:10 am 
Offline

Joined: October 3rd, 2005, 10:02 pm
Posts: 40
Location: DE, Berlin
Rochey wrote:
Hi mARKUS,
I've been using your U3Helper to package some apps that I have for networking and system admin; such as DebugView, TcpView and Process Explorer etc.
I am trying to make a package for Regshot (it takes a before and after snapshot of the registry and then does a compare). Now this doesn't use the registry it uses an ini file but it seems to use the %TEMP% variable for it's output path can I use the above (quoted) method to redirect it to %U3_APP_DATA%? and if so could you explain this a little bit more?

Thanks for a great app and I look forward to your reply.

Rochey


Take a look at my U3Helper-Forum there. :-)

Cheers,
-mARKUS


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 4th, 2008, 10:37 pm 
Ok, so you say the environment variables are only accessible when the program is launched by the U3 Launchpad. But some commercial apps (Roboform, probably others, but can't think of them) come as installer .exe's for the U3, so somehow, the external .exe is accessing those variables somehow, at least the drive letter for the U3 drive, since it doesn't ask for a directory to install to, it just automatically does it. Do you have any idea how to replicate this (really I just need the drive letter)? I do believe that U3 has a program called U3PTOEXE that does this (for installer purposes only, repackages the .u3p into a setup .exe), so I guess the question is, does anybody know how those .exe's are accessing those variables and how to implement that into a program that would be run from OUTSIDE the U3 environment (not launched by the U3 launchpad)? Just a thought, since it would open up some interesting options.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 9th, 2008, 8:50 pm 
Offline

Joined: October 3rd, 2005, 10:02 pm
Posts: 40
Location: DE, Berlin
Those installer exe's are almost always created with U3P2EXE. And I'm not sure they need the drive letter. I guess they communicate with the LaunchPad (which should be running in background) give the command to install the unpacked u3p and the LaunchPad does the rest.

But you could simply check all existing drives for a LaunchU3.exe or the existance of a "System" directory with the hidden-attribute. The more complicated way would be parsing the Plug'n'Play-IDs of all disk devices for "U3" ...

Cheers,
-mARKUS


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 30 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: specter333, XX0 and 23 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group