You are here

CCleaner

23 posts / 0 new
Last post
Anonymous (not verified)
CCleaner

I would love to see CCleaner (aka Crap Cleaner) made portable.

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 14 years 6 months ago
Joined: 2006-01-06 21:27
Search before posting.

"If you're not part of the solution, you're part of the precipitate."

Alucard
Offline
Last seen: 9 years 10 months ago
Joined: 2005-12-09 11:29
CCleaner made portable:
Lurking_Biohazard
Lurking_Biohazard's picture
Offline
Last seen: 5 years 7 months ago
Joined: 2006-02-18 18:06
It has been done...

Read more here(or just read this whole thread). Download launcher here & program here.

~Lurk~

~Lurk~

Eric Peterson
Offline
Last seen: 13 years 10 months ago
Joined: 2005-12-09 10:38
Already using it

I have made CCleaner portable using a NSIS launcher. Here is the code. It even allows to use switches for CCleaner by applying the switches to the portableccleaner.exe file.

; This code to to make CCleaner portable by using NSIS, instead of a batch file.
; Code created by Eric Peterson based on code by John T. Haller & Steve Topletz

Outfile "PortableCCleaner.exe"

;=== Runtime Switches
CRCCheck On
WindowIcon Off
SilentInstall Silent
AutoCloseWindow True

Section "Main"

;=== Get any passed parameters
Call GetParameters
Pop $0
RegDll CCHelper.ocx
RegDll ccleaner.dll
RegDll CCListBar.ocx
RegDll CCListView.ocx
RegDll CCSubTimer.dll
RegDll CCSystem.dll
RegDll CCTab.ocx
RegDll CCTreeView.ocx
RegDll lang-1033.dll
ExecWait "ccleaner.exe $0"
Sleep 1000
UnRegDll CCHelper.ocx
UnRegDll ccleaner.dll
UnRegDll CCListBar.ocx
UnRegDll CCListView.ocx
UnRegDll CCSubTimer.dll
UnRegDll CCSystem.dll
UnRegDll CCTab.ocx
UnRegDll CCTreeView.ocx
UnRegDll lang-1033.dll
Quit

SectionEnd

Function "GetParameters"
Push $R0
Push $R1
Push $R2
StrCpy $R0 $CMDLINE 1
StrCpy $R1 '"'
StrCpy $R2 1
StrCmp $R0 '"' loop
StrCpy $R1 ' ' ; we're scanning for a space instead of a quote
loop:
StrCpy $R0 $CMDLINE 1 $R2
StrCmp $R0 $R1 loop2
StrCmp $R0 "\" "" "nofile"
IntOp $2 $R2 + 1
nofile:
;MessageBox MB_OK "r0: $R0"
StrCmp $R0 "" loop2
IntOp $R2 $R2 + 1
Goto loop
loop2:
IntOp $R0 $R2 - $2
IntOp $R0 $R0 - 4
;MessageBox MB_OK "$R2 - $2 = $R0"
StrCpy $R7 $CMDLINE $R0 $2 ; we save the filename
;MessageBox MB_OK "$2"
loop2b:
IntOp $R2 $R2 + 1
StrCpy $R0 $CMDLINE 1 $R2
;MessageBox MB_OK "rr0: $R0"
StrCmp $R0 " " loop2b
StrCpy $R0 $CMDLINE "" $R2
Pop $R2
Pop $R1
Exch $R0
FunctionEnd

nm35
Offline
Last seen: 17 years 6 months ago
Developer
Joined: 2005-12-12 17:13
Interesting... I hadn't

Interesting... I hadn't thought of registering/unregistering DLLs with NSIS.

You should put your code in <pre> tags.

~nm35 {blog} {personal space}

jhi
Offline
Last seen: 17 years 4 months ago
Joined: 2006-03-01 20:34
Nice, I tested this out and

Nice, I tested this out and it works great if you have administrator privledges but not user.

Ashes for Tears
Offline
Last seen: 16 years 5 months ago
Joined: 2006-01-11 08:41
Release: Portable CCleaner v.1.2

Very nice! A much more elegant solution.

Edit: After some review, it occurred to me that despite the lovely uncomplicated-ness of using this single launcher for CCleaner instead of a weird setup of launcher, .bat/.cmd file, and CMDOW, CCleaner was still leaving a registry entry.
So! I decided to see what I could cobble together. If anyone is interested, this is the result:

PortableCCleaner 1.2

