wyzerd
Posts: 75
Joined: Tue Mar 27, 2007 3:54 am
Location: St. Louis, MO
Contact: Website

Uninstallation causes missing NTLDR and no boot

The attempt that was made at System Restore has failed. The developer that wrote this code is using RootDirectory (C:\) as the place to build the restore. Then is very sloppily calling ResourceCleaner.dll to get rid of the tempdirectory and wiping out all hidden and system files on the root that are not in use. Boot files are only used at boot time, so guess what... That is the last boot for that machine after this process takes place. This will completely kill all Windows XP64 Machine with a default setup.

Here are the offending rows in my AIP that I removed to stop making bricks of my machines.

<ROW Action="AI_AiBackupImmediate" Description="Preparing backup operation" Template="Path: [1]" DescriptionLocId="ActionText.Description.AI_AiBackupImmediate" TemplateLocId="ActionText.Template.AI_AiBackupImmediate"/>
<ROW Action="AI_AiBackupRollback" Description="Rollback backup" Template="Path: [1]" DescriptionLocId="ActionText.Description.AI_AiBackupRollback" TemplateLocId="ActionText.Template.AI_AiBackupRollback"/>
<ROW Action="AI_AiRestoreDeferred" Description="Executing restore operation" Template="Path: [1]" DescriptionLocId="ActionText.Description.AI_AiRestoreDeferred" TemplateLocId="ActionText.Template.AI_AiRestoreDeferred"/>
<ROW Action="AI_AiRestoreRollback" Description="Rollback restore" Template="Path: [1]" DescriptionLocId="ActionText.Description.AI_AiRestoreRollback" TemplateLocId="ActionText.Template.AI_AiRestoreRollback"/>

<ROW Name="ResourceCleaner.dll" SourcePath="<AI_CUSTACTS>ResourceCleaner.dll"/>

<ROW Action="AI_AiBackupCleanup" Type="1" Source="ResourceCleaner.dll" Target="OnAiBackupCleanup" WithoutSeq="true"/>
<ROW Action="AI_AiBackupImmediate" Type="1" Source="ResourceCleaner.dll" Target="OnAiBackupImmediate"/>
<ROW Action="AI_AiBackupRollback" Type="11521" Source="ResourceCleaner.dll" Target="OnAiBackupRollback"/>
<ROW Action="AI_AiRestoreDeferred" Type="11265" Source="ResourceCleaner.dll" Target="OnAiRestoreDeferred"/>
<ROW Action="AI_AiRestoreRollback" Type="11521" Source="ResourceCleaner.dll" Target="OnAiRestoreRollback" WithoutSeq="true"/>

<ROW Action="AI_AiBackupImmediate" Sequence="1001"/>
<ROW Action="AI_AiBackupRollback" Sequence="1501"/>
<ROW Action="AI_AiRestoreDeferred" Sequence="6599"/>


While I am writing this. A developer has also gotten wise and decided to change the file paths to relative. If I select A path, I expect to to stay that way. It is common to take an installation from one tree and use it in another. Changing my "T:\" to "..\..\" completely screws that up and often the tree I just finished with as well. If I wanted relative paths, I would have used them.

If this would have made it to our customers, the company I work for would have gotten rid of both you and me. But based on this egregious error in design and testing, I suspect, I wouldn't be long looking for work.

Before you start:
BACKUP NTDETECT.com ntldr, boot.ini
Place them somewhere outside of root, you will need them.

To reproduce
On XP64 Only:
Run main install
Run Patch install
Uninstall main product (without uninstalling the patch first)
Look at C:\ and watch the files disappear.
Copy your saves in: repeat until you believe.
Attachments
Patch.aip
(2.84 KiB) Downloaded 445 times
NEVER_BOOT_AGAIN.aip
Here is the file with both of the design flaws
(228 KiB) Downloaded 526 times
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Uninstallation causes missing NTLDR and no boot

Hello,

We've tested your scenario, but we couldn't reproduce the behavior. Can you please send us a verbose log of the uninstallation to support at advancedinstaller dot com so we can investigate? Also, can you try isolate the behavior in a sample (target aip and msi, upgraded aip and msi, and patch aip and msp) which reproduces the scenario so we can reproduce and investigate the behavior?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
wyzerd
Posts: 75
Joined: Tue Mar 27, 2007 3:54 am
Location: St. Louis, MO
Contact: Website

Re: Uninstallation causes missing NTLDR and no boot

Sorry, I forgot about this. I wrote a custom action to resolve this issue (since it was already in the field), I copy the contents of C:\*.* to SystemSave and next copy them back to C:\. The problem occurs on XP64 systems only. The Installations I have included will produce the undesired effect even on VMs. But only on XP64.

Here is the Save/Restore I had to write to fix this:

public function SaveSysFiles()
dim fs, folder, file
set fs=CreateObject("Scripting.FileSystemObject")
if not fs.folderExists("C:\SystemSave") then
fs.CreateFolder "C:\SystemSave"
end if
set folder=fs.GetFolder("C:\")
on error resume next
for each file in folder.files
fs.CopyFile file.path, "C:\SystemSave\" & file.name, true
next
on error goto 0
set folder = nothing
set fs = nothing
end function


public function RestoreSysFiles()
dim fs
set fs=CreateObject("Scripting.FileSystemObject")
on error resume next
if fs.FolderExists("C:\SystemSave") then
fs.CopyFile "C:\SystemSave\*.*", "C:\", true
fs.DeleteFolder("C:\SystemSave")
end if
set fs=nothing
on error goto 0
end function

After I get this release out, I will return with a log file for this, but as I recall, it is not listed as a log item. I do recall seeing another folder show up on the root during the uninstall process and it disappeared with all the system files when the uninstall completed. I am certain this is part of the relative path stuff that was started around release 9.6-9.8. It may be because I am not extracting to the expected default location (because it is wrong) and the relative path back puts the temporary listing at root instead of where the dev who rewrote this function to use relative paths instead of %temp% like he should have is destroying data he did not write.
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Uninstallation causes missing NTLDR and no boot

Hello,

Can you please try to isolate this behavior in a sample (target aip and msi, upgraded aip and msi, and patch aip and msp) which always reproduces the behavior so we can test and investigate on our test machines? I'm afraid that in order to further investigate this we need to be able to reproduce the behavior on our side. So, it would be useful if you could send us a sample reproducing this and a step by step test case scenario.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”