PDA

View Full Version : Files not uninstalled



Chris
09-07-2013, 12:14 PM
Using SB8 I have very simple Install that creates a folder, installs two files into it (an EXE and a ICO -- neither needs registering). And adds a desktop shortcut.

At the start of the install script I have CREATE UNINSTALL, and at the end I CLOSE UNINSTALL.

The install works perfectly, the program runs fine from the shortcut.

But when I run the UNINSTALL it removes the desktop shortcut but does not remove the EXE and ICO files, and does not remove the folder I created.
(Yes, I ticked the REMOVE ON UNINSTALL box :-)

What am I doing wrong?

linder
09-08-2013, 02:47 AM
Hi Chris,

If you are interested, please send your .sb8 project file (and if you are using a custom uninstall, the uninstall.sbi) to support [at] lindersoft [dot] com and we can tell you what you are doing wrong.

BTW, why do you have to "manipulate" the standard uninstall handling? By default, SetupBuilder creates the uninstall logic for you. I think this causes your problem because you instruct the installer to not log the two files :)

Friedrich

Chris
09-08-2013, 06:31 AM
I thought I was doing exactly that (just using default uninstall). I added the CLOSE INSTALLATION LOG at the end in case that was the problem but it made no difference, so I have removed it again.

Here's my Install script. (I removed blank lines etc)


[ Initialize Setup ]
! --- Define commonly used constants ---
#include script "Common Definitions.sbi"
Define Wizard Dialog "WELCOME" (Welcome)
Loop Wizard (Abort Dialog Active)
End
Set Variable %_SB_INSTALLDIR% to "C:\ABC6\TEMP_UTIL"
Set Variable %_SB_BACKUPDIR% to "%_SB_INSTALLDIR%\SB8_BACKUP"

[ User Interface ]

! Create installation .log
Create Installation App & Log "%_SB_INSTALLDIR%\Uninst_ABCTempUtil.log" [Overwrite Existing Uninstall Application]

[ Create Folders ]

[ Install Files ]
Install File "C:\ABC6\work\Mike Format Tenants\FormatSiteNbrs.exe" to "%_SB_INSTALLDIR%\FormatSiteNbrs.exe" [Feat:Always Install] [SelfReg]
Install File "C:\ABC6\work\Mike Format Tenants\FormatSiteUtil.ico" to "%_SB_INSTALLDIR%\FormatSiteUtil.ico" [Feat:Always Install]

[ Create Shortcuts ]
::Create Shortcut "Remove ABC Temp Util" in "Desktop\Remove ABC Temp Util" (Always Install)
::Create Shortcut "ABC Util" in "Desktop\ABC Util" (Always Install)

[ Finalize Setup ]

[ Final User Interface ]
! Final wizard dialog definition(s)
Define Wizard Dialog "#1" (Finish) ()

! The Wizard Loop displays the dialog screens that the user sees in the installation
Loop Wizard (Abort Dialog Active)
End

linder
09-08-2013, 07:42 AM
Chris,

Please send the .sb8 project and the generated uninstall .log and we can try to tell you what you are doing wrong :). If the file is in the uninstall .log then the uninstall will definitely uninstall it. If it replaced previous version then it will rollback the file(s).

BTW, why are you using "SelfReg" on your "FormatSiteNbrs.exe"? Is this a self-registration file? And is it really your intention to always install to "C:\ABC6\TEMP_UTIL" and not give the user an installation directoty choice?

Friedrich

Chris
09-08-2013, 09:46 AM
Have emailed you the .SB8 and the uninstall log as requested.

Registering the .EXE was an oversight -- I guess it is a default I didn't spot. I've tried the uninstall without that setting and it still does not work.

This is the install for a temporary quick program for a client. They will use it once for 30 seconds, and then uninstall it. Hence they don't get a choice of where to install it :-)

Regards
Chris

linder
09-08-2013, 10:16 AM
Hi Chris,

Thanks for sending the .sb8 and the .log file.

It's what I assumed. In fact, the files are uninstalled ;) Look at the following uninstall.log file entries:


|004|C:\ABC6\TEMP_UTIL\SB8_BACKUP
|019|C:\ABC6\TEMP_UTIL\SB8_BACKUP\FormatSiteNbrs.0 001
|006|_0000_|C:\ABC6\TEMP_UTIL\FormatSiteNbrs.exe|1 |2013/09/07|14:23:40|1.0.0.0|28672|7DC732F2||0|
|019|C:\ABC6\TEMP_UTIL\SB8_BACKUP\FormatSiteUtil.0 001
|006|_0000_|C:\ABC6\TEMP_UTIL\FormatSiteUtil.ico|2 |2006/05/27|03:54:20||3774|6A93BD89||0|
|005|_0000_|C:\Users\Public\Desktop\Remove ABC Temp Util.lnk
|005|_0000_|C:\Users\Public\Desktop\ABC Util.lnk