Source is in the .zip. I've combined the registering function mentioned above with the locall install check and clean up ability of Deuce's Quick Port Template v.1.1. Later I'll try to see if I can merge some of the things that Klonk has come up with into yet another version. You will have to put it in the same folder as all the .dll's, .ocx's, and the main .exe. Let me know if there are any bugs, 'kay?

On a side note, does anyone know if it is possible to indicate which specific directory to locate the files to register? It's just kinda bothering me to put the launcher beside the exe; I like it a lot better when its one level up, to keep things neat. (I know, that's a little weird. Looks like I'll have to jpoin the OCD club, huh? :D)

Enjoy!

Ashes

------

gjjh25
Offline
Last seen: 1 year 1 month ago
Joined: 2006-04-03 07:38
i have tried to get this to

i have tried to get this to work but nothing hapens? any ideas?

Graham Yates

Ashes for Tears
Offline
Last seen: 16 years 5 months ago
Joined: 2006-01-11 08:41
My program is just a launcher

Not CCleaner itself. Sorry, I forgot to mention that :(. You will need to download CCleaner and install the program. Copy it over to your removeable drive with PortableCCleaner in the same directory as ccleaner.exe, then uninstall from the host machine. The launcher just allows the actual Cleaner program to run from a machine that it is not installed on. It won't run if it can't find ccleaner.exe.

And, before anyone asks ;), if you get a runtime error, it's because you may not have all of the dlls etc. in the same folder. It all has to be in one folder to work.

Ashes

------

gjjh25
Offline
Last seen: 1 year 1 month ago
Joined: 2006-04-03 07:38
Thank you very much for the

Thank you very much for the added bit of advice, this now works perfectly

Graham Yates

SHADOW-XIII
SHADOW-XIII's picture
Offline
Last seen: 15 years 3 weeks ago
Joined: 2005-12-22 11:19
with a BAT file I

with a BAT file I register/undregister DLLs there is one problem:
it will register/unregister files that may be already in the OS, won't it ?

Embrace your dreams

Ashes for Tears
Offline
Last seen: 16 years 5 months ago
Joined: 2006-01-11 08:41
Hmmm....

Yeah...I'll have to look into that...Maybe I can have NSIS check to see if the files are already present on the host machine and give an option to restore associations on program shutdown...Easier, I think, than having individual rules for each and every file. (Way too much room for error there!) Anyone have any thoughts on that? Would this be even possible?

Edit: Initial Findings

In a brief inspection, it seems that all of the ActiveX controls that are registered belong to CCleaner itself; of all of the dll's also appear to be propiety CCleaner files. My conclusion is that this shouldn't really present a problem unless CCleaner is installed on the host machine. In testing my launcher, an installed version of CCleaner was detected, and when I ran the launcher after uninstalling, (which should have unregistered CCleaner's files), I didn't get any notifications. (Meaning no installed version was detected. Plus I try to keep everything running 'uninstalled' if I can help it. :D) Unless someone has a dire (*cough*paraniod*cough,cough* :D) need to run a portable version instead of a local install, I think it's safe.

Ashes

------

SHADOW-XIII
SHADOW-XIII's picture
Offline
Last seen: 15 years 3 weeks ago
Joined: 2005-12-22 11:19
ah yes, that was the point,

ah yes, that was the point, I have non portable version on my pc (I have to, to create portable version) .. so if run on that PC portable ccleaner it breaks normal ccleaner ...

Embrace your dreams

Ashes for Tears
Offline
Last seen: 16 years 5 months ago
Joined: 2006-01-11 08:41
Sorry Shadow...

I mis-understood. I will look into it and see what a can patch together. But I don't have the advantage of being programatical whizzes Wink like the rest of the folks around here :P, so it may take a few days. I've gotten behind a bit because I got sick.

Edit:
Um, forgive me, I seem to be a little tired, but: this would be a problem with the .bat file,yes, but not with the launcher. It should detect a local install. Is it really so bad to use a local copy, or are you just trying to test that it works?

Ashes

------

SHADOW-XIII
SHADOW-XIII's picture
Offline
Last seen: 15 years 3 weeks ago
Joined: 2005-12-22 11:19
this is what I do: - run

this is what I do:

- run PortableCCleaner.exe selecting Portable Settings (from Portable Drive):
this option runs CCleaner from the directory it's in, but do not save settings like window size (it's always have the same size, should remember the size)

