 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
TomXIII
Joined: 14 Apr 2009 Posts: 182
|
Posted: Sun Apr 19, 2009 9:58 am Post subject: Fully portable (discret) version of AutoHotkey |
|
|
Hi everybody!
I'm trying to code a fully portable (discret) version of AutoHotkey at every levels I can:
-Regedit (not so easy!)
-Temp
-RecentDocs
-RecycleBin
-SearchAssistant
...
I'm making a portable package with minimal features like:
-A toolwindow launcher with Splashscreen (like portableApps) and a Ahk RegKeys deleter
-AutoHotkey (zip) without AutoScriptWriter, Extras, AutoHotkey.htm and license.txt
-Minimal version of Scite4AutoHotkey v2
Like I said earlier, it's not so easy because there are many keys to detect for the regedit:
-When you Open/Save a script: A key is created in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU
-When you use a program in the package: A key is created in RegDelete, HKEY_CURRENT_USER\Software\Microsoft\Windows\ShellNoRoam\MUICache
and there are also:
HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\
HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Applets\Regedit, LastKey
HKEY_CURRENT_USER, Software\Classes\Applications\AutoHotkey.exe
HKEY_LOCAL_MACHINE, SOFTWARE\Classes\.ahk
HKEY_LOCAL_MACHINE, SOFTWARE\Classes\ahk_auto_file
and so on...
I use RegShot to quickly find modifications but not very efficient!
If some people can help me?! |
|
| Back to top |
|
 |
Vavo Guest
|
Posted: Sun Apr 19, 2009 10:19 am Post subject: |
|
|
What about using just a "notepad"-style portable text editor and ahk2exe compiler?
I rarely start the ahk program...nor ahk files are associated with it.
Notepad++ is my choice, it supports ahk tags (add colors, formatting). Also copy the help file That's all |
|
| Back to top |
|
 |
garry
Joined: 19 Apr 2005 Posts: 2212 Location: switzerland
|
Posted: Sun Apr 19, 2009 11:07 am Post subject: |
|
|
I´m not sure, maybe copy Autohotkey-folder to USB and then start a batch
xy.bat
autohotkey.exe xy.ahk (?) |
|
| Back to top |
|
 |
Tuncay
Joined: 07 Nov 2006 Posts: 1886 Location: Germany
|
Posted: Sun Apr 19, 2009 11:48 am Post subject: |
|
|
AutoHotkey is already portable. I am using it for years on my USB sticks (with source ahk files). For that case, I had written a very small compiled program with FreeBASIC. It launched the script with the interpreter of choice. If you like, you can try this: Portable ScriptStarter - A simple and fast file launcher
I am not using it anymore. Compared to batch files, it does not show the command window, which was the main reason to develop this. |
|
| Back to top |
|
 |
Guest
|
Posted: Sun Apr 19, 2009 11:51 am Post subject: |
|
|
| Quote: | | -AutoHotkey (zip) without AutoScriptWriter, Extras, AutoHotkey.htm and license.txt |
I'd compare scite4ahk vs Notepad2 (for ahk) regarding its size if it should bundled with ahk. What about to simply link both for an optional download?. |
|
| Back to top |
|
 |
TomXIII
Joined: 14 Apr 2009 Posts: 182
|
Posted: Sun Apr 19, 2009 5:21 pm Post subject: |
|
|
| Quote: | | I'd compare scite4ahk vs Notepad2 (for ahk) regarding its size if it should bundled with ahk. What about to simply link both for an optional download?. |
Sorry, but I didn't understand!
For the bundle, I'm trying to have a light package less than 5Mo.
Notepad++ is a good choice but too general. I use less than 50% of its capacity.
@Tuncay: I know Ahk is already portable but not "discret": no Regkey traces, files traces... (like spy movies, lol)
It's just a project, not really important.
I wanted to make my own (full) portable app and I succeed but the main job was made by Chris. |
|
| Back to top |
|
 |