The installer creates your backup folder "C:\ABC6\TEMP_UTIL\SB8_BACKUP". After that, it detects that the files "C:\ABC6\TEMP_UTIL\FormatSiteNbrs.exe" already exist and creates a backup copy "C:\ABC6\TEMP_UTIL\SB8_BACKUP\FormatSiteNbrs.0001" and "C:\ABC6\TEMP_UTIL\SB8_BACKUP\FormatSiteUtil.0001" in the backup folder. The same happens with "FormatSiteUtil.ico".

So when you uninstall, it will remove both files "FormatSiteNbrs.exe" and "FormatSiteUtil.ico". But it restores the original ones from the backup folder (because you have "Backup Replaced Files" enabled). A typical rollback scenario ;-)

Does this help?

Friedrich

Chris
09-08-2013, 11:12 AM
Well I see what you mean..... And yes there is a Backup Folder with those files in.....

But. I start with no temp folder and no files installed. (ie. the files do not exist on the target machine).

So why does the installer create a backup folder and put those .0001 files in it??

(My guess is that sometime in the past I DID install with the files already on the target machine and there's a record of this in the Registry?? Or something like that?)

linder
09-09-2013, 12:35 AM
Chris,

No, there is nothing in the Registry. The files in the "C:\ABC6\TEMP_UTIL" folder already exist when you run the setup. Otherwise, the installer would not create the backup files. The uninstall should always bring the system to the previous state. That's why it "rollbacks" the files from the backup folder.

You can go to "General Information" -> "Advanced Settings" -> and disable "Backup Replaced Files". As a result, the installer will not make a backup and the uninstall will remove the files (and not restore them).

Does this help?

Friedrich

linder
09-09-2013, 12:58 AM
BTW, see attached screenshots. We have created a "dummy" test install with your project and it works as expected (this is a Windows 8.1 x64 machine).

What I have noticed is that you have removed the "Product GUID" and the "Upgrade GUID" (and "Product Version" is set to 1). You need a Product GUID in Windows to register your uninstall. So please put this information back (similar to the attached information in the "Product Properties").

Friedrich

Chris
09-09-2013, 01:37 AM
Still doesn't work :-(

I have added back the "Product GUID" and the "Upgrade GUID" (and "Product Version" is set to 1). Now when I install it, it does create an entry in the Control Panel UNINSTALL PROGRAMS list. (it didn't without the GUID).

I've tried uninstalling via control panel, and also by calling the uninstall.exe directly. In both cases the result is the same as before. The installed programs and folder are not removed. I'm using Windows 8.0

It works on your computer but not on mine.
This is not an important issue (I can always get the client to manually delete the folder as this is a one-off temporary install). But I'd like to find out what I'm doing wrong so I get future install/uninstall projects correct.

Any more things I can try :-)

linder
09-09-2013, 01:50 AM
Chris,

I have uploaded a demo for you:

http://www.lindersoft.com/projects/support20130909A.zip

Unzip the files into a temporary folder, open the project "Install FormatSites Utility LS.sb8" and compile/run it. It will install two dummy files into "C:\ABC6\TEMP_UTIL_X". Uninstall works without any problem. Tested on Windows XP, Windows 7 (x64) and Windows 8.1 (x64).

Does this demo work for you?

Friedrich

linder
09-09-2013, 01:57 AM
BTW, just a quick suggestion. You should NOT create a Desktop shortcut for the Uninstall. This is against the Windows development guidelines.

Friedrich

Chris
09-09-2013, 02:51 AM
Hi Friedrich

Many thanks. The demo "almost" works :-)
The files are removed, but the empty folder remains.

So now I will try and work out what is different about "your" install .SB8 and mine.


Re_ "against Windows guidelines"..... Yes, yes. But it's easier to tell this client (who does not understand computers) to Click on this item to run the program. And then click on the other icon. Rather than talk them through going to Control Panel and uninstalling this program -- trying not to uninstall other similar sounding programs by mistake......
Be assured MOST of my installs do not have an uninstall desktop shortcut :-)

Thanks again for your quick replies.
Chris

linder
09-09-2013, 02:58 AM
You are welcome, Chris :)

BTW, I would suggest to change it to this "method":

http://www.lindersoft.com/projects/support20130909B.zip

If the "empty" folder remains and the installer created that folder then it's a permission problem. This happens when you start an uninstall from a Shortcut and the shortcut action "locks" the folder for some time. You can try to set the "working folder" in the Shorctut, but there is no guarantee that it always works. The uninstall should only be launched from the "Programs and Features" control panel.

Friedrich

linder
09-09-2013, 04:47 AM
Sorry, "Working Directory" should be %TMPWINDIR% and NOT %TMPDIR% in your case.

Friedrich

Chris
09-09-2013, 04:59 AM
Thank you.

Chris
09-09-2013, 05:41 AM
Ha !!

I could not see any difference between your .SB8 and mine (I went through mine and changed all things like "Backup replaced files" etc to be the same as yours. Mine still did not remove files when I used uninstall.

So I renamed my files (just added a 2 at the end). And renamed the .EXE that get produced. Now everything works perfectly. Even the folder gets removed (from desktop shortcut or from Control Panel remove).

I shall go and worry about the next problem...... :-)

linder
09-09-2013, 06:09 AM
:) I'm glad that it's working fine now!

and Yes - I do hate computers! <g>

Friedrich