- run PortableCCleaner.exe selecting Local Settings (from Portable Drive):
this creates run time 0 error, and breaks my local ccleaner instalation (unregister files) I cannot use anymore local ccleaner until I register the files

so both options have some flaws ...

Embrace your dreams

Spock
Offline
Last seen: 17 years 9 months ago
Joined: 2006-06-11 21:32
Ashes for Tears

I try your CCleaner.v.1.2.nsi but i got a error...

MakeNSIS v2.17 - Copyright 1999-2006 Nullsoft, Inc.

Portions Copyright (C) 1995-1998 Jean-loup Gailly and Mark Adler (zlib).
Portions Copyright (C) 1996-2002 Julian R Seward (bzip2).
Portions Copyright (C) 1999-2003 Igor Pavlov (lzma).

Contributors: nnop@newmail.ru, Ryan Geiss, Andras Varga, Drew Davidson, Peter Windridge, Dave Laundon, Robert Rainwater, Yaroslav Faybishenko, Jeff Doozan, Amir Szekely, Ximon Eighteen, et al.

Processing config:
Processing plugin dlls: "C:\Program\NSIS\Plugins\*.dll"
- AdvSplash::show
- Banner::destroy
- Banner::getWindow
- Banner::show
- BgImage::AddImage
- BgImage::AddText
- BgImage::Clear
- BgImage::Destroy
- BgImage::Redraw
- BgImage::SetBg
- BgImage::SetReturn
- BgImage::Sound
- Dialer::AttemptConnect
- Dialer::AutodialHangup
- Dialer::AutodialOnline
- Dialer::AutodialUnattended
- Dialer::GetConnectedState
- InstallOptions::dialog
- InstallOptions::initDialog
- InstallOptions::show
- LangDLL::LangDialog
- Math::Script
- NSISdl::download
- NSISdl::download_quiet
- Registry::_Close
- Registry::_CopyKey
- Registry::_CopyValue
- Registry::_CreateKey
- Registry::_DeleteKey
- Registry::_DeleteKeyEmpty
- Registry::_DeleteValue
- Registry::_Find
- Registry::_HexToStr
- Registry::_KeyExists
- Registry::_MoveKey
- Registry::_MoveValue
- Registry::_Open
- Registry::_Read
- Registry::_ReadExtra
- Registry::_RestoreKey
- Registry::_SaveKey
- Registry::_StrToHex
- Registry::_Unload
- Registry::_Write
- Registry::_WriteExtra
- Splash::show
- StartMenu::Init
- StartMenu::Select
- StartMenu::Show
- System::Alloc
- System::Call
- System::Copy
- System::Free
- System::Get
- System::Int64Op
- System::Store
- TypeLib::GetLibVersion
- TypeLib::Register
- TypeLib::UnRegister
- UserInfo::GetAccountType
- UserInfo::GetName
- VPatch::vpatchfile
- nsExec::Exec
- nsExec::ExecToLog
- nsExec::ExecToStack

!define: "MUI_INSERT_NSISCONF"=""

Changing directory to: "D:\PortableCCleaner"

