Jump to content

How to edit a Uninstaller


Recommended Posts

After installing with WPi (with admin rights) and adding users accounts to it all of the software installed in C:\Documents and Settings\administrator\Start Menu\Programs are no longer visual in my new account in start\all programs.

I made a bath file that runs after WPI has done it's job and it copies al folders in C:\Documents and Settings\administrator\Start Menu\Programs to C:\Documents and Settings\All Users\Start Menu\Programs so they are visual now for all accounts that wil be made after installing with WPI.

Is there a way to edit the original uninstaller (and overwrite the uninstaller located in Program Files with a winrar sfx) so when unistalling the program, the folders I have added in C:\Documents and Settings\All Users\Start Menu\Programs wil be deleted to?

Please someone help me ! :thumbup

Edited by Pliek
Link to comment
Share on other sites


Maybe this not exactly what you want, but it surely does its job.

Here is the idea: create an exe that includes the original unisntaller AND a executes a delete command on your folder (in the all programs menu).

The first method: Autoit script

FileInstall("Uninstaller.exe",@TempDir)
RunWait(@TempDir & "\Uninstaller.exe")
FileDelete(@TempDir & "\Uninstaller.exe")
FileDelete(@StartMenuCommonDir & "...")
FileDelete(@StartMenuCommonDir & "...")
FileDelete(@StartMenuCommonDir & "...")
;you can also remove full dir by executing a _RunDos("rd folder"), but you have to include the "Process.au3" library
...

I'm writing this from memory so please check the sintax.

The second method: selfextrating archive

I'm not going to explain in detail how to do such a thing because I personally prefer the first method, but let's say the archive executes install.cmd which launches the original uninstaller and deletes the files after that.

Post back any question if something is not clearly explained.

Edited by sadicq
Link to comment
Share on other sites

Thanks for your fast reply.

Yesterday I have tried to test these two methods but always ended up with the file that runs and couldn't delete itself.

And when I make a copy of the originall uninstaller ......the starting path of the uninstaller wil be where that uninstaller is placed in, so no uninstall of the program (it does deletes itself after execute, including the folder I put it in, so that's a start).

For example I made a folder Newsleecher with the originall uninstaller in C:\Documents and Settings\All Users\Start Menu\Programs:

After the execution the folder is gone, but the program didn't uninstall at all ? :}

When I replace the originall Uninstaller.exe with Uninstaller.Ink the program unistalls oke, but the folder is not removed.

AutoIt scrips I don't know how to use, tried .....but I dont understand the scrip and it gives errors at many lines.

So I started with winrar sfx but like I said above the sfx file couldn't delete ítself after running, and don't know how to execute a delete.cmd after extracting ( maybe stil it won't remove itself because the delete.cmd must be in the same folder C:\Documents and Settings\All Users\Start Menu\Programs\Newsleecher\).

Sorry maybe I come over like a noob, :whistle: but solving this problem is very important for me.

Do I need a program like "Wise for Windows Installer" to edit the installer ??

Edited by Pliek
Link to comment
Share on other sites

Well, I had no succes with a selfextarcting archive, but as you suggested, you can try to edit the uninstaller with such an editor (I don't know if this will work because I don't have any editor installed atm), although I seriously doubt it will work. We are talking about .exe and I can't say for sure if it will or it will not fail...

The only working solution I have is this:

Create a script that accepts command-line paramters and, using the data you pass to it with those pamateres, delete the folder you want and run the original uninstaller.

Put the compiled script in system32 and leave it there.

now edit all your shortcuts to the orgininal uninstaller so they will point to something like

script.exe /i foldertodelete /o originaluninstaller

also edit the corresponding entry in the registry so the add/remove programs link points to the same thing.

if you can't find another method or you think this is really going to fit your needs, post back and I will create the script for you (I've something similar in autoit and I think I can copy/paste some code).

Edited by sadicq
Link to comment
Share on other sites

I've tried different things, but no result. :}

You said:

if you can't find another method or you think this is really going to fit your needs, post back and I will create the script for you (I've something similar in autoit and I think I can copy/paste some code).

Please do this, and I hope it fits my needs.

thanks anyway for your time. :thumbup

Edited by Pliek
Link to comment
Share on other sites

I'm so sorry I can't tell you ... I forgot about this thread :blushing:

Anyway, later is better than never, so here it is: the program I promised I'll make (it took me less than 5 minutes :whistle: )

Usage:

put this app in the system32 folder. Then make all your uninstaller point to

%windir%\system32\thisprogram.exe /f folder_to_delete /u original_uninstaller

note that you have to use absolute paths.

The code (as simple as it can be):

#include "Process.au3"
#NoTrayIcon
Opt("MustDeclarevars",1)
Global $folder_to_delete, $uninstaller, $k
If $CmdLine[0] <> 0 Then
For $k = 1 To $CmdLine[0] Step 1
If $CmdLine[$k] == "/f" And $k < $CmdLine[0] Then
$folder_to_delete = $CmdLine[$k + 1]
ElseIf $CmdLine[$k] == "/u" And $k < $CmdLine[0] Then
$uninstaller = $CmdLine[$k + 1]
EndIf
Next
Run($uninstaller)
_RunDOS("rd /s /q """ & $folder_to_delete & """")
EndIf

EDIT: cannot add the attachement. here is the download link.

Btw, to edit an "Add/Remove program entry" look in

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ProgramName]

for the

UninstallString

entry and modify it to suit your needs. For some programs, the ProgramName can be actually a string like

{E9787678-1033-0000-8E67-000000000001}

.

Just look in the registry in the uninstall key ...

Edited by sadicq
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...