BoBoł Guest
|
Posted: Sun Apr 19, 2009 7:20 pm Post subject: |
|
|
[Notepad++] <- -> [Notepad2] [Notepad2 for AHK] [scite4ahk v2]
In ancient times I thought about to have a Notepad2 realease which only supports AHK+INI files. Kind of "shrinked-to-death-AHK-core-editor"
You could ask Zach Thibeau (btw, isn't that a french name?) to compile such a N2 version for you. |
|
| Back to top |
|
 |
ScottMattes
Joined: 21 May 2007 Posts: 173 Location: USA
|
|
| Back to top |
|
 |
TomXIII
Joined: 14 Apr 2009 Posts: 182
|
Posted: Wed Apr 22, 2009 8:15 am Post subject: |
|
|
Hi!
I've tested all of your scripts editors and regkeys are even created. I realized that its depends on Window settings for Open/Save dialog boxes, FileExts...
So, I decided to code a program that delete traces.
Issue: It will be for portable use because it will delete ALL the Ahk regkeys and should create bugs for an installed version.
I will give you the source next time! |
|
| Back to top |
|
 |
zipper Guest
|
|
| Back to top |
|
 |
pajenn
Joined: 07 Feb 2009 Posts: 384
|
Posted: Wed Apr 22, 2009 2:02 pm Post subject: Re: Fully portable (discret) version of AutoHotkey |
|
|
| TomXIII wrote: | Hi everybody!
I'm trying to code a fully portable (discret) version of AutoHotkey at every levels I can:
-Regedit (not so easy!)
<snip>
I use RegShot to quickly find modifications but not very efficient!
If some people can help me?! |
Take a look at JauntePE. It's an alpha release for making apps portable. Now alpha means it's even less ready than the typical beta release, but as I recall, the examples included making Windows regedit portable. Maybe that could be of use to you while you until your AHK script is ready.
link: http://www.portablefreeware.com/?id=1452
For RegShot v1.8.2, I use it to take snapshot before and after installing apps. My ini settings:
| Code: | [Setup]
Flag=3
ExtDir=C:\WINDOWS;C:\Documents and Settings;C:\Program Files\Common Files;C:\Program Files\InstallShield Installation Information;
OutDir=Z:\_Backups\RegShots
UseLongRegHead=0
[SkipRegKey]
0=
1=
2=
3=
[SkipDir]
0=Rising
1=OnlineArmor
2=Recent
3=
|
My SkipDirs are just my antivirus (Rising) and firewall (OnlineArmor). I removed most of the SkipRegKeys and SkipDirs because I now use AHK to clean up my RegShot output. Here's my RegShot Cleaning script (uses Sean's ShellFolder at one point). It may be of use to you for cleaning up the noise from your own RegShot logs, though please note that my is still in development and has bugs - for example, I need to get it to ignore spaces when comparing reg values or otherwise make the comparison format uniform between data AHK retrieves and what's in the RegShot log.
| Code: | #SingleInstance, Force
SetFormat, IntegerFast, Hex
AutoTrim, Off
#IfWinActive ahk_class CabinetWClass
APPSKEY & LBUTTON::
SF := ShellFolder()
StringSplit,SFV, SF, `r`n
filename:= RegExReplace( SFV2, "Focus: " )
StringTrimRight, filename, filename, 4
SF:=SFV:=
FileRead, RegShot, %filename%.txt
Sleep, 500
matcher := 1, section := ""
If not ErrorLevel ; Successfully loaded.
{ Loop ;remove empty lines
{ StringReplace,RegShot,RegShot, `r`n`r`n, `r`n, UseErrorLevel
if ErrorLevel = 0 ; No more replacements needed.
break
}
Sleep, 100 ;split file into sections
Loop, parse, RegShot, `n, `r, %A_Space%%A_Tab%
{ ;Add entries to remove below
If A_LoopField Contains ntuser.dat
,Mozilla\Firefox\Profiles\k2qzu7cz.default
,Cookies\index.dat
,%A_AppData%\Microsoft\HTML Help\hh.dat
,%A_AppData%\Scooter Software\Beyond Compare 3
,Local Settings\Application Data\Bill2_Software
,Local Settings\Application Data\Microsoft\Windows\UsrClass.dat.LOG
,Local Settings\Application Data\Mozilla\Firefox\Profiles\k2qzu7cz.default
,Local Settings\Application Data\Search and Replace\EXPLORER.SRS
,Local Settings\History\History.IE5
,Local Settings\Temporary Internet Files\Content.IE5\desktop.ini
,Local Settings\Temporary Internet Files\Content.IE5\index.dat
,Local Settings\Temporary Internet Files\desktop.ini
,%A_WinDir%\Debug\PASSWD.LOG
,%A_WinDir%\erdnt
,%A_WinDir%\Prefetch
,%A_WinDir%\Rav.ini
,%A_WinDir%\Sandboxie.ini
,%A_WinDir%\Security\edb.chk
,%A_WinDir%\Security\edb.log
,%A_WinDir%\system32\CatRoot2
,%A_WinDir%\system32\config\AppEvent.Evt
,%A_WinDir%\system32\config\default
,%A_WinDir%\system32\config\SecEvent.Evt
,%A_WinDir%\system32\config\sam
,%A_WinDir%\system32\config\security
,%A_WinDir%\system32\config\software
,%A_WinDir%\system32\config\SysEvent.Evt
,%A_WinDir%\system32\config\system
,%A_WinDir%\system32\wbem
,%A_WinDir%\Tasks\Clean System Memory.job
,%A_WinDir%\wiadebug.log
,%A_WinDir%\wiaservc.log
,%A_WinDir%\WindowsUpdate.log
,HKLM\HARDWARE\RESOURCEMAP
,HKLM\SOFTWARE\Microsoft\Cryptography\RNG
,HKLM\SOFTWARE\Microsoft\EventSystem
,HKLM\SOFTWARE\Microsoft\SchedulingAgent
,HKLM\SOFTWARE\Microsoft\UPnP Device Host
,HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\State
,HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData
,HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RecentDocs
,HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Prefetcher
,HKLM\SOFTWARE\Microsoft\WZCSVC
,HKLM\SYSTEM\ControlSet001\Control\Session Manager
,HKLM\SYSTEM\ControlSet001\Enum
,HKLM\SYSTEM\ControlSet002\Control\Session Manager
,HKLM\SYSTEM\ControlSet002\Enum
,HKLM\SYSTEM\ControlSet003\Control\Session Manager
,HKLM\SYSTEM\ControlSet003\Enum
,HKLM\SYSTEM\CurrentControlSet\Control\DeviceClasses
,HKLM\SYSTEM\CurrentControlSet\Control\ServiceCurrent
,HKLM\SYSTEM\CurrentControlSet\Control\Session Manager
,HKLM\SYSTEM\CurrentControlSet\Enum
,SessionInformation\ProgramCount
,Software\LopeSoft\FileMenu Tools
,Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\DefaultIcon
,Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32
,Software\Microsoft\Windows\CurrentVersion\Explorer\Discardable\PostSetup\Component Categories
,Software\Microsoft\Windows\CurrentVersion\Explorer\Discardable\PostSetup\ShellNew
,Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts
,Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder
,Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs
,Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU
,Software\Microsoft\Windows\CurrentVersion\Explorer\StartPage
,Software\Microsoft\Windows\CurrentVersion\Explorer\StreamMRU
,Software\Microsoft\Windows\CurrentVersion\Explorer\Streams
,Software\Microsoft\Windows\CurrentVersion\Explorer\TrayNotify
,Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist
,Software\Microsoft\Windows\CurrentVersion\Ext\Stats
,Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections
,Software\Microsoft\Windows\CurrentVersion\Shell Extensions
,Software\Microsoft\Windows\Shell\Bags
,Software\Microsoft\Windows\ShellNoRoam\BagMRU
,Software\Microsoft\Windows\ShellNoRoam\Bags
,Software\Microsoft\Windows\ShellNoRoam\MUICache
,Software\WinRAR
Continue
Else If A_LoopField = ----------------------------------
matcher*= -1
Else If matcher = -1
{ colon:= InStr(A_LoopField, ":" ) - 1
section:= SubStr(A_LoopField, 1, colon)
StringReplace, section, section, [attributes?]%A_Space%
}
Else
{ If (section = "Folders added") && FileExist(A_LoopField)
FileAppend, %A_LoopField%`n, %filename%_fAdded.txt
If (section = "Files added") && FileExist(A_LoopField)
FileAppend, %A_LoopField%`n, %filename%_fAdded.txt
If (section = "Files modified") && FileExist(A_LoopField)
FileAppend, %A_LoopField%%A_Space%(modified)`n, %filename%_fAdded.txt
If (section = "Keys added")
{ keycount:= 0, slash1:= InStr(A_LoopField, "\" )
root:= SubStr(A_LoopField, 1, slash1-1), sub:= SubStr(A_LoopField, slash1+1)
Loop %root%, %sub%, 1, 1 ; checks if key exists
keycount++
If (keycount > 0)
FileAppend, %root%\%sub%`n, %filename%_rAdded.txt
}
If (section = "Values added")
{ slash1:= InStr(A_LoopField, "\" ), colon1:= InStr(A_LoopField, ":" )
temp:= SubStr(A_LoopField, 1, colon1), slash2:= InStr(temp,"\",false,0)
StringLeft, root, A_LoopField, % slash1-1
StringMid, sub, A_LoopField, slash1+1, slash2-slash1-1
StringMid, vname, A_LoopField, slash2+1, colon1-slash2-1
StringRight, val, A_LoopField, % StrLen(A_LoopField)-colon1-1
If InStr(val, """", false, 1) = 1 && InStr(val, """", false, 0) = StrLen(val)
StringMid, val, val, 2, % StrLen(val)-2 ;remove excess "
RegRead, valNow, %root%, %sub%, %vname%
If ErrorLevel != 1 ;if no problem
{ If ( val = valNow )
FileAppend, %root%\%sub%\%vname%:%A_Space%%val%`n, %filename%_rAdded.txt
else
FileAppend, %root%\%sub%\%vname%:%A_Space%%val%%A_Space%(old)`n%root%\%sub%\%vname%:%A_Space%%valNow%%A_Space%(new)`n, %filename%_rAdded.txt
}
}
If (section = "Values modified")
{ slash1:= InStr(A_LoopField, "\" ), colon1:= InStr(A_LoopField, ":" )
temp:= SubStr(A_LoopField, 1, colon1), slash2:= InStr(temp,"\",false,0)
StringReplace, section, section, [attributes?]%A_Space%
StringLeft, root, A_LoopField, % slash1-1
StringMid, sub, A_LoopField, slash1+1, % slash2-slash1-1
StringMid, vname, A_LoopField, slash2+1, % colon1-slash2-1
StringRight, val, A_LoopField, % StrLen(A_LoopField)-colon1-1
If InStr(val, """", false, 1) = 1 && InStr(val, """", false, 0) = StrLen(val)
StringMid, val, val, 2, % StrLen(val)-2 ;remove excess "
RegRead, valNow, %root%, %sub%, %vname%
If ErrorLevel != 1 ;if no problem
{ If (val = valNow)
FileAppend, %root%\%sub%\%vname%:%A_Space%%val%%A_Space%(modified)`n, %filename%_rAdded.txt
else
FileAppend, %root%\%sub%\%vname%:%A_Space%%val%%A_Space%(mod_old)`n%root%\%sub%\%vname%:%A_Space%%valNow%%A_Space%(mod_new)`n, %filename%_rAdded.txt
}
}
}
}
}
Sleep, 100
If FileExist(filename . "_fAdded.txt")
{
FileRead, list, %filename%_fAdded.txt
list := RegExReplace(list, "(.*?);(\d+)(\n|$)", "$2;$1$3") ; swap number with path
Sort, list ; sort list in reverse numeric order
list := RegExReplace(list, "(\d+);(.*?)(\n|$)", "$2;$1$3") ; swap back
FileDelete, %filename%_fAdded.txt
FileAppend, %list%, %filename%_fAdded.txt
}
Sleep, 100
If FileExist(filename . "_rAdded.txt")
{
FileRead, list, %filename%_rAdded.txt
list := RegExReplace(list, "(.*?);(\d+)(\n|$)", "$2;$1$3") ; swap number with path
Sort, list ; sort list in reverse numeric order
list := RegExReplace(list, "(\d+);(.*?)(\n|$)", "$2;$1$3") ; swap back
FileDelete, %filename%_rAdded.txt
FileAppend, %list%, %filename%_rAdded.txt
list = ; Free the memory.
}
SoundPlay *-1
TrayTip, RegShot cleaning finished.,File log saved to %filename%_fAdded.txt`nRegistry log saved to %filename%_rAdded.txt, 15, 1
;return
/*
"modified" files were present at the installation, but modified at the time.
reg values without label were added. if the value had changed since it was
recorded in the install log, the "old" version contains logged value and
the "new" value contains the current value.
reg entries "modified" weren't added and haven't changed since install log.
"mod_old" is the old "modified" value of a reg entry.
"mod_new" is the current value of entry that had been modified.
*/
SetFormat, IntegerFast, Decimal
Sleep, 1000
MsgBox, 4,, Press Yes to TreeView Files/Folders, No for Registry Keys/Values.
IfMsgBox Yes
logfile:= filename . "_fAdded.txt"
else
logfile:= filename . "_rAdded.txt"
If !FileExist(logfile)
{
MsgBox, No %filename% entries found:`nEither they've already been uninstalled and removed, or an error occurred.
}
TreeViewWidth := 500
Gui +Resize
Gui, Add, TreeView,r30 w%TreeViewWidth%
AddBranchesToTree(logfile) ; list needs to be sorted
Gui, Show ; Show the window and its TreeView.
Return
GuiEscape:
GuiClose: ; Exit the script when the user closes the TreeView's GUI window.
ExitApp
AddBranchesToTree(filelist)
{
level = 0
parent0 = 0
loop, read, % filelist
{
if a_loopreadline =
continue
stringsplit, parts, a_loopreadline, \ ; drive + folders ( + file)
if level = 0 ; first record, insert all parts
{
gosub build_tree
continue
}
ifinstring, a_loopreadline, %prev_file% ; sub folders or files
{
gosub build_tree
continue
}
; other drive or folder
line := a_loopreadline
if (parts0 > level) ; ignore parts > level
loop, % parts0 - level - 1
StringLeft, line, line, % InStr(line,"\",false,0)
else
level := parts0 ; set level to no of parts
loop, % level
{
StringLeft, line, line, % InStr(line,"\",false,0)-1
level--
if level = 0 ; other drive
{
prev_file =
bs =
}
else ; find corresponding level
{
prev_file := file%level%
ifnotinstring, line, %prev_file%
continue
if level = 0
level++
}
gosub build_tree
break
}
}
return
build_tree:
loop, % parts0 - level
{
prev_parent = parent%level%
level++
parent%level% := tv_add(parts%level%, %prev_parent%, "expand")
if level <> 1
bs = \
file%level% := prev_file bs parts%level%
prev_file := file%level%
}
return
}
|
_________________ Hardware: 1.8 GHz laptop with 4 GB ram, Windows XP/SP3
Software: Prevx, Privatefirewall, KeyScrambler. |
|
| Back to top |
|
 |
m^2
Joined: 28 Feb 2008 Posts: 100 Location: Krk, PL
|
Posted: Wed Apr 22, 2009 2:33 pm Post subject: Re: Fully portable (discret) version of AutoHotkey |
|
|
| pajenn wrote: | | TomXIII wrote: | Hi everybody!
I'm trying to code a fully portable (discret) version of AutoHotkey at every levels I can:
-Regedit (not so easy!)
<snip>
I use RegShot to quickly find modifications but not very efficient!
If some people can help me?! |
Take a look at JauntePE. It's an alpha release for making apps portable. Now alpha means it's even less ready than the typical beta release, but as I recall, the examples included making Windows regedit portable. Maybe that could be of use to you while you until your AHK script is ready.
link: http://www.portablefreeware.com/?id=1452
|
I wouldn't recommend it.
JPE has a huge potential, but really isn't ready to be used. And it's not sure whether it ever will.
And there are licensing issues, Jauntized AHK couldn't be distributed because AHK is GPLed.
How about patching AHK sources not to write unnecessary reg entries? If such patch could be included in the official distro, this would be definitely the best solution. _________________
| Benjamin Franklin wrote: | | Anyone who trades liberty for security deserves neither liberty nor security. |
|
|
| Back to top |
|
 |
TomXIII
Joined: 14 Apr 2009 Posts: 182
|
Posted: Wed Apr 22, 2009 9:46 pm Post subject: |
|
|
| Quote: | | AHK's plain zip-download shouldn't create any reg-entries, right? |
AutoHotkey.exe itself, doesn't create regkeys but Windows does!
The most common regkeys are:
-FileExts: created when you choose an associated program for extension (.ahk)
-Open/SaveMRU: created when you want to Open/Save a file
-MUICache: created for last openned files (different to RecentDocs!)
@Pajenn: I even don't know (?!) that you can configure RegShot like this!
I will test this week-end.
For JauntePE, I downloaded it. I searched tuto for creating portable apps but nothing for me. I also have error when I want to launch Exe. I know virtualisation solution and its a very good thing. I used ThinApp but its a software and I don't want to pay it.
@m^2: | Quote: | | How about patching AHK sources not to write unnecessary reg entries? If such patch could be included in the official distro, this would be definitely the best solution. |
It would be great! But as I already said regkeys are created by Windows!
I keep trying...!!!
For now, here is my pack:
http://www.yourfilehost.com/media.php?cat=other&file=NoTraces.7z
It contains source, icon & compiled version. Entirely created by me!
Don't use it if you already have an installed version!!!
It works with 3 keywords: ahk, autohotkey and scite ('cause I use Scite4Ahk). The script scan regkeys and if a key contain one of keyword, it delete the keys. In the end, all the deleted regkeys are written to a log file. The script also scan RecentDocs.
I'm waiting your comments and ameliorations(?!)
PS: I'm really sorry for my Inglich! |
|
| Back to top |
|
 |
m^2
Joined: 28 Feb 2008 Posts: 100 Location: Krk, PL
|
Posted: Wed Apr 22, 2009 10:25 pm Post subject: |
|
|
| TomXIII wrote: | @m^2: | Quote: | | How about patching AHK sources not to write unnecessary reg entries? If such patch could be included in the official distro, this would be definitely the best solution. |
It would be great! But as I already said regkeys are created by Windows! |
Ah, sorry, I only skimmed through the topic and saw that you mention associations (which are created by AHK, not Windows) and missed the other things. But you can still modify AHK code to clean them up on exit. _________________
| Benjamin Franklin wrote: | | Anyone who trades liberty for security deserves neither liberty nor security. |
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|