Processing script file: "D:\PortableCCleaner\CCleaner.v.1.2.nsi"
!define: "PROGRAMMER"="Celeste Desmukes"
!define: "LAUNCHERVERSION"="0.1.0.0"
!define: "APPNAME"="CCleaner"
!define: "SNAME"="PortableCCleaner"
!define: "EXE"="$EXEDIR\ccleaner.exe"
!define: "CURRENT"="$EXEDIR\Settings\Current.reg"
!define: "REGFILE"="$EXEDIR\Settings\Settings.reg"
!define: "REGKEY"="HKEY_CURRENT_USER\Software\VB and VBA Program Settings\CCleaner"
!include: "C:\Program\NSIS\Include\Registry.nsh"
!define: "registry::Open"="!insertmacro registry::Open"
!define: "registry::Find"="!insertmacro registry::Find"
!define: "registry::Close"="!insertmacro registry::Close"
!define: "registry::KeyExists"="!insertmacro registry::KeyExists"
!define: "registry::Read"="!insertmacro registry::Read"
!define: "registry::Write"="!insertmacro registry::Write"
!define: "registry::ReadExtra"="!insertmacro registry::ReadExtra"
!define: "registry::WriteExtra"="!insertmacro registry::WriteExtra"
!define: "registry::CreateKey"="!insertmacro registry::CreateKey"
!define: "registry::DeleteValue"="!insertmacro registry::DeleteValue"
!define: "registry::DeleteKey"="!insertmacro registry::DeleteKey"
!define: "registry::DeleteKeyEmpty"="!insertmacro registry::DeleteKeyEmpty"
!define: "registry::CopyValue"="!insertmacro registry::CopyValue"
!define: "registry::MoveValue"="!insertmacro registry::MoveValue"
!define: "registry::CopyKey"="!insertmacro registry::CopyKey"
!define: "registry::MoveKey"="!insertmacro registry::MoveKey"
!define: "registry::SaveKey"="!insertmacro registry::SaveKey"
!define: "registry::RestoreKey"="!insertmacro registry::RestoreKey"
!define: "registry::StrToHex"="!insertmacro registry::StrToHex"
!define: "registry::HexToStr"="!insertmacro registry::HexToStr"
!define: "registry::Unload"="!insertmacro registry::Unload"
!include: closed: "C:\Program\NSIS\Include\Registry.nsh"
CRCCheck: on
WindowIcon: off
SilentInstall: silent
AutoCloseWindow: true
XPStyle: on
Name: "Portable CCleaner"
Icon: "PortableCCleaner.ico"
Caption: "Portable CCleaner - 0.1.0.0"
OutFile: "PortableCCleaner.exe"
LoadLanguageFile: C:\Program\NSIS\Contrib\Language files\English.nlf
VIAddVersionKey: "ProductName" "Portable CCleaner"
VIAddVersionKey: "LegalCopyright" "© Celeste Desmukes 2006"
VIAddVersionKey: "FileDescription" "Allows portability of CCleaner."
VIAddVersionKey: "FileVersion" "0.1.0.0"
Section: "Main"
!insertmacro: registry::KeyExists
File: "Registry.dll"->"$PLUGINSDIR\Registry.dll" [compress] 8168/15360 bytes
Plugin Command: _KeyExists HKEY_CURRENT_USER\Software\VB and VBA Program Settings\CCleaner
Pop: $R0
!insertmacro: end of registry::KeyExists
StrCmp "$R0" "0" equal=0, nonequal=RunPortable
Invalid command: Messagebox::show
Error in script "D:\PortableCCleaner\CCleaner.v.1.2.nsi" on line 69 -- aborting creation process

Do you know why?

------------------------------------------------------------------------------
I got it to work with MakeNSIS v2.0 but not with MakeNSIS v2.17

Ashes for Tears
Offline
Last seen: 16 years 5 months ago
Joined: 2006-01-11 08:41
I think...

that either something may be wrong with your message box plugin, or it may not even be there. Download the message box plugin and see if that fixes the error.

Ashes

------

jhi
Offline
Last seen: 17 years 4 months ago
Joined: 2006-03-01 20:34
You're amazing, thank you so

You're amazing, thank you so much. Do you know if there is any way to get PortableCC working when you are logged in as user? On my Win2k machine I have to change user privledges to get to work. Perhaps it will always be an impossibilty? -Jeff

Ashes for Tears
Offline
Last seen: 16 years 5 months ago
Joined: 2006-01-11 08:41
Well...

Maybe. I was thinking about patching Aaron Margosis' MakeMeAdmin command into the launcher, though it would be crude at first. You would need to know the admin logon and password to make this option work. This wouldn't be of much help in an internet cafe or a public terminal station, unless you could somehow acquire these (though I wouldn't recomend doing that, really).

Ashes

------

SHADOW-XIII
SHADOW-XIII's picture
Offline
Last seen: 15 years 3 weeks ago
Joined: 2005-12-22 11:19
use search Luke :/ - first

use search Luke :/
- first since it's not OpenSource it won't get a launcher here
- second, there's a sample bat file how to run ccleaner from usb

Embrace your dreams

Lurking_Biohazard
Lurking_Biohazard's picture
Offline
Last seen: 5 years 7 months ago
Joined: 2006-02-18 18:06
Huh?

Who are you talking to? Ashes made a launcher,as did someone else at another site. No, it might never be hosted here, but doesn't change the fact that it exists.

~Lurk~

~Lurk~

SHADOW-XIII
SHADOW-XIII's picture
Offline
Last seen: 15 years 3 weeks ago
Joined: 2005-12-22 11:19
I got problems with my

I got problems with my connection and it opened only page containing 1st post
X_x - so I replied to it without checking the date - sorry

Embrace your dreams

Topic locked