nicolasf
Posts: 15
Joined: Mon Mar 02, 2015 4:17 pm

Bug: installer deletes certain C:\ files

Hello,
We think we found a bug in Advanced Installer. We were able to reproduce it on an installer created with Advanced Installer 11.1 although we tried with an installer created with Advanced Installer 11.8 (latest version to date) and could reproduce it too.

The behavior we observe is that the installer deletes "C:\Documents and Settings" and "C:\BOOTSECT.BAK" when uninstalling under the LocalSystem account.

OS: Windows 7 Professional with Service Pack 1 (x64)

Steps to reproduce it:
  • 1. Create the installer:
    • a. Create a new Advanced Installer Professional project.
      b. Go to "Media" and change "DefaultBuild" from "Single MSI (resources inside)" to "Single EXE setup (resources inside)".
      c. Check the option "Do not delete the extracted MSI and CAB files".
      d. Add a "MSI Build" -> "MSI setup file" below DefaultBuild.
      e. Delete DefaultBuild.
      f. Save the project.
      g. Build the project.
    2. Install the product:
    • a. Run the .msi built above. Wait for the installation to finish.
    3. Configure the Windows service:
    • a. Open AIWindowsService1.exe.config in Notepad.
      b. Locate "<add key="ProductCode" value=""/>" and enter the product code of the .msi built above in the value attribute.
      c. Save the changes.
    4. Install the Windows service:
    • a. Open cmd.exe with administrator privileges.
      b. Enter C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe "path to AIWindowsService1.exe".
      c. Close cmd.
    5. Start the Windows service:
    • a. Open services.msc.
      b. Locate AIWindowsService1 -> Right-click -> Start.
The Windows service is set to run under the LocalSystem account by default. It executes "msiexec /x ProductCode /quiet" on start.

Notice that "C:\Documents and Settings" and "C:\BOOTSECT.BAK" were deleted after the uninstallation finished.

We believe this behavior is caused by the DeleteExtractionPath function in lzmaextractor.dll which is called by the AI_DeleteUninstallLzma custom action with an empty CustomActionData (empty AI_EXPANDED_EXTRACTION_PATH). DeleteExtractionPath calls SHFileOperation with wFunc = FO_DELETE and pFrom = "\*.*" causing the side effect.

Screencast: https://app.box.com/s/g6gp2swhh07jnpio0tqb0ufgs6dyblxt
Windows service (compiled and source code) is attached.

Let us know if any other information is required.

Thanks,
Nicolás.
Attachments
AIWindowsService1 - Source.zip
(24.89 KiB) Downloaded 299 times
AIWindowsService1.zip
(7.04 KiB) Downloaded 303 times
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Bug: installer deletes certain C:\ files

Hello Nicolás and welcome to our forums,

I've tested your scenario on several Windows 7 virtual machines and I was able to replicate it on one Windows 7 Ultimate SP1 x64 machine. This seems to be an Advanced Installer issue, thank you for bringing this to our attention. A fix will be available as soon as possible in a future version of Advanced Installer. We'll notify you when an official fix will be out.

Until then, the only workaround would be to recreate the project from scratch and avoid to use the following steps in your project:
1. create (or use an existing MSI build)
2. set it as a "Single EXE setup (resources inside)" package type
3. check its "Do not delete the extracted MSI and CAB files" option
4. delete the build

We'll let you know as soon as we have more updates regarding this issue. Thank you for your patience and understanding.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Bug: installer deletes certain C:\ files

Hello,

This was fixed in version 11.9 of Advanced Installer released on March 17th, 2015.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”