Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7bd44308e3 |
@@ -1,18 +0,0 @@
|
||||
.vs/
|
||||
packages/
|
||||
|
||||
cleanflash/
|
||||
|
||||
bin
|
||||
obj
|
||||
|
||||
*.exe
|
||||
*.obj
|
||||
*.pdb
|
||||
*.user
|
||||
*.suo
|
||||
|
||||
*.zip
|
||||
*.7z
|
||||
|
||||
target
|
||||
@@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>CleanFlashCommon</RootNamespace>
|
||||
<AssemblyName>CleanFlashCommon</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net40</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net40" Version="1.0.3">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'">
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<DebugType>None</DebugType>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,12 +0,0 @@
|
||||
namespace CleanFlashCommon {
|
||||
public class ExitedProcess {
|
||||
public int ExitCode { get; set; }
|
||||
public string Output { get; set; }
|
||||
|
||||
public bool IsSuccessful {
|
||||
get {
|
||||
return ExitCode == 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.AccessControl;
|
||||
using System.Security.Principal;
|
||||
using System.Threading;
|
||||
|
||||
namespace CleanFlashCommon {
|
||||
public class FileUtil {
|
||||
|
||||
public static void TakeOwnership(string filename) {
|
||||
FileSecurity security = new FileSecurity();
|
||||
|
||||
SecurityIdentifier sid = WindowsIdentity.GetCurrent().User;
|
||||
security.SetOwner(sid);
|
||||
security.SetAccessRule(new FileSystemAccessRule(sid, FileSystemRights.FullControl, AccessControlType.Allow));
|
||||
|
||||
File.SetAccessControl(filename, security);
|
||||
|
||||
// Remove read-only attribute
|
||||
File.SetAttributes(filename, File.GetAttributes(filename) & ~FileAttributes.ReadOnly);
|
||||
}
|
||||
|
||||
public static void RecursiveDelete(DirectoryInfo rootDir, DirectoryInfo baseDir, string filename) {
|
||||
if (!baseDir.FullName.StartsWith(rootDir.FullName)) {
|
||||
// Sanity check.
|
||||
return;
|
||||
}
|
||||
|
||||
if (!baseDir.Exists) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (DirectoryInfo dir in baseDir.EnumerateDirectories()) {
|
||||
RecursiveDelete(rootDir, dir, filename);
|
||||
}
|
||||
|
||||
foreach (FileInfo file in baseDir.GetFiles()) {
|
||||
if (!file.FullName.StartsWith(rootDir.FullName)) {
|
||||
// Sanity check.
|
||||
continue;
|
||||
}
|
||||
|
||||
if (filename == null || file.Name.Equals(filename)) {
|
||||
DeleteFile(file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void DeleteFile(FileInfo file) {
|
||||
if (!file.Exists) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (file.Extension.ToLower().Equals(".ocx")) {
|
||||
Uninstaller.UnregisterActiveX(file.FullName);
|
||||
}
|
||||
|
||||
try {
|
||||
file.IsReadOnly = false;
|
||||
file.Delete();
|
||||
} catch {
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
try {
|
||||
TakeOwnership(file.FullName);
|
||||
file.IsReadOnly = false;
|
||||
file.Delete();
|
||||
return;
|
||||
} catch {
|
||||
// Try again after sleeping.
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
}
|
||||
|
||||
HandleUtil.KillProcessesUsingFile(file.FullName);
|
||||
Thread.Sleep(500);
|
||||
file.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public static void RecursiveDelete(DirectoryInfo baseDir) {
|
||||
RecursiveDelete(baseDir, baseDir, null);
|
||||
}
|
||||
|
||||
public static void RecursiveDelete(string baseDir, string filename) {
|
||||
DirectoryInfo dirInfo = new DirectoryInfo(baseDir);
|
||||
RecursiveDelete(dirInfo, dirInfo, filename);
|
||||
}
|
||||
|
||||
public static void RecursiveDelete(string baseDir) {
|
||||
DirectoryInfo dirInfo = new DirectoryInfo(baseDir);
|
||||
RecursiveDelete(dirInfo, dirInfo, null);
|
||||
}
|
||||
|
||||
public static void WipeFolder(string baseDir) {
|
||||
DirectoryInfo dirInfo = new DirectoryInfo(baseDir);
|
||||
|
||||
if (!dirInfo.Exists) {
|
||||
return;
|
||||
}
|
||||
|
||||
RecursiveDelete(dirInfo);
|
||||
|
||||
if (!Directory.EnumerateFileSystemEntries(dirInfo.FullName).Any()) {
|
||||
try {
|
||||
dirInfo.Delete();
|
||||
} catch {
|
||||
HandleUtil.KillProcessesUsingFile(dirInfo.FullName);
|
||||
Thread.Sleep(500);
|
||||
|
||||
try {
|
||||
dirInfo.Delete();
|
||||
} catch {
|
||||
// We've tried for long enough...
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void DeleteFile(string file) {
|
||||
DeleteFile(new FileInfo(file));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CleanFlashCommon {
|
||||
public class GradientButton : Button {
|
||||
public Color Color1 { get; set; }
|
||||
public Color Color2 { get; set; }
|
||||
public double HoverAlpha { get; set; }
|
||||
public double DisableAlpha { get; set; }
|
||||
|
||||
private bool Hovered = false;
|
||||
|
||||
public GradientButton() {
|
||||
Color1 = Color.Black;
|
||||
Color2 = Color.White;
|
||||
HoverAlpha = 0.875;
|
||||
DisableAlpha = 0.644;
|
||||
}
|
||||
|
||||
protected override void OnMouseDown(MouseEventArgs mevent) {
|
||||
Hovered = false;
|
||||
base.OnMouseDown(mevent);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
protected override void OnMouseUp(MouseEventArgs mevent) {
|
||||
Hovered = true;
|
||||
base.OnMouseUp(mevent);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
protected override void OnMouseEnter(EventArgs e) {
|
||||
Hovered = true;
|
||||
base.OnMouseEnter(e);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
protected override void OnMouseLeave(EventArgs e) {
|
||||
Hovered = false;
|
||||
base.OnMouseLeave(e);
|
||||
Refresh();
|
||||
}
|
||||
|
||||
protected override void OnPaint(PaintEventArgs e) {
|
||||
Color c1 = Color1;
|
||||
Color c2 = Color2;
|
||||
Color c3 = BackColor;
|
||||
Color c4 = ForeColor;
|
||||
|
||||
if (!Enabled) {
|
||||
c1 = Color.FromArgb(255, (int)(c1.R * DisableAlpha), (int)(c1.G * DisableAlpha), (int)(c1.B * DisableAlpha));
|
||||
c2 = Color.FromArgb(255, (int)(c2.R * DisableAlpha), (int)(c2.G * DisableAlpha), (int)(c2.B * DisableAlpha));
|
||||
c3 = Color.FromArgb(255, (int)(c3.R * DisableAlpha), (int)(c3.G * DisableAlpha), (int)(c3.B * DisableAlpha));
|
||||
c4 = Color.FromArgb(255, (int)(c4.R * DisableAlpha), (int)(c4.G * DisableAlpha), (int)(c4.B * DisableAlpha));
|
||||
} else if (!Hovered) {
|
||||
c1 = Color.FromArgb(255, (int)(c1.R * HoverAlpha), (int)(c1.G * HoverAlpha), (int)(c1.B * HoverAlpha));
|
||||
c2 = Color.FromArgb(255, (int)(c2.R * HoverAlpha), (int)(c2.G * HoverAlpha), (int)(c2.B * HoverAlpha));
|
||||
}
|
||||
|
||||
SizeF size = e.Graphics.MeasureString(Text, Font);
|
||||
|
||||
using (Brush brush = new LinearGradientBrush(ClientRectangle, c1, c2, 90.0F)) {
|
||||
e.Graphics.FillRectangle(brush, ClientRectangle);
|
||||
}
|
||||
|
||||
int thickness = 1;
|
||||
int halfThickness = thickness / 2;
|
||||
|
||||
using (Pen pen = new Pen(c3, thickness)) {
|
||||
e.Graphics.DrawRectangle(
|
||||
pen, new Rectangle(
|
||||
halfThickness, halfThickness,
|
||||
ClientRectangle.Width - thickness, ClientRectangle.Height - thickness
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Point point = new Point(
|
||||
(ClientRectangle.Width - (int)size.Width) / 2,
|
||||
(ClientRectangle.Height - (int)size.Height) / 2
|
||||
);
|
||||
|
||||
using (Brush brush = new SolidBrush(c4)) {
|
||||
e.Graphics.DrawString(Text, Font, new SolidBrush(c3), new Point(point.X + 1, point.Y + 1));
|
||||
e.Graphics.DrawString(Text, Font, brush, point);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,527 +0,0 @@
|
||||
// Taken from: https://github.com/Walkman100/FileLocks
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.ConstrainedExecution;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Permissions;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
||||
namespace CleanFlashCommon {
|
||||
public static class HandleUtil {
|
||||
|
||||
private static Dictionary<string, string> deviceMap;
|
||||
private const string networkDevicePrefix = "\\Device\\LanmanRedirector\\";
|
||||
private const int MAX_PATH = 260;
|
||||
private const int handleTypeTokenCount = 27;
|
||||
private static readonly string[] handleTypeTokens = new string[] {
|
||||
"", "", "Directory", "SymbolicLink", "Token",
|
||||
"Process", "Thread", "Unknown7", "Event", "EventPair", "Mutant",
|
||||
"Unknown11", "Semaphore", "Timer", "Profile", "WindowStation",
|
||||
"Desktop", "Section", "Key", "Port", "WaitablePort",
|
||||
"Unknown21", "Unknown22", "Unknown23", "Unknown24",
|
||||
"IoCompletion", "File"
|
||||
};
|
||||
|
||||
internal enum NT_STATUS {
|
||||
STATUS_SUCCESS = 0x00000000,
|
||||
STATUS_BUFFER_OVERFLOW = unchecked((int)0x80000005L),
|
||||
STATUS_INFO_LENGTH_MISMATCH = unchecked((int)0xC0000004L)
|
||||
}
|
||||
|
||||
internal enum SYSTEM_INFORMATION_CLASS {
|
||||
SystemBasicInformation = 0,
|
||||
SystemPerformanceInformation = 2,
|
||||
SystemTimeOfDayInformation = 3,
|
||||
SystemProcessInformation = 5,
|
||||
SystemProcessorPerformanceInformation = 8,
|
||||
SystemHandleInformation = 16,
|
||||
SystemInterruptInformation = 23,
|
||||
SystemExceptionInformation = 33,
|
||||
SystemRegistryQuotaInformation = 37,
|
||||
SystemLookasideInformation = 45
|
||||
}
|
||||
|
||||
internal enum OBJECT_INFORMATION_CLASS {
|
||||
ObjectBasicInformation = 0,
|
||||
ObjectNameInformation = 1,
|
||||
ObjectTypeInformation = 2,
|
||||
ObjectAllTypesInformation = 3,
|
||||
ObjectHandleInformation = 4
|
||||
}
|
||||
|
||||
[Flags]
|
||||
internal enum ProcessAccessRights {
|
||||
PROCESS_DUP_HANDLE = 0x00000040
|
||||
}
|
||||
|
||||
[Flags]
|
||||
internal enum DuplicateHandleOptions {
|
||||
DUPLICATE_CLOSE_SOURCE = 0x1,
|
||||
DUPLICATE_SAME_ACCESS = 0x2
|
||||
}
|
||||
|
||||
private enum SystemHandleType {
|
||||
OB_TYPE_UNKNOWN = 0,
|
||||
OB_TYPE_TYPE = 1,
|
||||
OB_TYPE_DIRECTORY,
|
||||
OB_TYPE_SYMBOLIC_LINK,
|
||||
OB_TYPE_TOKEN,
|
||||
OB_TYPE_PROCESS,
|
||||
OB_TYPE_THREAD,
|
||||
OB_TYPE_UNKNOWN_7,
|
||||
OB_TYPE_EVENT,
|
||||
OB_TYPE_EVENT_PAIR,
|
||||
OB_TYPE_MUTANT,
|
||||
OB_TYPE_UNKNOWN_11,
|
||||
OB_TYPE_SEMAPHORE,
|
||||
OB_TYPE_TIMER,
|
||||
OB_TYPE_PROFILE,
|
||||
OB_TYPE_WINDOW_STATION,
|
||||
OB_TYPE_DESKTOP,
|
||||
OB_TYPE_SECTION,
|
||||
OB_TYPE_KEY,
|
||||
OB_TYPE_PORT,
|
||||
OB_TYPE_WAITABLE_PORT,
|
||||
OB_TYPE_UNKNOWN_21,
|
||||
OB_TYPE_UNKNOWN_22,
|
||||
OB_TYPE_UNKNOWN_23,
|
||||
OB_TYPE_UNKNOWN_24,
|
||||
OB_TYPE_IO_COMPLETION,
|
||||
OB_TYPE_FILE
|
||||
};
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
private struct SYSTEM_HANDLE_ENTRY {
|
||||
public int OwnerPid;
|
||||
public byte ObjectType;
|
||||
public byte HandleFlags;
|
||||
public short HandleValue;
|
||||
public int ObjectPointer;
|
||||
public int AccessMask;
|
||||
}
|
||||
|
||||
[DllImport("ntdll.dll")]
|
||||
internal static extern NT_STATUS NtQuerySystemInformation(
|
||||
[In] SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
||||
[In] IntPtr SystemInformation,
|
||||
[In] int SystemInformationLength,
|
||||
[Out] out int ReturnLength);
|
||||
|
||||
[DllImport("ntdll.dll")]
|
||||
internal static extern NT_STATUS NtQueryObject(
|
||||
[In] IntPtr Handle,
|
||||
[In] OBJECT_INFORMATION_CLASS ObjectInformationClass,
|
||||
[In] IntPtr ObjectInformation,
|
||||
[In] int ObjectInformationLength,
|
||||
[Out] out int ReturnLength);
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
internal static extern SafeProcessHandle OpenProcess(
|
||||
[In] ProcessAccessRights dwDesiredAccess,
|
||||
[In, MarshalAs(UnmanagedType.Bool)] bool bInheritHandle,
|
||||
[In] int dwProcessId);
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
internal static extern bool DuplicateHandle(
|
||||
[In] IntPtr hSourceProcessHandle,
|
||||
[In] IntPtr hSourceHandle,
|
||||
[In] IntPtr hTargetProcessHandle,
|
||||
[Out] out SafeObjectHandle lpTargetHandle,
|
||||
[In] int dwDesiredAccess,
|
||||
[In, MarshalAs(UnmanagedType.Bool)] bool bInheritHandle,
|
||||
[In] DuplicateHandleOptions dwOptions);
|
||||
|
||||
[DllImport("kernel32.dll")]
|
||||
internal static extern IntPtr GetCurrentProcess();
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
internal static extern int GetProcessId(
|
||||
[In] IntPtr Process);
|
||||
|
||||
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
internal static extern bool CloseHandle(
|
||||
[In] IntPtr hObject);
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
internal static extern int QueryDosDevice(
|
||||
[In] string lpDeviceName,
|
||||
[Out] StringBuilder lpTargetPath,
|
||||
[In] int ucchMax);
|
||||
|
||||
[SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)]
|
||||
internal sealed class SafeObjectHandle : SafeHandleZeroOrMinusOneIsInvalid {
|
||||
private SafeObjectHandle() : base(true) { }
|
||||
|
||||
internal SafeObjectHandle(IntPtr preexistingHandle, bool ownsHandle) : base(ownsHandle) {
|
||||
base.SetHandle(preexistingHandle);
|
||||
}
|
||||
|
||||
protected override bool ReleaseHandle() {
|
||||
return CloseHandle(base.handle);
|
||||
}
|
||||
}
|
||||
|
||||
[SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)]
|
||||
internal sealed class SafeProcessHandle : SafeHandleZeroOrMinusOneIsInvalid {
|
||||
private SafeProcessHandle()
|
||||
: base(true) { }
|
||||
|
||||
internal SafeProcessHandle(IntPtr preexistingHandle, bool ownsHandle)
|
||||
: base(ownsHandle) {
|
||||
base.SetHandle(preexistingHandle);
|
||||
}
|
||||
|
||||
protected override bool ReleaseHandle() {
|
||||
return CloseHandle(base.handle);
|
||||
}
|
||||
}
|
||||
|
||||
private sealed class OpenFiles : IEnumerable<string> {
|
||||
private readonly int processId;
|
||||
|
||||
internal OpenFiles(int processId) {
|
||||
this.processId = processId;
|
||||
}
|
||||
|
||||
public IEnumerator<string> GetEnumerator() {
|
||||
NT_STATUS ret;
|
||||
int length = 0x10000;
|
||||
// Loop, probing for required memory.
|
||||
|
||||
do {
|
||||
IntPtr ptr = IntPtr.Zero;
|
||||
RuntimeHelpers.PrepareConstrainedRegions();
|
||||
|
||||
try {
|
||||
RuntimeHelpers.PrepareConstrainedRegions();
|
||||
|
||||
try { } finally {
|
||||
// CER guarantees that the address of the allocated
|
||||
// memory is actually assigned to ptr if an
|
||||
// asynchronous exception occurs.
|
||||
ptr = Marshal.AllocHGlobal(length);
|
||||
}
|
||||
|
||||
ret = NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS.SystemHandleInformation, ptr, length, out int returnLength);
|
||||
|
||||
if (ret == NT_STATUS.STATUS_INFO_LENGTH_MISMATCH) {
|
||||
// Round required memory up to the nearest 64KB boundary.
|
||||
length = (returnLength + 0xffff) & ~0xffff;
|
||||
} else if (ret == NT_STATUS.STATUS_SUCCESS) {
|
||||
int handleCount = Marshal.ReadInt32(ptr);
|
||||
int offset = sizeof(int);
|
||||
int size = Marshal.SizeOf(typeof(SYSTEM_HANDLE_ENTRY));
|
||||
|
||||
for (int i = 0; i < handleCount; i++) {
|
||||
SYSTEM_HANDLE_ENTRY handleEntry = (SYSTEM_HANDLE_ENTRY) Marshal.PtrToStructure((IntPtr)((int)ptr + offset), typeof(SYSTEM_HANDLE_ENTRY));
|
||||
|
||||
if (handleEntry.OwnerPid == processId) {
|
||||
IntPtr handle = (IntPtr) handleEntry.HandleValue;
|
||||
SystemHandleType handleType;
|
||||
|
||||
if (GetHandleType(handle, handleEntry.OwnerPid, out handleType) && handleType == SystemHandleType.OB_TYPE_FILE) {
|
||||
if (GetFileNameFromHandle(handle, handleEntry.OwnerPid, out string devicePath)) {
|
||||
if (ConvertDevicePathToDosPath(devicePath, out string dosPath)) {
|
||||
if (File.Exists(dosPath)) {
|
||||
yield return dosPath;
|
||||
} else if (Directory.Exists(dosPath)) {
|
||||
yield return dosPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
offset += size;
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
// CER guarantees that the allocated memory is freed,
|
||||
// if an asynchronous exception occurs.
|
||||
Marshal.FreeHGlobal(ptr);
|
||||
}
|
||||
} while (ret == NT_STATUS.STATUS_INFO_LENGTH_MISMATCH);
|
||||
}
|
||||
|
||||
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() {
|
||||
return GetEnumerator();
|
||||
}
|
||||
}
|
||||
|
||||
private class FileNameFromHandleState : IDisposable {
|
||||
private readonly ManualResetEvent _mr;
|
||||
public IntPtr Handle { get; }
|
||||
public string FileName { get; set; }
|
||||
public bool RetValue { get; set; }
|
||||
|
||||
public FileNameFromHandleState(IntPtr handle) {
|
||||
_mr = new ManualResetEvent(false);
|
||||
this.Handle = handle;
|
||||
}
|
||||
|
||||
public bool WaitOne(int wait) {
|
||||
return _mr.WaitOne(wait, false);
|
||||
}
|
||||
|
||||
public void Set() {
|
||||
try {
|
||||
_mr.Set();
|
||||
} catch { }
|
||||
}
|
||||
|
||||
public void Dispose() {
|
||||
if (_mr != null) {
|
||||
_mr.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static bool GetFileNameFromHandle(IntPtr handle, out string fileName) {
|
||||
IntPtr ptr = IntPtr.Zero;
|
||||
RuntimeHelpers.PrepareConstrainedRegions();
|
||||
|
||||
try {
|
||||
int length = 0x200; // 512 bytes
|
||||
RuntimeHelpers.PrepareConstrainedRegions();
|
||||
|
||||
try { } finally {
|
||||
// CER guarantees the assignment of the allocated
|
||||
// memory address to ptr, if an ansynchronous exception
|
||||
// occurs.
|
||||
ptr = Marshal.AllocHGlobal(length);
|
||||
}
|
||||
|
||||
NT_STATUS ret = NtQueryObject(handle, OBJECT_INFORMATION_CLASS.ObjectNameInformation, ptr, length, out length);
|
||||
|
||||
if (ret == NT_STATUS.STATUS_BUFFER_OVERFLOW) {
|
||||
RuntimeHelpers.PrepareConstrainedRegions();
|
||||
try { } finally {
|
||||
// CER guarantees that the previous allocation is freed,
|
||||
// and that the newly allocated memory address is
|
||||
// assigned to ptr if an asynchronous exception occurs.
|
||||
Marshal.FreeHGlobal(ptr);
|
||||
ptr = Marshal.AllocHGlobal(length);
|
||||
}
|
||||
ret = NtQueryObject(handle, OBJECT_INFORMATION_CLASS.ObjectNameInformation, ptr, length, out length);
|
||||
}
|
||||
if (ret == NT_STATUS.STATUS_SUCCESS) {
|
||||
fileName = Marshal.PtrToStringUni((IntPtr)((int)ptr + 8), (length - 9) / 2);
|
||||
return fileName.Length != 0;
|
||||
}
|
||||
} finally {
|
||||
// CER guarantees that the allocated memory is freed,
|
||||
// if an asynchronous exception occurs.
|
||||
Marshal.FreeHGlobal(ptr);
|
||||
}
|
||||
|
||||
fileName = string.Empty;
|
||||
return false;
|
||||
}
|
||||
private static void GetFileNameFromHandle(object state) {
|
||||
FileNameFromHandleState s = (FileNameFromHandleState)state;
|
||||
|
||||
s.RetValue = GetFileNameFromHandle(s.Handle, out string fileName);
|
||||
s.FileName = fileName;
|
||||
s.Set();
|
||||
}
|
||||
|
||||
private static bool GetFileNameFromHandle(IntPtr handle, out string fileName, int wait) {
|
||||
using (FileNameFromHandleState f = new FileNameFromHandleState(handle)) {
|
||||
ThreadPool.QueueUserWorkItem(new WaitCallback(GetFileNameFromHandle), f);
|
||||
|
||||
if (f.WaitOne(wait)) {
|
||||
fileName = f.FileName;
|
||||
return f.RetValue;
|
||||
} else {
|
||||
fileName = string.Empty;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static bool GetFileNameFromHandle(IntPtr handle, int processId, out string fileName) {
|
||||
IntPtr currentProcess = GetCurrentProcess();
|
||||
bool remote = processId != GetProcessId(currentProcess);
|
||||
SafeProcessHandle processHandle = null;
|
||||
SafeObjectHandle objectHandle = null;
|
||||
|
||||
try {
|
||||
if (remote) {
|
||||
processHandle = OpenProcess(ProcessAccessRights.PROCESS_DUP_HANDLE, true, processId);
|
||||
if (DuplicateHandle(processHandle.DangerousGetHandle(), handle, currentProcess, out objectHandle, 0, false, DuplicateHandleOptions.DUPLICATE_SAME_ACCESS)) {
|
||||
handle = objectHandle.DangerousGetHandle();
|
||||
}
|
||||
}
|
||||
|
||||
return GetFileNameFromHandle(handle, out fileName, 200);
|
||||
} finally {
|
||||
if (remote) {
|
||||
if (processHandle != null) {
|
||||
processHandle.Close();
|
||||
}
|
||||
|
||||
if (objectHandle != null) {
|
||||
objectHandle.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetHandleTypeToken(IntPtr handle) {
|
||||
NtQueryObject(handle, OBJECT_INFORMATION_CLASS.ObjectTypeInformation, IntPtr.Zero, 0, out int length);
|
||||
IntPtr ptr = IntPtr.Zero;
|
||||
RuntimeHelpers.PrepareConstrainedRegions();
|
||||
|
||||
try {
|
||||
RuntimeHelpers.PrepareConstrainedRegions();
|
||||
|
||||
try { } finally {
|
||||
if (length >= 0) {
|
||||
ptr = Marshal.AllocHGlobal(length);
|
||||
}
|
||||
}
|
||||
|
||||
if (NtQueryObject(handle, OBJECT_INFORMATION_CLASS.ObjectTypeInformation, ptr, length, out length) == NT_STATUS.STATUS_SUCCESS) {
|
||||
return Marshal.PtrToStringUni((IntPtr)((int)ptr + 0x60));
|
||||
}
|
||||
|
||||
} finally {
|
||||
Marshal.FreeHGlobal(ptr);
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
private static string GetHandleTypeToken(IntPtr handle, int processId) {
|
||||
IntPtr currentProcess = GetCurrentProcess();
|
||||
bool remote = processId != GetProcessId(currentProcess);
|
||||
SafeProcessHandle processHandle = null;
|
||||
SafeObjectHandle objectHandle = null;
|
||||
|
||||
try {
|
||||
if (remote) {
|
||||
processHandle = OpenProcess(ProcessAccessRights.PROCESS_DUP_HANDLE, true, processId);
|
||||
if (DuplicateHandle(processHandle.DangerousGetHandle(), handle, currentProcess, out objectHandle, 0, false, DuplicateHandleOptions.DUPLICATE_SAME_ACCESS)) {
|
||||
handle = objectHandle.DangerousGetHandle();
|
||||
}
|
||||
}
|
||||
|
||||
return GetHandleTypeToken(handle);
|
||||
} finally {
|
||||
if (remote) {
|
||||
if (processHandle != null) {
|
||||
processHandle.Close();
|
||||
}
|
||||
|
||||
if (objectHandle != null) {
|
||||
objectHandle.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static bool GetHandleTypeFromToken(string token, out SystemHandleType handleType) {
|
||||
for (int i = 1; i < handleTypeTokenCount; i++) {
|
||||
if (handleTypeTokens[i] == token) {
|
||||
handleType = (SystemHandleType) i;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
handleType = SystemHandleType.OB_TYPE_UNKNOWN;
|
||||
return false;
|
||||
}
|
||||
|
||||
private static bool GetHandleType(IntPtr handle, int processId, out SystemHandleType handleType) {
|
||||
string token = GetHandleTypeToken(handle, processId);
|
||||
return GetHandleTypeFromToken(token, out handleType);
|
||||
}
|
||||
|
||||
private static bool ConvertDevicePathToDosPath(string devicePath, out string dosPath) {
|
||||
EnsureDeviceMap();
|
||||
int i = devicePath.Length;
|
||||
|
||||
while (i > 0 && (i = devicePath.LastIndexOf('\\', i - 1)) != -1) {
|
||||
if (deviceMap.TryGetValue(devicePath.Substring(0, i), out string drive)) {
|
||||
dosPath = string.Concat(drive, devicePath.Substring(i));
|
||||
return dosPath.Length != 0;
|
||||
}
|
||||
}
|
||||
|
||||
dosPath = string.Empty;
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void EnsureDeviceMap() {
|
||||
if (deviceMap == null) {
|
||||
Dictionary<string, string> localDeviceMap = BuildDeviceMap();
|
||||
Interlocked.CompareExchange(ref deviceMap, localDeviceMap, null);
|
||||
}
|
||||
}
|
||||
|
||||
private static Dictionary<string, string> BuildDeviceMap() {
|
||||
string[] logicalDrives = Environment.GetLogicalDrives();
|
||||
Dictionary<string, string> localDeviceMap = new Dictionary<string, string>(logicalDrives.Length);
|
||||
StringBuilder lpTargetPath = new StringBuilder(MAX_PATH);
|
||||
|
||||
foreach (string drive in logicalDrives) {
|
||||
string lpDeviceName = drive.Substring(0, 2);
|
||||
QueryDosDevice(lpDeviceName, lpTargetPath, MAX_PATH);
|
||||
localDeviceMap.Add(NormalizeDeviceName(lpTargetPath.ToString()), lpDeviceName);
|
||||
}
|
||||
|
||||
localDeviceMap.Add(networkDevicePrefix.Substring(0, networkDevicePrefix.Length - 1), "\\");
|
||||
return localDeviceMap;
|
||||
}
|
||||
|
||||
private static string NormalizeDeviceName(string deviceName) {
|
||||
if (string.Compare(deviceName, 0, networkDevicePrefix, 0, networkDevicePrefix.Length, StringComparison.InvariantCulture) == 0) {
|
||||
string shareName = deviceName.Substring(deviceName.IndexOf('\\', networkDevicePrefix.Length) + 1);
|
||||
return string.Concat(networkDevicePrefix, shareName);
|
||||
}
|
||||
|
||||
return deviceName;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the open files enumerator.
|
||||
/// </summary>
|
||||
/// <param name="processId">The process id.</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable<string> GetOpenFilesEnumerator(int processId) {
|
||||
return new OpenFiles(processId);
|
||||
}
|
||||
|
||||
public static List<Process> GetProcessesUsingFile(string fName) {
|
||||
List<Process> result = new List<Process>();
|
||||
foreach (Process p in Process.GetProcesses()) {
|
||||
try {
|
||||
if (GetOpenFilesEnumerator(p.Id).Contains(fName)) {
|
||||
result.Add(p);
|
||||
}
|
||||
} catch { } // Some processes will fail.
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void KillProcessesUsingFile(string fName) {
|
||||
foreach (Process process in GetProcessesUsingFile(fName).OrderBy(o => o.StartTime)) {
|
||||
try {
|
||||
process.Kill();
|
||||
process.WaitForExit();
|
||||
} catch {
|
||||
// Oh well...
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace CleanFlashCommon {
|
||||
public interface IProgressForm {
|
||||
|
||||
void UpdateProgressLabel(string text, bool tick);
|
||||
void TickProgress();
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
|
||||
namespace CleanFlashCommon {
|
||||
public partial class ImageCheckBox {
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) {
|
||||
if (disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
components = new System.ComponentModel.Container();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CleanFlashCommon {
|
||||
public partial class ImageCheckBox : CheckBox {
|
||||
protected override void OnCheckedChanged(EventArgs e) {
|
||||
ImageIndex = Checked ? 1 : 0;
|
||||
base.OnCheckedChanged(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace CleanFlashCommon {
|
||||
public class InstallException : Exception {
|
||||
|
||||
public InstallException(string message) : base(message) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace CleanFlashCommon {
|
||||
public class ProcessUtils {
|
||||
|
||||
class Native {
|
||||
internal enum ModuleFilter {
|
||||
ListModulesDefault = 0x0,
|
||||
ListModules32Bit = 0x01,
|
||||
ListModules64Bit = 0x02,
|
||||
ListModulesAll = 0x03,
|
||||
}
|
||||
|
||||
[DllImport("psapi.dll")]
|
||||
public static extern bool EnumProcessModulesEx(IntPtr hProcess, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U4)][In][Out] IntPtr[] lphModule, int cb, [MarshalAs(UnmanagedType.U4)] out int lpcbNeeded, uint dwFilterFlag);
|
||||
|
||||
[DllImport("psapi.dll")]
|
||||
public static extern bool EnumProcessModules(IntPtr hProcess, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U4)][In][Out] IntPtr[] lphModule, int cb, [MarshalAs(UnmanagedType.U4)] out int lpcbNeeded);
|
||||
|
||||
[DllImport("psapi.dll")]
|
||||
public static extern uint GetModuleFileNameEx(IntPtr hProcess, IntPtr hModule, [Out] StringBuilder lpBaseName, [In][MarshalAs(UnmanagedType.U4)] uint nSize);
|
||||
}
|
||||
|
||||
public static List<string> CollectModules(Process process) {
|
||||
List<string> collectedModules = new List<string>();
|
||||
bool ex = true;
|
||||
|
||||
IntPtr[] modulePointers = new IntPtr[0];
|
||||
int bytesNeeded;
|
||||
|
||||
// Determine number of modules
|
||||
try {
|
||||
if (!Native.EnumProcessModulesEx(process.Handle, modulePointers, 0, out bytesNeeded, (uint)Native.ModuleFilter.ListModulesAll)) {
|
||||
return collectedModules;
|
||||
}
|
||||
} catch (EntryPointNotFoundException) {
|
||||
if (!Native.EnumProcessModules(process.Handle, modulePointers, 0, out bytesNeeded)) {
|
||||
return collectedModules;
|
||||
}
|
||||
|
||||
ex = false;
|
||||
} catch {
|
||||
return collectedModules;
|
||||
}
|
||||
|
||||
int totalModules = bytesNeeded / IntPtr.Size;
|
||||
modulePointers = new IntPtr[totalModules];
|
||||
|
||||
// Collect modules from the process
|
||||
if ((ex && !Native.EnumProcessModulesEx(process.Handle, modulePointers, bytesNeeded, out bytesNeeded, (uint) Native.ModuleFilter.ListModulesAll)) || (!ex && !Native.EnumProcessModules(process.Handle, modulePointers, bytesNeeded, out bytesNeeded))) {
|
||||
return collectedModules;
|
||||
}
|
||||
|
||||
for (int i = 0; i < totalModules; ++i) {
|
||||
StringBuilder moduleFilePath = new StringBuilder(1024);
|
||||
Native.GetModuleFileNameEx(process.Handle, modulePointers[i], moduleFilePath, (uint) moduleFilePath.Capacity);
|
||||
|
||||
string moduleName = Path.GetFileName(moduleFilePath.ToString());
|
||||
collectedModules.Add(moduleName);
|
||||
}
|
||||
|
||||
return collectedModules;
|
||||
}
|
||||
|
||||
public static ExitedProcess RunProcess(ProcessStartInfo startInfo)
|
||||
{
|
||||
startInfo.RedirectStandardOutput = true;
|
||||
startInfo.RedirectStandardError = true;
|
||||
|
||||
StringBuilder outputBuilder = new StringBuilder();
|
||||
Process process = new Process
|
||||
{
|
||||
StartInfo = startInfo
|
||||
};
|
||||
DataReceivedEventHandler outputHandler = new DataReceivedEventHandler(
|
||||
delegate (object sender, DataReceivedEventArgs e) {
|
||||
outputBuilder.AppendLine(e.Data);
|
||||
}
|
||||
);
|
||||
|
||||
process.OutputDataReceived += outputHandler;
|
||||
process.ErrorDataReceived += outputHandler;
|
||||
|
||||
process.Start();
|
||||
process.BeginOutputReadLine();
|
||||
process.BeginErrorReadLine();
|
||||
process.WaitForExit();
|
||||
process.CancelOutputRead();
|
||||
process.CancelErrorRead();
|
||||
|
||||
return new ExitedProcess
|
||||
{
|
||||
ExitCode = process.ExitCode,
|
||||
Output = outputBuilder.ToString().Trim()
|
||||
};
|
||||
}
|
||||
|
||||
public static Process RunUnmanagedProcess(ProcessStartInfo startInfo)
|
||||
{
|
||||
Process process = new Process
|
||||
{
|
||||
StartInfo = startInfo
|
||||
};
|
||||
process.Start();
|
||||
process.WaitForExit();
|
||||
return process;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace CleanFlashCommon.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CleanFlashCommon.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to [HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION]
|
||||
///"FlashHelperService.exe"=-
|
||||
///
|
||||
///[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Control Panel\Extended Properties\System.ControlPanel.Category]
|
||||
///"${SYSTEM_64_PATH}\\FlashPlayerCPLApp.cpl"=-
|
||||
///
|
||||
///[-HKEY_CURRENT_USER\Software\FlashCenter]
|
||||
///[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\FlashCenter.exe]
|
||||
///[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninsta [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string uninstallRegistry {
|
||||
get {
|
||||
return ResourceManager.GetString("uninstallRegistry", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to [HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION]
|
||||
///"FlashHelperService.exe"=-
|
||||
///
|
||||
///[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Control Panel\Extended Properties\System.ControlPanel.Category]
|
||||
///"${SYSTEM_32_PATH}\\FlashPlayerCPLApp.cpl"=-
|
||||
///
|
||||
///[-HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node\CLSID\{B019E3BF-E7E5-453C-A2E4-D2C18CA0866F}]
|
||||
///[-HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node\CLSID\{D27CDB6E-AE6D-11cf-96B8- [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string uninstallRegistry64 {
|
||||
get {
|
||||
return ResourceManager.GetString("uninstallRegistry64", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,249 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="uninstallRegistry" xml:space="preserve">
|
||||
<value>[HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION]
|
||||
"FlashHelperService.exe"=-
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Control Panel\Extended Properties\System.ControlPanel.Category]
|
||||
"${SYSTEM_64_PATH}\\FlashPlayerCPLApp.cpl"=-
|
||||
|
||||
[-HKEY_CURRENT_USER\Software\FlashCenter]
|
||||
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\FlashCenter.exe]
|
||||
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\FlashCenter]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\AppID\{119DA84B-E3DB-4D47-A8DD-7FF6D5804689}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\AppID\{B9020634-CE8F-4F09-9FBC-D108A73A4676}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\TypeLib\{37EF68ED-16D3-4191-86BF-AB731D75AAB7}]
|
||||
[-HKEY_LOCAL_MACHINE\System\ControlSet001\services\Flash Helper Service]
|
||||
[-HKEY_LOCAL_MACHINE\System\ControlSet001\services\FlashCenterService]
|
||||
[-HKEY_LOCAL_MACHINE\System\CurrentControlSet\services\Flash Helper Service]
|
||||
[-HKEY_LOCAL_MACHINE\System\CurrentControlSet\services\FlashCenterService]
|
||||
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\MacromediaFlashPaper.MacromediaFlashPaper]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Low Rights\ElevationPolicy\{FAF199D2-BFA7-4394-A4DE-044A08E59B32}]
|
||||
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashPlayerUpdateService.exe]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashUtil32_${VERSION_PATH}_ActiveX.exe]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashUtil64_${VERSION_PATH}_ActiveX.exe]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashUtil32_${VERSION_PATH}_Plugin.exe]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashUtil64_${VERSION_PATH}_Plugin.exe]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashPlayerPlugin_${VERSION_PATH}.exe]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashUtil32_${VERSION_PATH}_pepper.exe]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashUtil64_${VERSION_PATH}_pepper.exe]
|
||||
|
||||
[-HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Internet Explorer\Low Rights\ElevationPolicy\{FAF199D2-BFA7-4394-A4DE-044A08E59B32}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player ActiveX]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player NPAPI]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player PPAPI]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Clean Flash Player]
|
||||
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\.mfp]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\.sol]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\.sor]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\.spl]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\.swf]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\AppID\{B9020634-CE8F-4F09-9FBC-D108A73A4676}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\CLSID\{B019E3BF-E7E5-453C-A2E4-D2C18CA0866F}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\CLSID\{D27CDB6E-AE6D-11cf-96B8-444553540000}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\FlashFactory.FlashFactory]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\FlashFactory.FlashFactory.1]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Interface\{299817DA-1FAC-4CE2-8F48-A108237013BD}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Interface\{307F64C0-621D-4D56-BBC6-91EFC13CE40D}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Interface\{57A0E747-3863-4D20-A811-950C84F1DB9B}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Interface\{86230738-D762-4C50-A2DE-A753E5B1686F}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Interface\{D27CDB6C-AE6D-11CF-96B8-444553540000}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Interface\{D27CDB6D-AE6D-11CF-96B8-444553540000}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\MIME\Database\Content Type\application/futuresplash]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\MIME\Database\Content Type\application/x-shockwave-flash]
|
||||
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.1]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.2]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.3]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.4]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.5]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.6]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.7]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.8]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.9]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.10]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.11]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.12]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.13]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.14]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.15]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.16]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.17]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.18]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.19]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.20]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.21]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.22]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.23]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.24]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.25]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.26]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.27]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.28]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.29]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.30]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.31]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.32]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.33]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.34]
|
||||
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\TypeLib\{57A0E746-3863-4D20-A811-950C84F1DB9B}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\TypeLib\{D27CDB6B-AE6D-11CF-96B8-444553540000}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\TypeLib\{FAB3E735-69C7-453B-A446-B6823C6DF1C9}]
|
||||
|
||||
[-HKEY_LOCAL_MACHINE\Software\Macromedia]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\ActiveX Compatibility\{D27CDB6E-AE6D-11CF-96B8-444553540000}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\ActiveX Compatibility\{D27CDB70-AE6D-11cf-96B8-444553540000}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\NavigatorPluginsList\Shockwave Flash]
|
||||
|
||||
[-HKEY_LOCAL_MACHINE\Software\MozillaPlugins\@adobe.com/FlashPlayer]
|
||||
|
||||
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\miniconfig]
|
||||
[-HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\miniconfig]</value>
|
||||
</data>
|
||||
<data name="uninstallRegistry64" xml:space="preserve">
|
||||
<value>[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION]
|
||||
"FlashHelperService.exe"=-
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Control Panel\Extended Properties\System.ControlPanel.Category]
|
||||
"${SYSTEM_32_PATH}\\FlashPlayerCPLApp.cpl"=-
|
||||
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node\CLSID\{B019E3BF-E7E5-453C-A2E4-D2C18CA0866F}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node\CLSID\{D27CDB6E-AE6D-11cf-96B8-444553540000}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node\CLSID\{D27CDB70-AE6D-11cf-96B8-444553540000}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node\Interface\{299817DA-1FAC-4CE2-8F48-A108237013BD}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node\Interface\{307F64C0-621D-4D56-BBC6-91EFC13CE40D}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node\Interface\{57A0E747-3863-4D20-A811-950C84F1DB9B}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node\Interface\{86230738-D762-4C50-A2DE-A753E5B1686F}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node\Interface\{D27CDB6C-AE6D-11CF-96B8-444553540000}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node\Interface\{D27CDB6D-AE6D-11CF-96B8-444553540000}]
|
||||
|
||||
[-HKEY_LOCAL_MACHINE\Software\Wow6432Node\Macromedia]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Internet Explorer\ActiveX Compatibility\{D27CDB6E-AE6D-11CF-96B8-444553540000}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Internet Explorer\ActiveX Compatibility\{D27CDB70-AE6D-11cf-96B8-444553540000}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Internet Explorer\NavigatorPluginsList\Shockwave Flash]
|
||||
|
||||
[-HKEY_LOCAL_MACHINE\Software\Wow6432Node\MozillaPlugins\@adobe.com/FlashPlayer]</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,33 +0,0 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace CleanFlashCommon {
|
||||
public class RedirectionManager {
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
static extern bool Wow64DisableWow64FsRedirection(ref IntPtr ptr);
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
static extern bool Wow64RevertWow64FsRedirection(IntPtr ptr);
|
||||
|
||||
public static IntPtr DisableRedirection() {
|
||||
IntPtr redirectionPtr = (IntPtr)(-1);
|
||||
|
||||
try {
|
||||
Wow64DisableWow64FsRedirection(ref redirectionPtr);
|
||||
} catch {
|
||||
// No Wow64 redirection possible.
|
||||
}
|
||||
|
||||
return redirectionPtr;
|
||||
}
|
||||
|
||||
public static void EnableRedirection(IntPtr redirectionPtr) {
|
||||
try {
|
||||
Wow64RevertWow64FsRedirection(redirectionPtr);
|
||||
} catch {
|
||||
// No Wow64 redirection possible.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace CleanFlashCommon {
|
||||
public class RegistryManager {
|
||||
|
||||
public static void ApplyRegistry(string registryContents) {
|
||||
registryContents = "Windows Registry Editor Version 5.00\n\n" + SystemInfo.FillString(registryContents);
|
||||
string filename = Path.GetTempFileName();
|
||||
|
||||
File.WriteAllText(filename, registryContents, Encoding.Unicode);
|
||||
|
||||
Directory.SetCurrentDirectory(Path.GetDirectoryName(filename));
|
||||
|
||||
ExitedProcess process = ProcessUtils.RunProcess(
|
||||
new ProcessStartInfo {
|
||||
FileName = "reg.exe",
|
||||
Arguments = "import " + Path.GetFileName(filename),
|
||||
UseShellExecute = false,
|
||||
CreateNoWindow = true
|
||||
}
|
||||
);
|
||||
|
||||
File.Delete(filename);
|
||||
|
||||
if (!process.IsSuccessful) {
|
||||
throw new InstallException(string.Format("Failed to apply changes to registry: error code {0}\n\n{1}", process.ExitCode, process.Output));
|
||||
}
|
||||
}
|
||||
|
||||
public static void ApplyRegistry(List<string> registryContents) {
|
||||
ApplyRegistry(string.Join("\n\n", registryContents));
|
||||
}
|
||||
|
||||
public static void ApplyRegistry(params string[] registryContents) {
|
||||
ApplyRegistry(string.Join("\n\n", registryContents));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,164 +0,0 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CleanFlashCommon {
|
||||
public class SmoothProgressBar : UserControl {
|
||||
int min = 0;
|
||||
int max = 100;
|
||||
int val = 0;
|
||||
Color Color1 = Color.Black;
|
||||
Color Color2 = Color.White;
|
||||
|
||||
protected override void OnResize(EventArgs e) {
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
protected override void OnPaint(PaintEventArgs e) {
|
||||
using (Graphics graphics = e.Graphics) {
|
||||
using (Brush brush = new LinearGradientBrush(ClientRectangle, Color1, Color2, 0.0F)) {
|
||||
float percent = (val - min) / (float)(max - min);
|
||||
Rectangle rect = ClientRectangle;
|
||||
|
||||
// Calculate area for drawing the progress.
|
||||
rect.Width = (int)(rect.Width * percent);
|
||||
|
||||
// Draw the progress meter.
|
||||
graphics.FillRectangle(brush, rect);
|
||||
}
|
||||
|
||||
// Draw a three-dimensional border around the control.
|
||||
Draw3DBorder(graphics);
|
||||
}
|
||||
}
|
||||
|
||||
public int Minimum {
|
||||
get {
|
||||
return min;
|
||||
}
|
||||
|
||||
set {
|
||||
min = Math.Max(0, Math.Min(max, value));
|
||||
|
||||
if (val < min) {
|
||||
val = min;
|
||||
}
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
public int Maximum {
|
||||
get {
|
||||
return max;
|
||||
}
|
||||
|
||||
set {
|
||||
if (value < min) {
|
||||
min = value;
|
||||
}
|
||||
|
||||
max = value;
|
||||
|
||||
if (val > max) {
|
||||
val = max;
|
||||
}
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
public int Value {
|
||||
get {
|
||||
return val;
|
||||
}
|
||||
|
||||
set {
|
||||
int oldValue = val;
|
||||
|
||||
// Make sure that the value does not stray outside the valid range.
|
||||
if (value < min) {
|
||||
val = min;
|
||||
} else if (value > max) {
|
||||
val = max;
|
||||
} else {
|
||||
val = value;
|
||||
}
|
||||
|
||||
// Invalidate only the changed area.
|
||||
float percent;
|
||||
|
||||
Rectangle newValueRect = ClientRectangle;
|
||||
Rectangle oldValueRect = ClientRectangle;
|
||||
|
||||
// Use a new value to calculate the rectangle for progress.
|
||||
percent = (val - min) / (float)(max - min);
|
||||
newValueRect.Width = (int)(newValueRect.Width * percent);
|
||||
|
||||
// Use an old value to calculate the rectangle for progress.
|
||||
percent = (oldValue - min) / (float)(max - min);
|
||||
oldValueRect.Width = (int)(oldValueRect.Width * percent);
|
||||
|
||||
Rectangle updateRect = new Rectangle();
|
||||
|
||||
// Find only the part of the screen that must be updated.
|
||||
if (newValueRect.Width > oldValueRect.Width) {
|
||||
updateRect.X = oldValueRect.Size.Width;
|
||||
updateRect.Width = newValueRect.Width - oldValueRect.Width;
|
||||
} else {
|
||||
updateRect.X = newValueRect.Size.Width;
|
||||
updateRect.Width = oldValueRect.Width - newValueRect.Width;
|
||||
}
|
||||
|
||||
updateRect.Height = Height;
|
||||
|
||||
// Invalidate the intersection region only.
|
||||
Invalidate(updateRect);
|
||||
}
|
||||
}
|
||||
|
||||
public Color ProgressBarColor1 {
|
||||
get {
|
||||
return Color1;
|
||||
}
|
||||
|
||||
set {
|
||||
Color1 = value;
|
||||
|
||||
// Invalidate the control to get a repaint.
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
public Color ProgressBarColor2 {
|
||||
get {
|
||||
return Color2;
|
||||
}
|
||||
|
||||
set {
|
||||
Color2 = value;
|
||||
|
||||
// Invalidate the control to get a repaint.
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
private void Draw3DBorder(Graphics g) {
|
||||
int PenWidth = (int)Pens.White.Width;
|
||||
|
||||
g.DrawLine(Pens.DarkGray,
|
||||
new Point(ClientRectangle.Left, ClientRectangle.Top),
|
||||
new Point(ClientRectangle.Width - PenWidth, ClientRectangle.Top));
|
||||
g.DrawLine(Pens.DarkGray,
|
||||
new Point(ClientRectangle.Left, ClientRectangle.Top),
|
||||
new Point(ClientRectangle.Left, ClientRectangle.Height - PenWidth));
|
||||
g.DrawLine(Pens.White,
|
||||
new Point(ClientRectangle.Left, ClientRectangle.Height - PenWidth),
|
||||
new Point(ClientRectangle.Width - PenWidth, ClientRectangle.Height - PenWidth));
|
||||
g.DrawLine(Pens.White,
|
||||
new Point(ClientRectangle.Width - PenWidth, ClientRectangle.Top),
|
||||
new Point(ClientRectangle.Width - PenWidth, ClientRectangle.Height - PenWidth));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace CleanFlashCommon {
|
||||
public class SystemInfo {
|
||||
|
||||
private static string system32Path = Environment.GetFolderPath(Environment.SpecialFolder.SystemX86);
|
||||
private static string system64Path = Environment.GetFolderPath(Environment.SpecialFolder.System);
|
||||
private static string program32Path = Environment.GetEnvironmentVariable("PROGRAMFILES(X86)") ?? Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
|
||||
private static string flashProgram32Path = Path.Combine(program32Path, "Flash Player");
|
||||
private static string macromed32Path = Path.Combine(system32Path, "Macromed");
|
||||
private static string macromed64Path = Path.Combine(system64Path, "Macromed");
|
||||
private static string flash32Path = Path.Combine(macromed32Path, "Flash");
|
||||
private static string flash64Path = Path.Combine(macromed64Path, "Flash");
|
||||
private static string version = UpdateChecker.GetFlashVersion();
|
||||
private static string versionPath = version.Replace(".", "_");
|
||||
private static string versionComma = version.Replace(".", ",");
|
||||
private static Dictionary<string, string> replacementStrings = new Dictionary<string, string>() {
|
||||
{ "${SYSTEM_32_PATH}", system32Path.Replace(@"\", @"\\") },
|
||||
{ "${SYSTEM_64_PATH}", system64Path.Replace(@"\", @"\\") },
|
||||
{ "${PROGRAM_32_PATH}", program32Path.Replace(@"\", @"\\") },
|
||||
{ "${PROGRAM_FLASH_32_PATH}", flashProgram32Path.Replace(@"\", @"\\") },
|
||||
{ "${FLASH_32_PATH}", flash32Path.Replace(@"\", @"\\") },
|
||||
{ "${FLASH_64_PATH}", flash64Path.Replace(@"\", @"\\") },
|
||||
{ "${VERSION}", version },
|
||||
{ "${VERSION_PATH}", versionPath },
|
||||
{ "${VERSION_COMMA}", versionComma },
|
||||
{ "${ARCH}", Environment.Is64BitOperatingSystem ? "64" : "32" }
|
||||
};
|
||||
|
||||
public static string GetSystem32Path() {
|
||||
return system32Path;
|
||||
}
|
||||
|
||||
public static string GetSystem64Path() {
|
||||
return system64Path;
|
||||
}
|
||||
|
||||
public static string GetProgram32Path()
|
||||
{
|
||||
return program32Path;
|
||||
}
|
||||
|
||||
public static string GetProgramFlash32Path()
|
||||
{
|
||||
return flashProgram32Path;
|
||||
}
|
||||
|
||||
public static string[] GetSystemPaths() {
|
||||
if (Environment.Is64BitOperatingSystem) {
|
||||
return new string[] { system32Path, system64Path };
|
||||
} else {
|
||||
return new string[] { system32Path };
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetMacromed32Path() {
|
||||
return macromed32Path;
|
||||
}
|
||||
|
||||
public static string GetMacromed64Path() {
|
||||
return macromed64Path;
|
||||
}
|
||||
|
||||
public static string[] GetMacromedPaths() {
|
||||
if (Environment.Is64BitOperatingSystem) {
|
||||
return new string[] { macromed32Path, macromed64Path };
|
||||
} else {
|
||||
return new string[] { macromed32Path };
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetFlash32Path() {
|
||||
return flash32Path;
|
||||
}
|
||||
|
||||
public static string GetFlash64Path() {
|
||||
return flash64Path;
|
||||
}
|
||||
|
||||
public static string GetVersionPath() {
|
||||
return versionPath;
|
||||
}
|
||||
|
||||
public static bool IsLegacyWindows() {
|
||||
System.Version version = Environment.OSVersion.Version;
|
||||
|
||||
return version.Major <= 6 && (version.Major != 6 || version.Minor < 2);
|
||||
}
|
||||
|
||||
public static Dictionary<string, string> GetReplacementStrings() {
|
||||
return replacementStrings;
|
||||
}
|
||||
|
||||
public static string FillString(string str) {
|
||||
// Some registry values require special strings to be filled out.
|
||||
foreach (KeyValuePair<string, string> pair in replacementStrings) {
|
||||
str = str.Replace(pair.Key, pair.Value);
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,217 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace CleanFlashCommon {
|
||||
public class Uninstaller {
|
||||
private static string[] PROCESSES_TO_KILL = new string[] {
|
||||
// Flash Center-related processes
|
||||
"fcbrowser", "fcbrowsermanager", "fclogin", "fctips", "flashcenter",
|
||||
"flashcenterservice", "flashcenteruninst", "flashplay", "update", "wow_helper",
|
||||
"dummy_cmd", "flashhelperservice",
|
||||
// Flash Player-related processes
|
||||
"flashplayerapp", "flashplayer_sa", "flashplayer_sa_debug"
|
||||
};
|
||||
private static string[] CONDITIONAL_PROCESSES = new string[]
|
||||
{
|
||||
// Plugin container for Firefox
|
||||
"plugin-container",
|
||||
// Browsers that might be using Flash Player right now
|
||||
"opera", "iexplore", "chrome", "chromium", "brave", "vivaldi", "msedge"
|
||||
};
|
||||
|
||||
static Uninstaller() {
|
||||
WinAPI.AllowModifications();
|
||||
}
|
||||
|
||||
public static void UnregisterActiveX(string filename) {
|
||||
string relativeFilename = Path.GetFileName(filename);
|
||||
ProcessStartInfo info = new ProcessStartInfo {
|
||||
FileName = "regsvr32.exe",
|
||||
UseShellExecute = false,
|
||||
CreateNoWindow = true
|
||||
};
|
||||
|
||||
Directory.SetCurrentDirectory(Path.GetDirectoryName(filename));
|
||||
|
||||
info.Arguments = "/s /u " + relativeFilename;
|
||||
ExitedProcess process = ProcessUtils.RunProcess(info);
|
||||
|
||||
if (!process.IsSuccessful) {
|
||||
throw new InstallException(string.Format("Failed to unregister ActiveX plugin: error code {0}\n\n{1}", process.ExitCode, process.Output));
|
||||
}
|
||||
}
|
||||
|
||||
public static void UninstallRegistry() {
|
||||
if (Environment.Is64BitOperatingSystem) {
|
||||
RegistryManager.ApplyRegistry(Properties.Resources.uninstallRegistry, Properties.Resources.uninstallRegistry64);
|
||||
} else {
|
||||
RegistryManager.ApplyRegistry(Properties.Resources.uninstallRegistry);
|
||||
}
|
||||
}
|
||||
|
||||
public static void DeleteTask(string task) {
|
||||
ProcessUtils.RunUnmanagedProcess(
|
||||
new ProcessStartInfo {
|
||||
FileName = "schtasks.exe",
|
||||
Arguments = "/delete /tn \"" + task + "\" /f",
|
||||
UseShellExecute = false,
|
||||
CreateNoWindow = true
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public static void StopService(string service) {
|
||||
ProcessUtils.RunUnmanagedProcess(
|
||||
new ProcessStartInfo {
|
||||
FileName = "net.exe",
|
||||
Arguments = "stop \"" + service + "\"",
|
||||
UseShellExecute = false,
|
||||
CreateNoWindow = true
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public static void DeleteService(string service) {
|
||||
// First, stop the service.
|
||||
StopService(service);
|
||||
|
||||
ProcessUtils.RunUnmanagedProcess(
|
||||
new ProcessStartInfo {
|
||||
FileName = "sc.exe",
|
||||
Arguments = "delete \"" + service + "\"",
|
||||
UseShellExecute = false,
|
||||
CreateNoWindow = true
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public static void DeleteFlashCenter() {
|
||||
// Remove Flash Center from Program Files
|
||||
FileUtil.WipeFolder(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "FlashCenter"));
|
||||
|
||||
if (Environment.Is64BitOperatingSystem) {
|
||||
// Remove Flash Center from Program Files (x86)
|
||||
FileUtil.WipeFolder(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), "FlashCenter"));
|
||||
}
|
||||
|
||||
// Remove start menu shortcuts
|
||||
FileUtil.WipeFolder(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Microsoft", "Windows", "Start Menu", "Programs", "Flash Center"));
|
||||
|
||||
// Remove Flash Center cache and user data
|
||||
FileUtil.WipeFolder(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Flash_Center"));
|
||||
|
||||
// Remove shared start menu shortcuts
|
||||
FileUtil.WipeFolder(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonStartMenu), "Programs", "Flash Center"));
|
||||
FileUtil.WipeFolder(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu), "Programs", "Flash Center"));
|
||||
FileUtil.DeleteFile(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu), "Flash Player.lnk"));
|
||||
|
||||
// Remove Desktop shortcut
|
||||
FileUtil.DeleteFile(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonDesktopDirectory), "Flash Center.lnk"));
|
||||
FileUtil.DeleteFile(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), "Flash Player.lnk"));
|
||||
|
||||
// Remove Flash Player from Program Files
|
||||
FileUtil.WipeFolder(SystemInfo.GetProgramFlash32Path());
|
||||
|
||||
// Remove spyware dropped by Flash Center in the temporary folder
|
||||
string tempFolder = Path.GetTempPath();
|
||||
|
||||
foreach (string dir in Directory.GetDirectories(tempFolder)) {
|
||||
string parentName = Path.GetFileName(dir);
|
||||
|
||||
if (parentName.Length == 11 && parentName.EndsWith(".tmp")) {
|
||||
try {
|
||||
FileUtil.WipeFolder(dir);
|
||||
} catch {
|
||||
// Oh well...
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Remove Quick Launch shortcuts from Internet Explorer
|
||||
FileUtil.RecursiveDelete(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Microsoft", "Internet Explorer", "Quick Launch"), "Flash Center.lnk");
|
||||
}
|
||||
|
||||
public static void DeleteFlashPlayer() {
|
||||
// Remove Macromedia folder from System32 and SysWOW64
|
||||
foreach (string dir in SystemInfo.GetMacromedPaths()) {
|
||||
FileUtil.RecursiveDelete(dir);
|
||||
}
|
||||
|
||||
// Remove Flash Player control panel applications
|
||||
foreach (string systemDir in SystemInfo.GetSystemPaths()) {
|
||||
FileUtil.DeleteFile(Path.Combine(systemDir, "FlashPlayerApp.exe"));
|
||||
FileUtil.DeleteFile(Path.Combine(systemDir, "FlashPlayerCPLApp.cpl"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static bool ShouldKillConditionalProcess(Process process) {
|
||||
if (!CONDITIONAL_PROCESSES.Contains(process.ProcessName.ToLower())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach (string module in ProcessUtils.CollectModules(process)) {
|
||||
if (Regex.IsMatch(module, "^(flash(32|64)|libpepflash|npswf)", RegexOptions.Compiled | RegexOptions.IgnoreCase)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void StopProcesses() {
|
||||
// Stop all processes that might interfere with the install process
|
||||
List<Process> processes = Process.GetProcesses()
|
||||
.Where(process => PROCESSES_TO_KILL.Contains(process.ProcessName.ToLower()) || ShouldKillConditionalProcess(process))
|
||||
.OrderBy(o => o.StartTime)
|
||||
.ToList();
|
||||
|
||||
foreach (Process process in processes) {
|
||||
if (process.HasExited) {
|
||||
// This process has already exited, no point to kill it
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
process.Kill();
|
||||
process.WaitForExit();
|
||||
} catch {
|
||||
// Could not kill process...
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Uninstall(IProgressForm form) {
|
||||
// Uninstallation of Flash consists of the following steps:
|
||||
// 1. Delete all auto-updater tasks.
|
||||
// 2. Delete all Flash Player services.
|
||||
// 3. Delete all Flash Center services.
|
||||
// 4. Exit all browsers and other processes that may interfere with uninstallation.
|
||||
// 5. Remove all Flash Player references from the registry.
|
||||
// 6. Remove Flash Center files from the file system.
|
||||
// 7. Remove Flash Player files from the file system.
|
||||
|
||||
form.UpdateProgressLabel("Stopping Flash auto-updater task...", true);
|
||||
DeleteTask("Adobe Flash Player Updater");
|
||||
form.UpdateProgressLabel("Stopping Flash auto-updater service...", true);
|
||||
DeleteService("AdobeFlashPlayerUpdateSvc");
|
||||
form.UpdateProgressLabel("Stopping Flash Center services...", true);
|
||||
DeleteService("Flash Helper Service");
|
||||
form.TickProgress();
|
||||
DeleteService("FlashCenterService");
|
||||
|
||||
form.UpdateProgressLabel("Exiting all browsers...", true);
|
||||
StopProcesses();
|
||||
form.UpdateProgressLabel("Cleaning up registry...", true);
|
||||
UninstallRegistry();
|
||||
form.UpdateProgressLabel("Removing Flash Center...", true);
|
||||
DeleteFlashCenter();
|
||||
form.UpdateProgressLabel("Removing Flash Player...", true);
|
||||
DeleteFlashPlayer();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Net;
|
||||
using System.Runtime.Serialization.Json;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace CleanFlashCommon {
|
||||
public class Version {
|
||||
private string name;
|
||||
private string version;
|
||||
private string url;
|
||||
|
||||
public Version(string name, string version, string url) {
|
||||
this.name = name;
|
||||
this.version = version;
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public string GetName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public string GetVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public string GetUrl() {
|
||||
return url;
|
||||
}
|
||||
}
|
||||
|
||||
public class UpdateChecker {
|
||||
private static readonly string FLASH_VERSION = "34.0.0.330";
|
||||
private static readonly string VERSION = "34.0.0.330";
|
||||
private static readonly string AUTHOR = "cleanflash";
|
||||
private static readonly string REPO = "installer";
|
||||
private static readonly string USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36";
|
||||
|
||||
public static string GetAPILink() {
|
||||
return "https://api.github.com/repos/" + AUTHOR + "/" + REPO + "/releases/latest";
|
||||
// obsolete, todo: switch to new api
|
||||
}
|
||||
|
||||
public static string GetFlashVersion() {
|
||||
return FLASH_VERSION;
|
||||
}
|
||||
|
||||
public static string GetCurrentVersion() {
|
||||
return VERSION;
|
||||
}
|
||||
|
||||
private static Version GetLatestVersionUnsafe() {
|
||||
using (WebClient client = new WebClient()) {
|
||||
client.Headers.Add("user-agent", USER_AGENT);
|
||||
|
||||
string release = client.DownloadString(GetAPILink());
|
||||
XmlDictionaryReader jsonReader = JsonReaderWriterFactory.CreateJsonReader(Encoding.UTF8.GetBytes(release), new XmlDictionaryReaderQuotas());
|
||||
XElement root = XElement.Load(jsonReader);
|
||||
|
||||
string name = root.Descendants("name").FirstOrDefault().Value;
|
||||
string tag = root.Descendants("tag_name").FirstOrDefault().Value;
|
||||
string url = root.Descendants("html_url").FirstOrDefault().Value;
|
||||
|
||||
if (!url.StartsWith("https://")) {
|
||||
// This is a suspicious URL... We shouldn't trust it.
|
||||
return null;
|
||||
}
|
||||
|
||||
return new Version(name, tag, url);
|
||||
}
|
||||
}
|
||||
|
||||
public static Version GetLatestVersion() {
|
||||
try {
|
||||
return GetLatestVersionUnsafe();
|
||||
} catch (Exception e) {
|
||||
Console.WriteLine(e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Principal;
|
||||
|
||||
namespace CleanFlashCommon {
|
||||
public class WinAPI {
|
||||
|
||||
public static void AllowModifications() {
|
||||
ModifyPrivilege(PrivilegeName.SeRestorePrivilege, true);
|
||||
ModifyPrivilege(PrivilegeName.SeTakeOwnershipPrivilege, true);
|
||||
}
|
||||
|
||||
public static bool ModifyPrivilege(PrivilegeName privilege, bool enable) {
|
||||
LUID luid;
|
||||
|
||||
if (!LookupPrivilegeValue(null, privilege.ToString(), out luid)) {
|
||||
throw new Win32Exception();
|
||||
}
|
||||
|
||||
using (var identity = WindowsIdentity.GetCurrent(TokenAccessLevels.AdjustPrivileges | TokenAccessLevels.Query)) {
|
||||
var newPriv = new TOKEN_PRIVILEGES();
|
||||
newPriv.Privileges = new LUID_AND_ATTRIBUTES[1];
|
||||
newPriv.PrivilegeCount = 1;
|
||||
newPriv.Privileges[0].Luid = luid;
|
||||
newPriv.Privileges[0].Attributes = enable ? SE_PRIVILEGE_ENABLED : 0;
|
||||
|
||||
var prevPriv = new TOKEN_PRIVILEGES();
|
||||
prevPriv.Privileges = new LUID_AND_ATTRIBUTES[1];
|
||||
prevPriv.PrivilegeCount = 1;
|
||||
uint returnedBytes;
|
||||
|
||||
if (!AdjustTokenPrivileges(identity.Token, false, ref newPriv, (uint)Marshal.SizeOf(prevPriv), ref prevPriv, out returnedBytes)) {
|
||||
throw new Win32Exception();
|
||||
}
|
||||
|
||||
return prevPriv.PrivilegeCount == 0 ? enable /* didn't make a change */ : ((prevPriv.Privileges[0].Attributes & SE_PRIVILEGE_ENABLED) != 0);
|
||||
}
|
||||
}
|
||||
|
||||
const uint SE_PRIVILEGE_ENABLED = 2;
|
||||
|
||||
[DllImport("advapi32.dll", SetLastError = true)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
static extern bool AdjustTokenPrivileges(IntPtr TokenHandle, [MarshalAs(UnmanagedType.Bool)] bool DisableAllPrivileges, ref TOKEN_PRIVILEGES NewState,
|
||||
UInt32 BufferLengthInBytes, ref TOKEN_PRIVILEGES PreviousState, out UInt32 ReturnLengthInBytes);
|
||||
|
||||
[DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Auto)]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
static extern bool LookupPrivilegeValue(string lpSystemName, string lpName, out LUID lpLuid);
|
||||
|
||||
struct TOKEN_PRIVILEGES {
|
||||
public UInt32 PrivilegeCount;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1 /*ANYSIZE_ARRAY*/)]
|
||||
public LUID_AND_ATTRIBUTES[] Privileges;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
struct LUID_AND_ATTRIBUTES {
|
||||
public LUID Luid;
|
||||
public UInt32 Attributes;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
struct LUID {
|
||||
public uint LowPart;
|
||||
public int HighPart;
|
||||
}
|
||||
}
|
||||
|
||||
public enum PrivilegeName {
|
||||
SeAssignPrimaryTokenPrivilege,
|
||||
SeAuditPrivilege,
|
||||
SeBackupPrivilege,
|
||||
SeChangeNotifyPrivilege,
|
||||
SeCreateGlobalPrivilege,
|
||||
SeCreatePagefilePrivilege,
|
||||
SeCreatePermanentPrivilege,
|
||||
SeCreateSymbolicLinkPrivilege,
|
||||
SeCreateTokenPrivilege,
|
||||
SeDebugPrivilege,
|
||||
SeEnableDelegationPrivilege,
|
||||
SeImpersonatePrivilege,
|
||||
SeIncreaseBasePriorityPrivilege,
|
||||
SeIncreaseQuotaPrivilege,
|
||||
SeIncreaseWorkingSetPrivilege,
|
||||
SeLoadDriverPrivilege,
|
||||
SeLockMemoryPrivilege,
|
||||
SeMachineAccountPrivilege,
|
||||
SeManageVolumePrivilege,
|
||||
SeProfileSingleProcessPrivilege,
|
||||
SeRelabelPrivilege,
|
||||
SeRemoteShutdownPrivilege,
|
||||
SeRestorePrivilege,
|
||||
SeSecurityPrivilege,
|
||||
SeShutdownPrivilege,
|
||||
SeSyncAgentPrivilege,
|
||||
SeSystemEnvironmentPrivilege,
|
||||
SeSystemProfilePrivilege,
|
||||
SeSystemtimePrivilege,
|
||||
SeTakeOwnershipPrivilege,
|
||||
SeTcbPrivilege,
|
||||
SeTimeZonePrivilege,
|
||||
SeTrustedCredManAccessPrivilege,
|
||||
SeUndockPrivilege,
|
||||
SeUnsolicitedInputPrivilege,
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 257 B |
|
Before Width: | Height: | Size: 448 B |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 115 KiB |
|
Before Width: | Height: | Size: 4.2 KiB |
@@ -1,65 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31205.134
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CleanFlashInstaller", "CleanFlashInstaller\CleanFlashInstaller.csproj", "{317B6619-2419-4778-95A2-1A97DC55AB83}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CleanFlashUninstaller", "CleanFlashUninstaller\CleanFlashUninstaller.csproj", "{E193EEA6-BE73-4E34-BEB0-E13AC8D30C5C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CleanFlashCommon", "CleanFlashCommon\CleanFlashCommon.csproj", "{D00F629B-455A-42DE-B2FA-A3759A3095AE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|Any CPU = Release|Any CPU
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{317B6619-2419-4778-95A2-1A97DC55AB83}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{317B6619-2419-4778-95A2-1A97DC55AB83}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{317B6619-2419-4778-95A2-1A97DC55AB83}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{317B6619-2419-4778-95A2-1A97DC55AB83}.Debug|x64.Build.0 = Debug|x64
|
||||
{317B6619-2419-4778-95A2-1A97DC55AB83}.Debug|x86.ActiveCfg = Debug|x86
|
||||
{317B6619-2419-4778-95A2-1A97DC55AB83}.Debug|x86.Build.0 = Debug|x86
|
||||
{317B6619-2419-4778-95A2-1A97DC55AB83}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{317B6619-2419-4778-95A2-1A97DC55AB83}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{317B6619-2419-4778-95A2-1A97DC55AB83}.Release|x64.ActiveCfg = Release|x64
|
||||
{317B6619-2419-4778-95A2-1A97DC55AB83}.Release|x64.Build.0 = Release|x64
|
||||
{317B6619-2419-4778-95A2-1A97DC55AB83}.Release|x86.ActiveCfg = Release|x86
|
||||
{317B6619-2419-4778-95A2-1A97DC55AB83}.Release|x86.Build.0 = Release|x86
|
||||
{E193EEA6-BE73-4E34-BEB0-E13AC8D30C5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E193EEA6-BE73-4E34-BEB0-E13AC8D30C5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E193EEA6-BE73-4E34-BEB0-E13AC8D30C5C}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{E193EEA6-BE73-4E34-BEB0-E13AC8D30C5C}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{E193EEA6-BE73-4E34-BEB0-E13AC8D30C5C}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{E193EEA6-BE73-4E34-BEB0-E13AC8D30C5C}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{E193EEA6-BE73-4E34-BEB0-E13AC8D30C5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E193EEA6-BE73-4E34-BEB0-E13AC8D30C5C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E193EEA6-BE73-4E34-BEB0-E13AC8D30C5C}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{E193EEA6-BE73-4E34-BEB0-E13AC8D30C5C}.Release|x64.Build.0 = Release|Any CPU
|
||||
{E193EEA6-BE73-4E34-BEB0-E13AC8D30C5C}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{E193EEA6-BE73-4E34-BEB0-E13AC8D30C5C}.Release|x86.Build.0 = Release|Any CPU
|
||||
{D00F629B-455A-42DE-B2FA-A3759A3095AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D00F629B-455A-42DE-B2FA-A3759A3095AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D00F629B-455A-42DE-B2FA-A3759A3095AE}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{D00F629B-455A-42DE-B2FA-A3759A3095AE}.Debug|x64.Build.0 = Debug|Any CPU
|
||||
{D00F629B-455A-42DE-B2FA-A3759A3095AE}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{D00F629B-455A-42DE-B2FA-A3759A3095AE}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{D00F629B-455A-42DE-B2FA-A3759A3095AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D00F629B-455A-42DE-B2FA-A3759A3095AE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D00F629B-455A-42DE-B2FA-A3759A3095AE}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{D00F629B-455A-42DE-B2FA-A3759A3095AE}.Release|x64.Build.0 = Release|Any CPU
|
||||
{D00F629B-455A-42DE-B2FA-A3759A3095AE}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{D00F629B-455A-42DE-B2FA-A3759A3095AE}.Release|x86.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {E3F04969-B085-46D9-A518-4264D1988548}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,69 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<RootNamespace>CleanFlashInstaller</RootNamespace>
|
||||
<AssemblyName>CleanFlashInstaller</AssemblyName>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net40</TargetFramework>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<StartupObject></StartupObject>
|
||||
<Product>Clean Flash Player 34.0.0.330 Installer</Product>
|
||||
<AssemblyTitle>Clean Flash Player 34.0.0.330 Installer</AssemblyTitle>
|
||||
<FileVersion>34.0.0.330</FileVersion>
|
||||
<AssemblyVersion>34.0.0.330</AssemblyVersion>
|
||||
<Version>34.0.0.330</Version>
|
||||
<Authors>FlashPatch Team</Authors>
|
||||
<Company>FlashPatch Team</Company>
|
||||
<ApplicationIcon>icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="cleanflash.7z" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="icon.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="cleanflash.7z" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ILRepack.Lib.MSBuild.Task" Version="2.0.18.2" />
|
||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net40" Version="1.0.3">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="SharpCompress" version="0.24.0" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CleanFlashCommon\CleanFlashCommon.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Settings.Designer.cs">
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Update="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'">
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<DebugType>None</DebugType>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,17 +0,0 @@
|
||||
namespace CleanFlashInstaller {
|
||||
public class InstallEntry {
|
||||
public string InstallText { get; }
|
||||
public InstallFlags RequiredFlags { get; }
|
||||
public string TargetDirectory { get; }
|
||||
public string RegistryInstructions { get; }
|
||||
|
||||
public InstallEntry(string installText, int requiredFlags, string targetDirectory, string registryInstructions) {
|
||||
InstallText = installText;
|
||||
RequiredFlags = new InstallFlags(requiredFlags);
|
||||
TargetDirectory = targetDirectory;
|
||||
RegistryInstructions = registryInstructions;
|
||||
}
|
||||
|
||||
public InstallEntry(string installText, int requiredFlags, string targetDirectory) : this(installText, requiredFlags, targetDirectory, null) { }
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace CleanFlashInstaller {
|
||||
public class InstallFlags {
|
||||
public static int NONE = 0;
|
||||
public static int PEPPER = 1 << 0;
|
||||
public static int NETSCAPE = 1 << 1;
|
||||
public static int ACTIVEX = 1 << 2;
|
||||
public static int PLAYER = 1 << 3;
|
||||
public static int PLAYER_START_MENU = 1 << 4;
|
||||
public static int PLAYER_DESKTOP = 1 << 5;
|
||||
public static int X64 = 1 << 6;
|
||||
public static int DEBUG = 1 << 7;
|
||||
|
||||
private static int UNINSTALL_TICKS = 9;
|
||||
private static int INSTALL_GENERAL_TICKS = 5;
|
||||
|
||||
private int value = 0;
|
||||
|
||||
public InstallFlags(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public InstallFlags() : this(0) { }
|
||||
|
||||
public int GetValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public bool IsSet(int flag) {
|
||||
return (value & flag) == flag;
|
||||
}
|
||||
|
||||
public bool IsSet(InstallFlags flags) {
|
||||
return IsSet(flags.GetValue());
|
||||
}
|
||||
|
||||
public bool IsNoneSet() {
|
||||
return value == 0;
|
||||
}
|
||||
|
||||
public void SetFlag(int flag) {
|
||||
value |= flag;
|
||||
}
|
||||
|
||||
public void SetConditionally(bool set, int flag) {
|
||||
if (set) {
|
||||
SetFlag(flag);
|
||||
}
|
||||
}
|
||||
|
||||
public int GetTicks() {
|
||||
int ticks = (IsSet(PEPPER) ? 1 : 0) + (IsSet(NETSCAPE) ? 1 : 0) + (IsSet(ACTIVEX) ? 2 : 0);
|
||||
|
||||
if (Environment.Is64BitOperatingSystem) {
|
||||
ticks *= 2;
|
||||
}
|
||||
|
||||
if (IsSet(PLAYER)) {
|
||||
ticks++;
|
||||
}
|
||||
|
||||
ticks += UNINSTALL_TICKS;
|
||||
ticks += INSTALL_GENERAL_TICKS;
|
||||
return ticks;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,692 +0,0 @@
|
||||
|
||||
namespace CleanFlashInstaller {
|
||||
partial class InstallForm {
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) {
|
||||
if (disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InstallForm));
|
||||
this.disclaimerLabel = new System.Windows.Forms.Label();
|
||||
this.separator = new System.Windows.Forms.Label();
|
||||
this.checkboxImages = new System.Windows.Forms.ImageList(this.components);
|
||||
this.flashLogo = new System.Windows.Forms.PictureBox();
|
||||
this.titleLabel = new System.Windows.Forms.Label();
|
||||
this.subtitleLabel = new System.Windows.Forms.Label();
|
||||
this.disclaimerPanel = new System.Windows.Forms.Panel();
|
||||
this.choicePanel = new System.Windows.Forms.Panel();
|
||||
this.activeXLabel = new System.Windows.Forms.Label();
|
||||
this.netscapeLabel = new System.Windows.Forms.Label();
|
||||
this.pepperLabel = new System.Windows.Forms.Label();
|
||||
this.browserAskLabel = new System.Windows.Forms.Label();
|
||||
this.installPanel = new System.Windows.Forms.Panel();
|
||||
this.progressLabel = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.beforeInstallPanel = new System.Windows.Forms.Panel();
|
||||
this.beforeInstallLabel = new System.Windows.Forms.Label();
|
||||
this.completePanel = new System.Windows.Forms.Panel();
|
||||
this.completeLabel = new System.Windows.Forms.LinkLabel();
|
||||
this.failurePanel = new System.Windows.Forms.Panel();
|
||||
this.failureBox = new System.Windows.Forms.TextBox();
|
||||
this.failureText = new System.Windows.Forms.Label();
|
||||
this.playerChoicePanel = new System.Windows.Forms.Panel();
|
||||
this.playerStartMenuLabel = new System.Windows.Forms.Label();
|
||||
this.playerDesktopLabel = new System.Windows.Forms.Label();
|
||||
this.playerLabel = new System.Windows.Forms.Label();
|
||||
this.playerAskLabel = new System.Windows.Forms.Label();
|
||||
this.nextButton = new CleanFlashCommon.GradientButton();
|
||||
this.prevButton = new CleanFlashCommon.GradientButton();
|
||||
this.playerStartMenuBox = new CleanFlashCommon.ImageCheckBox();
|
||||
this.playerDesktopBox = new CleanFlashCommon.ImageCheckBox();
|
||||
this.playerBox = new CleanFlashCommon.ImageCheckBox();
|
||||
this.activeXBox = new CleanFlashCommon.ImageCheckBox();
|
||||
this.netscapeBox = new CleanFlashCommon.ImageCheckBox();
|
||||
this.pepperBox = new CleanFlashCommon.ImageCheckBox();
|
||||
this.disclaimerBox = new CleanFlashCommon.ImageCheckBox();
|
||||
this.copyErrorButton = new CleanFlashCommon.GradientButton();
|
||||
this.progressBar = new CleanFlashCommon.SmoothProgressBar();
|
||||
this.debugChoicePanel = new System.Windows.Forms.Panel();
|
||||
this.debugAskLabel = new System.Windows.Forms.Label();
|
||||
this.debugButton = new CleanFlashCommon.GradientButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.flashLogo)).BeginInit();
|
||||
this.disclaimerPanel.SuspendLayout();
|
||||
this.choicePanel.SuspendLayout();
|
||||
this.installPanel.SuspendLayout();
|
||||
this.beforeInstallPanel.SuspendLayout();
|
||||
this.completePanel.SuspendLayout();
|
||||
this.failurePanel.SuspendLayout();
|
||||
this.playerChoicePanel.SuspendLayout();
|
||||
this.debugChoicePanel.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// disclaimerLabel
|
||||
//
|
||||
this.disclaimerLabel.AutoSize = true;
|
||||
this.disclaimerLabel.Location = new System.Drawing.Point(25, 0);
|
||||
this.disclaimerLabel.Name = "disclaimerLabel";
|
||||
this.disclaimerLabel.Size = new System.Drawing.Size(520, 85);
|
||||
this.disclaimerLabel.TabIndex = 0;
|
||||
this.disclaimerLabel.Text = resources.GetString("disclaimerLabel.Text");
|
||||
this.disclaimerLabel.Click += new System.EventHandler(this.disclaimerLabel_Click);
|
||||
//
|
||||
// separator
|
||||
//
|
||||
this.separator.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.separator.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
|
||||
this.separator.Location = new System.Drawing.Point(0, 270);
|
||||
this.separator.Name = "separator";
|
||||
this.separator.Size = new System.Drawing.Size(732, 1);
|
||||
this.separator.TabIndex = 1;
|
||||
//
|
||||
// checkboxImages
|
||||
//
|
||||
this.checkboxImages.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("checkboxImages.ImageStream")));
|
||||
this.checkboxImages.TransparentColor = System.Drawing.Color.Transparent;
|
||||
this.checkboxImages.Images.SetKeyName(0, "checkboxOff.png");
|
||||
this.checkboxImages.Images.SetKeyName(1, "checkboxOn.png");
|
||||
//
|
||||
// flashLogo
|
||||
//
|
||||
this.flashLogo.Image = global::CleanFlashInstaller.Properties.Resources.flashLogo;
|
||||
this.flashLogo.Location = new System.Drawing.Point(90, 36);
|
||||
this.flashLogo.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.flashLogo.Name = "flashLogo";
|
||||
this.flashLogo.Size = new System.Drawing.Size(109, 107);
|
||||
this.flashLogo.TabIndex = 4;
|
||||
this.flashLogo.TabStop = false;
|
||||
//
|
||||
// titleLabel
|
||||
//
|
||||
this.titleLabel.AutoSize = true;
|
||||
this.titleLabel.Font = new System.Drawing.Font("Segoe UI", 24F);
|
||||
this.titleLabel.Location = new System.Drawing.Point(233, 54);
|
||||
this.titleLabel.Name = "titleLabel";
|
||||
this.titleLabel.Size = new System.Drawing.Size(274, 45);
|
||||
this.titleLabel.TabIndex = 5;
|
||||
this.titleLabel.Text = "Clean Flash Player";
|
||||
//
|
||||
// subtitleLabel
|
||||
//
|
||||
this.subtitleLabel.AutoSize = true;
|
||||
this.subtitleLabel.Font = new System.Drawing.Font("Segoe UI", 13F);
|
||||
this.subtitleLabel.Location = new System.Drawing.Point(280, 99);
|
||||
this.subtitleLabel.Name = "subtitleLabel";
|
||||
this.subtitleLabel.Size = new System.Drawing.Size(231, 25);
|
||||
this.subtitleLabel.TabIndex = 6;
|
||||
this.subtitleLabel.Text = "built from unknown version";
|
||||
//
|
||||
// disclaimerPanel
|
||||
//
|
||||
this.disclaimerPanel.Controls.Add(this.disclaimerBox);
|
||||
this.disclaimerPanel.Controls.Add(this.disclaimerLabel);
|
||||
this.disclaimerPanel.Location = new System.Drawing.Point(90, 162);
|
||||
this.disclaimerPanel.Name = "disclaimerPanel";
|
||||
this.disclaimerPanel.Size = new System.Drawing.Size(545, 105);
|
||||
this.disclaimerPanel.TabIndex = 8;
|
||||
//
|
||||
// choicePanel
|
||||
//
|
||||
this.choicePanel.Controls.Add(this.activeXLabel);
|
||||
this.choicePanel.Controls.Add(this.activeXBox);
|
||||
this.choicePanel.Controls.Add(this.netscapeLabel);
|
||||
this.choicePanel.Controls.Add(this.netscapeBox);
|
||||
this.choicePanel.Controls.Add(this.pepperLabel);
|
||||
this.choicePanel.Controls.Add(this.pepperBox);
|
||||
this.choicePanel.Controls.Add(this.browserAskLabel);
|
||||
this.choicePanel.Location = new System.Drawing.Point(90, 162);
|
||||
this.choicePanel.Name = "choicePanel";
|
||||
this.choicePanel.Size = new System.Drawing.Size(545, 105);
|
||||
this.choicePanel.TabIndex = 9;
|
||||
//
|
||||
// activeXLabel
|
||||
//
|
||||
this.activeXLabel.AutoSize = true;
|
||||
this.activeXLabel.Location = new System.Drawing.Point(389, 47);
|
||||
this.activeXLabel.Name = "activeXLabel";
|
||||
this.activeXLabel.Size = new System.Drawing.Size(148, 34);
|
||||
this.activeXLabel.TabIndex = 8;
|
||||
this.activeXLabel.Text = "ActiveX (OCX)\r\n(IE/Embedded/Desktop)";
|
||||
this.activeXLabel.Click += new System.EventHandler(this.activeXLabel_Click);
|
||||
//
|
||||
// netscapeLabel
|
||||
//
|
||||
this.netscapeLabel.AutoSize = true;
|
||||
this.netscapeLabel.Location = new System.Drawing.Point(210, 47);
|
||||
this.netscapeLabel.Name = "netscapeLabel";
|
||||
this.netscapeLabel.Size = new System.Drawing.Size(131, 34);
|
||||
this.netscapeLabel.TabIndex = 6;
|
||||
this.netscapeLabel.Text = "Netscape API (NPAPI)\r\n(Firefox/ESR/Waterfox)\r\n";
|
||||
this.netscapeLabel.Click += new System.EventHandler(this.netscapeLabel_Click);
|
||||
//
|
||||
// pepperLabel
|
||||
//
|
||||
this.pepperLabel.AutoSize = true;
|
||||
this.pepperLabel.Location = new System.Drawing.Point(24, 47);
|
||||
this.pepperLabel.Name = "pepperLabel";
|
||||
this.pepperLabel.Size = new System.Drawing.Size(141, 34);
|
||||
this.pepperLabel.TabIndex = 4;
|
||||
this.pepperLabel.Text = "Pepper API (PPAPI)\r\n(Chrome/Opera/Brave)";
|
||||
this.pepperLabel.Click += new System.EventHandler(this.pepperLabel_Click);
|
||||
//
|
||||
// browserAskLabel
|
||||
//
|
||||
this.browserAskLabel.AutoSize = true;
|
||||
this.browserAskLabel.Location = new System.Drawing.Point(-2, 2);
|
||||
this.browserAskLabel.Name = "browserAskLabel";
|
||||
this.browserAskLabel.Size = new System.Drawing.Size(287, 17);
|
||||
this.browserAskLabel.TabIndex = 0;
|
||||
this.browserAskLabel.Text = "Which browser plugins would you like to install?";
|
||||
//
|
||||
// installPanel
|
||||
//
|
||||
this.installPanel.Controls.Add(this.progressBar);
|
||||
this.installPanel.Controls.Add(this.progressLabel);
|
||||
this.installPanel.Controls.Add(this.label2);
|
||||
this.installPanel.Location = new System.Drawing.Point(90, 162);
|
||||
this.installPanel.Name = "installPanel";
|
||||
this.installPanel.Size = new System.Drawing.Size(545, 105);
|
||||
this.installPanel.TabIndex = 10;
|
||||
//
|
||||
// progressLabel
|
||||
//
|
||||
this.progressLabel.AutoSize = true;
|
||||
this.progressLabel.Location = new System.Drawing.Point(46, 30);
|
||||
this.progressLabel.Name = "progressLabel";
|
||||
this.progressLabel.Size = new System.Drawing.Size(74, 17);
|
||||
this.progressLabel.TabIndex = 1;
|
||||
this.progressLabel.Text = "Preparing...";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(3, 0);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(150, 17);
|
||||
this.label2.TabIndex = 0;
|
||||
this.label2.Text = "Installation in progress...";
|
||||
//
|
||||
// beforeInstallPanel
|
||||
//
|
||||
this.beforeInstallPanel.Controls.Add(this.beforeInstallLabel);
|
||||
this.beforeInstallPanel.Location = new System.Drawing.Point(90, 162);
|
||||
this.beforeInstallPanel.Name = "beforeInstallPanel";
|
||||
this.beforeInstallPanel.Size = new System.Drawing.Size(545, 105);
|
||||
this.beforeInstallPanel.TabIndex = 11;
|
||||
//
|
||||
// beforeInstallLabel
|
||||
//
|
||||
this.beforeInstallLabel.AutoSize = true;
|
||||
this.beforeInstallLabel.Location = new System.Drawing.Point(3, 2);
|
||||
this.beforeInstallLabel.Name = "beforeInstallLabel";
|
||||
this.beforeInstallLabel.Size = new System.Drawing.Size(147, 17);
|
||||
this.beforeInstallLabel.TabIndex = 12;
|
||||
this.beforeInstallLabel.Text = "Allan please add details";
|
||||
//
|
||||
// completePanel
|
||||
//
|
||||
this.completePanel.Controls.Add(this.completeLabel);
|
||||
this.completePanel.Location = new System.Drawing.Point(90, 162);
|
||||
this.completePanel.Name = "completePanel";
|
||||
this.completePanel.Size = new System.Drawing.Size(545, 105);
|
||||
this.completePanel.TabIndex = 12;
|
||||
//
|
||||
// completeLabel
|
||||
//
|
||||
this.completeLabel.AutoSize = true;
|
||||
this.completeLabel.LinkArea = new System.Windows.Forms.LinkArea(0, 0);
|
||||
this.completeLabel.LinkColor = System.Drawing.Color.White;
|
||||
this.completeLabel.Location = new System.Drawing.Point(0, 0);
|
||||
this.completeLabel.Name = "completeLabel";
|
||||
this.completeLabel.Size = new System.Drawing.Size(168, 17);
|
||||
this.completeLabel.TabIndex = 0;
|
||||
this.completeLabel.Text = "Allan where are the details?";
|
||||
this.completeLabel.VisitedLinkColor = System.Drawing.Color.White;
|
||||
this.completeLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.completeLabel_LinkClicked);
|
||||
//
|
||||
// failurePanel
|
||||
//
|
||||
this.failurePanel.Controls.Add(this.copyErrorButton);
|
||||
this.failurePanel.Controls.Add(this.failureBox);
|
||||
this.failurePanel.Controls.Add(this.failureText);
|
||||
this.failurePanel.Location = new System.Drawing.Point(90, 162);
|
||||
this.failurePanel.Name = "failurePanel";
|
||||
this.failurePanel.Size = new System.Drawing.Size(545, 105);
|
||||
this.failurePanel.TabIndex = 13;
|
||||
//
|
||||
// failureBox
|
||||
//
|
||||
this.failureBox.Location = new System.Drawing.Point(4, 44);
|
||||
this.failureBox.Multiline = true;
|
||||
this.failureBox.Name = "failureBox";
|
||||
this.failureBox.ReadOnly = true;
|
||||
this.failureBox.Size = new System.Drawing.Size(431, 58);
|
||||
this.failureBox.TabIndex = 15;
|
||||
//
|
||||
// failureText
|
||||
//
|
||||
this.failureText.AutoSize = true;
|
||||
this.failureText.Location = new System.Drawing.Point(3, 2);
|
||||
this.failureText.Name = "failureText";
|
||||
this.failureText.Size = new System.Drawing.Size(432, 34);
|
||||
this.failureText.TabIndex = 14;
|
||||
this.failureText.Text = "Oops! The installation process has encountered an unexpected problem.\r\nThe follow" +
|
||||
"ing details could be useful. Press the Retry button to try again.";
|
||||
//
|
||||
// playerChoicePanel
|
||||
//
|
||||
this.playerChoicePanel.Controls.Add(this.playerStartMenuLabel);
|
||||
this.playerChoicePanel.Controls.Add(this.playerStartMenuBox);
|
||||
this.playerChoicePanel.Controls.Add(this.playerDesktopLabel);
|
||||
this.playerChoicePanel.Controls.Add(this.playerDesktopBox);
|
||||
this.playerChoicePanel.Controls.Add(this.playerLabel);
|
||||
this.playerChoicePanel.Controls.Add(this.playerBox);
|
||||
this.playerChoicePanel.Controls.Add(this.playerAskLabel);
|
||||
this.playerChoicePanel.Location = new System.Drawing.Point(90, 162);
|
||||
this.playerChoicePanel.Name = "playerChoicePanel";
|
||||
this.playerChoicePanel.Size = new System.Drawing.Size(545, 105);
|
||||
this.playerChoicePanel.TabIndex = 10;
|
||||
//
|
||||
// playerStartMenuLabel
|
||||
//
|
||||
this.playerStartMenuLabel.AutoSize = true;
|
||||
this.playerStartMenuLabel.Location = new System.Drawing.Point(389, 47);
|
||||
this.playerStartMenuLabel.Name = "playerStartMenuLabel";
|
||||
this.playerStartMenuLabel.Size = new System.Drawing.Size(104, 34);
|
||||
this.playerStartMenuLabel.TabIndex = 8;
|
||||
this.playerStartMenuLabel.Text = "Create Shortcuts\r\nin Start Menu";
|
||||
this.playerStartMenuLabel.Click += new System.EventHandler(this.playerStartMenuLabel_Click);
|
||||
//
|
||||
// playerDesktopLabel
|
||||
//
|
||||
this.playerDesktopLabel.AutoSize = true;
|
||||
this.playerDesktopLabel.Location = new System.Drawing.Point(210, 47);
|
||||
this.playerDesktopLabel.Name = "playerDesktopLabel";
|
||||
this.playerDesktopLabel.Size = new System.Drawing.Size(104, 34);
|
||||
this.playerDesktopLabel.TabIndex = 6;
|
||||
this.playerDesktopLabel.Text = "Create Shortcuts\r\non Desktop";
|
||||
this.playerDesktopLabel.Click += new System.EventHandler(this.playerDesktopLabel_Click);
|
||||
//
|
||||
// playerLabel
|
||||
//
|
||||
this.playerLabel.AutoSize = true;
|
||||
this.playerLabel.Location = new System.Drawing.Point(24, 47);
|
||||
this.playerLabel.Name = "playerLabel";
|
||||
this.playerLabel.Size = new System.Drawing.Size(110, 34);
|
||||
this.playerLabel.TabIndex = 4;
|
||||
this.playerLabel.Text = "Install Standalone\r\nFlash Player";
|
||||
this.playerLabel.Click += new System.EventHandler(this.playerLabel_Click);
|
||||
//
|
||||
// playerAskLabel
|
||||
//
|
||||
this.playerAskLabel.AutoSize = true;
|
||||
this.playerAskLabel.Location = new System.Drawing.Point(-2, 2);
|
||||
this.playerAskLabel.Name = "playerAskLabel";
|
||||
this.playerAskLabel.Size = new System.Drawing.Size(314, 17);
|
||||
this.playerAskLabel.TabIndex = 0;
|
||||
this.playerAskLabel.Text = "Would you like to install the standalone Flash Player?";
|
||||
//
|
||||
// nextButton
|
||||
//
|
||||
this.nextButton.BackColor = System.Drawing.Color.Black;
|
||||
this.nextButton.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(118)))), ((int)(((byte)(118)))), ((int)(((byte)(118)))));
|
||||
this.nextButton.Color2 = System.Drawing.Color.FromArgb(((int)(((byte)(81)))), ((int)(((byte)(81)))), ((int)(((byte)(81)))));
|
||||
this.nextButton.DisableAlpha = 0.644D;
|
||||
this.nextButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.nextButton.ForeColor = System.Drawing.SystemColors.Control;
|
||||
this.nextButton.HoverAlpha = 0.875D;
|
||||
this.nextButton.Location = new System.Drawing.Point(497, 286);
|
||||
this.nextButton.Name = "nextButton";
|
||||
this.nextButton.Size = new System.Drawing.Size(138, 31);
|
||||
this.nextButton.TabIndex = 7;
|
||||
this.nextButton.Text = "AGREE";
|
||||
this.nextButton.UseVisualStyleBackColor = false;
|
||||
this.nextButton.Click += new System.EventHandler(this.nextButton_Click);
|
||||
//
|
||||
// prevButton
|
||||
//
|
||||
this.prevButton.BackColor = System.Drawing.Color.Black;
|
||||
this.prevButton.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(118)))), ((int)(((byte)(118)))), ((int)(((byte)(118)))));
|
||||
this.prevButton.Color2 = System.Drawing.Color.FromArgb(((int)(((byte)(81)))), ((int)(((byte)(81)))), ((int)(((byte)(81)))));
|
||||
this.prevButton.DisableAlpha = 0.644D;
|
||||
this.prevButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.prevButton.ForeColor = System.Drawing.SystemColors.Control;
|
||||
this.prevButton.HoverAlpha = 0.875D;
|
||||
this.prevButton.Location = new System.Drawing.Point(90, 286);
|
||||
this.prevButton.Name = "prevButton";
|
||||
this.prevButton.Size = new System.Drawing.Size(138, 31);
|
||||
this.prevButton.TabIndex = 3;
|
||||
this.prevButton.TabStop = false;
|
||||
this.prevButton.Text = "QUIT";
|
||||
this.prevButton.UseVisualStyleBackColor = false;
|
||||
this.prevButton.Click += new System.EventHandler(this.prevButton_Click);
|
||||
//
|
||||
// playerStartMenuBox
|
||||
//
|
||||
this.playerStartMenuBox.Appearance = System.Windows.Forms.Appearance.Button;
|
||||
this.playerStartMenuBox.AutoSize = true;
|
||||
this.playerStartMenuBox.Checked = true;
|
||||
this.playerStartMenuBox.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.playerStartMenuBox.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.playerStartMenuBox.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.playerStartMenuBox.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.playerStartMenuBox.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.playerStartMenuBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.playerStartMenuBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.playerStartMenuBox.ImageIndex = 1;
|
||||
this.playerStartMenuBox.ImageList = this.checkboxImages;
|
||||
this.playerStartMenuBox.Location = new System.Drawing.Point(365, 47);
|
||||
this.playerStartMenuBox.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.playerStartMenuBox.Name = "playerStartMenuBox";
|
||||
this.playerStartMenuBox.Size = new System.Drawing.Size(21, 21);
|
||||
this.playerStartMenuBox.TabIndex = 7;
|
||||
this.playerStartMenuBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// playerDesktopBox
|
||||
//
|
||||
this.playerDesktopBox.Appearance = System.Windows.Forms.Appearance.Button;
|
||||
this.playerDesktopBox.AutoSize = true;
|
||||
this.playerDesktopBox.Checked = true;
|
||||
this.playerDesktopBox.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.playerDesktopBox.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.playerDesktopBox.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.playerDesktopBox.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.playerDesktopBox.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.playerDesktopBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.playerDesktopBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.playerDesktopBox.ImageIndex = 1;
|
||||
this.playerDesktopBox.ImageList = this.checkboxImages;
|
||||
this.playerDesktopBox.Location = new System.Drawing.Point(186, 47);
|
||||
this.playerDesktopBox.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.playerDesktopBox.Name = "playerDesktopBox";
|
||||
this.playerDesktopBox.Size = new System.Drawing.Size(21, 21);
|
||||
this.playerDesktopBox.TabIndex = 5;
|
||||
this.playerDesktopBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// playerBox
|
||||
//
|
||||
this.playerBox.Appearance = System.Windows.Forms.Appearance.Button;
|
||||
this.playerBox.AutoSize = true;
|
||||
this.playerBox.Checked = true;
|
||||
this.playerBox.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.playerBox.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.playerBox.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.playerBox.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.playerBox.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.playerBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.playerBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.playerBox.ImageIndex = 1;
|
||||
this.playerBox.ImageList = this.checkboxImages;
|
||||
this.playerBox.Location = new System.Drawing.Point(0, 47);
|
||||
this.playerBox.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.playerBox.Name = "playerBox";
|
||||
this.playerBox.Size = new System.Drawing.Size(21, 21);
|
||||
this.playerBox.TabIndex = 3;
|
||||
this.playerBox.UseVisualStyleBackColor = true;
|
||||
this.playerBox.CheckedChanged += new System.EventHandler(this.playerBox_CheckedChanged);
|
||||
//
|
||||
// activeXBox
|
||||
//
|
||||
this.activeXBox.Appearance = System.Windows.Forms.Appearance.Button;
|
||||
this.activeXBox.AutoSize = true;
|
||||
this.activeXBox.Checked = true;
|
||||
this.activeXBox.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.activeXBox.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.activeXBox.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.activeXBox.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.activeXBox.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.activeXBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.activeXBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.activeXBox.ImageIndex = 1;
|
||||
this.activeXBox.ImageList = this.checkboxImages;
|
||||
this.activeXBox.Location = new System.Drawing.Point(365, 47);
|
||||
this.activeXBox.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.activeXBox.Name = "activeXBox";
|
||||
this.activeXBox.Size = new System.Drawing.Size(21, 21);
|
||||
this.activeXBox.TabIndex = 7;
|
||||
this.activeXBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// netscapeBox
|
||||
//
|
||||
this.netscapeBox.Appearance = System.Windows.Forms.Appearance.Button;
|
||||
this.netscapeBox.AutoSize = true;
|
||||
this.netscapeBox.Checked = true;
|
||||
this.netscapeBox.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.netscapeBox.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.netscapeBox.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.netscapeBox.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.netscapeBox.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.netscapeBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.netscapeBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.netscapeBox.ImageIndex = 1;
|
||||
this.netscapeBox.ImageList = this.checkboxImages;
|
||||
this.netscapeBox.Location = new System.Drawing.Point(186, 47);
|
||||
this.netscapeBox.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.netscapeBox.Name = "netscapeBox";
|
||||
this.netscapeBox.Size = new System.Drawing.Size(21, 21);
|
||||
this.netscapeBox.TabIndex = 5;
|
||||
this.netscapeBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// pepperBox
|
||||
//
|
||||
this.pepperBox.Appearance = System.Windows.Forms.Appearance.Button;
|
||||
this.pepperBox.AutoSize = true;
|
||||
this.pepperBox.Checked = true;
|
||||
this.pepperBox.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.pepperBox.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.pepperBox.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.pepperBox.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.pepperBox.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.pepperBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.pepperBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.pepperBox.ImageIndex = 1;
|
||||
this.pepperBox.ImageList = this.checkboxImages;
|
||||
this.pepperBox.Location = new System.Drawing.Point(0, 47);
|
||||
this.pepperBox.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.pepperBox.Name = "pepperBox";
|
||||
this.pepperBox.Size = new System.Drawing.Size(21, 21);
|
||||
this.pepperBox.TabIndex = 3;
|
||||
this.pepperBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// disclaimerBox
|
||||
//
|
||||
this.disclaimerBox.Appearance = System.Windows.Forms.Appearance.Button;
|
||||
this.disclaimerBox.AutoSize = true;
|
||||
this.disclaimerBox.FlatAppearance.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.disclaimerBox.FlatAppearance.CheckedBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.disclaimerBox.FlatAppearance.MouseDownBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.disclaimerBox.FlatAppearance.MouseOverBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.disclaimerBox.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.disclaimerBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.disclaimerBox.ImageIndex = 0;
|
||||
this.disclaimerBox.ImageList = this.checkboxImages;
|
||||
this.disclaimerBox.Location = new System.Drawing.Point(0, 0);
|
||||
this.disclaimerBox.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.disclaimerBox.Name = "disclaimerBox";
|
||||
this.disclaimerBox.Size = new System.Drawing.Size(21, 21);
|
||||
this.disclaimerBox.TabIndex = 2;
|
||||
this.disclaimerBox.UseVisualStyleBackColor = true;
|
||||
this.disclaimerBox.CheckedChanged += new System.EventHandler(this.disclaimerBox_CheckedChanged);
|
||||
//
|
||||
// copyErrorButton
|
||||
//
|
||||
this.copyErrorButton.BackColor = System.Drawing.Color.Black;
|
||||
this.copyErrorButton.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(118)))), ((int)(((byte)(118)))), ((int)(((byte)(118)))));
|
||||
this.copyErrorButton.Color2 = System.Drawing.Color.FromArgb(((int)(((byte)(81)))), ((int)(((byte)(81)))), ((int)(((byte)(81)))));
|
||||
this.copyErrorButton.DisableAlpha = 0.644D;
|
||||
this.copyErrorButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.copyErrorButton.ForeColor = System.Drawing.SystemColors.Control;
|
||||
this.copyErrorButton.HoverAlpha = 0.875D;
|
||||
this.copyErrorButton.Location = new System.Drawing.Point(441, 58);
|
||||
this.copyErrorButton.Name = "copyErrorButton";
|
||||
this.copyErrorButton.Size = new System.Drawing.Size(104, 31);
|
||||
this.copyErrorButton.TabIndex = 14;
|
||||
this.copyErrorButton.Text = "COPY";
|
||||
this.copyErrorButton.UseVisualStyleBackColor = false;
|
||||
this.copyErrorButton.Click += new System.EventHandler(this.copyErrorButton_Click);
|
||||
//
|
||||
// progressBar
|
||||
//
|
||||
this.progressBar.Location = new System.Drawing.Point(49, 58);
|
||||
this.progressBar.Maximum = 100;
|
||||
this.progressBar.Minimum = 0;
|
||||
this.progressBar.Name = "progressBar";
|
||||
this.progressBar.ProgressBarColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(97)))), ((int)(((byte)(147)))), ((int)(((byte)(232)))));
|
||||
this.progressBar.ProgressBarColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(99)))), ((int)(((byte)(232)))));
|
||||
this.progressBar.Size = new System.Drawing.Size(451, 23);
|
||||
this.progressBar.TabIndex = 2;
|
||||
this.progressBar.Value = 0;
|
||||
//
|
||||
// debugChoicePanel
|
||||
//
|
||||
this.debugChoicePanel.Controls.Add(this.debugButton);
|
||||
this.debugChoicePanel.Controls.Add(this.debugAskLabel);
|
||||
this.debugChoicePanel.Location = new System.Drawing.Point(90, 163);
|
||||
this.debugChoicePanel.Name = "debugChoicePanel";
|
||||
this.debugChoicePanel.Size = new System.Drawing.Size(545, 105);
|
||||
this.debugChoicePanel.TabIndex = 11;
|
||||
//
|
||||
// debugAskLabel
|
||||
//
|
||||
this.debugAskLabel.AutoSize = true;
|
||||
this.debugAskLabel.Location = new System.Drawing.Point(-2, 2);
|
||||
this.debugAskLabel.Name = "debugAskLabel";
|
||||
this.debugAskLabel.Size = new System.Drawing.Size(535, 51);
|
||||
this.debugAskLabel.TabIndex = 0;
|
||||
this.debugAskLabel.Text = "Would you like to install the debug version of Clean Flash Player?\r\nYou should on" +
|
||||
"ly choose the debug version if you are planning to create Flash applications.\r\nI" +
|
||||
"f you are not sure, simply press NEXT.";
|
||||
//
|
||||
// debugButton
|
||||
//
|
||||
this.debugButton.BackColor = System.Drawing.Color.Black;
|
||||
this.debugButton.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(118)))), ((int)(((byte)(118)))), ((int)(((byte)(118)))));
|
||||
this.debugButton.Color2 = System.Drawing.Color.FromArgb(((int)(((byte)(81)))), ((int)(((byte)(81)))), ((int)(((byte)(81)))));
|
||||
this.debugButton.DisableAlpha = 0.644D;
|
||||
this.debugButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.debugButton.ForeColor = System.Drawing.SystemColors.Control;
|
||||
this.debugButton.HoverAlpha = 0.875D;
|
||||
this.debugButton.Location = new System.Drawing.Point(186, 65);
|
||||
this.debugButton.Name = "debugButton";
|
||||
this.debugButton.Size = new System.Drawing.Size(176, 31);
|
||||
this.debugButton.TabIndex = 8;
|
||||
this.debugButton.Text = "INSTALL DEBUG VERSION";
|
||||
this.debugButton.UseVisualStyleBackColor = false;
|
||||
this.debugButton.Click += new System.EventHandler(this.debugButton_Click);
|
||||
//
|
||||
// InstallForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.ClientSize = new System.Drawing.Size(712, 329);
|
||||
this.Controls.Add(this.nextButton);
|
||||
this.Controls.Add(this.subtitleLabel);
|
||||
this.Controls.Add(this.titleLabel);
|
||||
this.Controls.Add(this.flashLogo);
|
||||
this.Controls.Add(this.prevButton);
|
||||
this.Controls.Add(this.separator);
|
||||
this.Controls.Add(this.completePanel);
|
||||
this.Controls.Add(this.beforeInstallPanel);
|
||||
this.Controls.Add(this.installPanel);
|
||||
this.Controls.Add(this.debugChoicePanel);
|
||||
this.Controls.Add(this.playerChoicePanel);
|
||||
this.Controls.Add(this.choicePanel);
|
||||
this.Controls.Add(this.disclaimerPanel);
|
||||
this.Controls.Add(this.failurePanel);
|
||||
this.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.ForeColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "InstallForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Clean Flash Player Dev Installer";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.InstallForm_FormClosing);
|
||||
this.Load += new System.EventHandler(this.InstallForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.flashLogo)).EndInit();
|
||||
this.disclaimerPanel.ResumeLayout(false);
|
||||
this.disclaimerPanel.PerformLayout();
|
||||
this.choicePanel.ResumeLayout(false);
|
||||
this.choicePanel.PerformLayout();
|
||||
this.installPanel.ResumeLayout(false);
|
||||
this.installPanel.PerformLayout();
|
||||
this.beforeInstallPanel.ResumeLayout(false);
|
||||
this.beforeInstallPanel.PerformLayout();
|
||||
this.completePanel.ResumeLayout(false);
|
||||
this.completePanel.PerformLayout();
|
||||
this.failurePanel.ResumeLayout(false);
|
||||
this.failurePanel.PerformLayout();
|
||||
this.playerChoicePanel.ResumeLayout(false);
|
||||
this.playerChoicePanel.PerformLayout();
|
||||
this.debugChoicePanel.ResumeLayout(false);
|
||||
this.debugChoicePanel.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label disclaimerLabel;
|
||||
private System.Windows.Forms.Label separator;
|
||||
private System.Windows.Forms.ImageList checkboxImages;
|
||||
private CleanFlashCommon.ImageCheckBox disclaimerBox;
|
||||
private CleanFlashCommon.GradientButton prevButton;
|
||||
private System.Windows.Forms.PictureBox flashLogo;
|
||||
private System.Windows.Forms.Label titleLabel;
|
||||
private System.Windows.Forms.Label subtitleLabel;
|
||||
private CleanFlashCommon.GradientButton nextButton;
|
||||
private System.Windows.Forms.Panel disclaimerPanel;
|
||||
private System.Windows.Forms.Panel choicePanel;
|
||||
private System.Windows.Forms.Label activeXLabel;
|
||||
private CleanFlashCommon.ImageCheckBox activeXBox;
|
||||
private System.Windows.Forms.Label netscapeLabel;
|
||||
private CleanFlashCommon.ImageCheckBox netscapeBox;
|
||||
private System.Windows.Forms.Label pepperLabel;
|
||||
private CleanFlashCommon.ImageCheckBox pepperBox;
|
||||
private System.Windows.Forms.Label browserAskLabel;
|
||||
private System.Windows.Forms.Panel installPanel;
|
||||
private CleanFlashCommon.SmoothProgressBar progressBar;
|
||||
private System.Windows.Forms.Label progressLabel;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Panel beforeInstallPanel;
|
||||
private System.Windows.Forms.Label beforeInstallLabel;
|
||||
private System.Windows.Forms.Panel completePanel;
|
||||
private System.Windows.Forms.LinkLabel completeLabel;
|
||||
private System.Windows.Forms.Panel failurePanel;
|
||||
private System.Windows.Forms.TextBox failureBox;
|
||||
private System.Windows.Forms.Label failureText;
|
||||
private CleanFlashCommon.GradientButton copyErrorButton;
|
||||
private System.Windows.Forms.Panel playerChoicePanel;
|
||||
private System.Windows.Forms.Label playerStartMenuLabel;
|
||||
private CleanFlashCommon.ImageCheckBox playerStartMenuBox;
|
||||
private System.Windows.Forms.Label playerDesktopLabel;
|
||||
private CleanFlashCommon.ImageCheckBox playerDesktopBox;
|
||||
private System.Windows.Forms.Label playerLabel;
|
||||
private CleanFlashCommon.ImageCheckBox playerBox;
|
||||
private System.Windows.Forms.Label playerAskLabel;
|
||||
private System.Windows.Forms.Panel debugChoicePanel;
|
||||
private CleanFlashCommon.GradientButton debugButton;
|
||||
private System.Windows.Forms.Label debugAskLabel;
|
||||
}
|
||||
}
|
||||
@@ -1,327 +0,0 @@
|
||||
using CleanFlashCommon;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CleanFlashInstaller {
|
||||
public partial class InstallForm : Form, IProgressForm {
|
||||
private static string COMPLETE_INSTALL_TEXT = @"Clean Flash Player has been successfully installed!
|
||||
Don't forget, Flash Player is no longer compatible with new browsers.
|
||||
|
||||
For browser recommendations and Flash Player updates,
|
||||
check out Clean Flash Player's website!";
|
||||
private static string COMPLETE_UNINSTALL_TEXT = @"
|
||||
All versions of Flash Player have been successfully uninstalled.
|
||||
|
||||
If you ever change your mind, check out Clean Flash Player's website!";
|
||||
private bool debugChosen = false;
|
||||
|
||||
public InstallForm() {
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void CheckAgreeBox() {
|
||||
nextButton.Enabled = disclaimerBox.Checked;
|
||||
}
|
||||
|
||||
private void HideAllPanels() {
|
||||
disclaimerPanel.Visible = false;
|
||||
choicePanel.Visible = false;
|
||||
playerChoicePanel.Visible = false;
|
||||
debugChoicePanel.Visible = false;
|
||||
beforeInstallPanel.Visible = false;
|
||||
installPanel.Visible = false;
|
||||
completePanel.Visible = false;
|
||||
failurePanel.Visible = false;
|
||||
}
|
||||
|
||||
private void OpenDisclaimerPanel() {
|
||||
HideAllPanels();
|
||||
disclaimerPanel.Visible = true;
|
||||
prevButton.Text = "QUIT";
|
||||
nextButton.Text = "AGREE";
|
||||
}
|
||||
|
||||
private void OpenChoicePanel() {
|
||||
HideAllPanels();
|
||||
choicePanel.Visible = true;
|
||||
prevButton.Text = "BACK";
|
||||
nextButton.Text = "NEXT";
|
||||
}
|
||||
|
||||
private void OpenPlayerChoicePanel() {
|
||||
HideAllPanels();
|
||||
playerChoicePanel.Visible = true;
|
||||
prevButton.Text = "BACK";
|
||||
nextButton.Text = "NEXT";
|
||||
}
|
||||
|
||||
private void OpenDebugChoicePanel() {
|
||||
HideAllPanels();
|
||||
debugChoicePanel.Visible = true;
|
||||
debugChosen = false;
|
||||
prevButton.Text = "BACK";
|
||||
nextButton.Text = "NEXT";
|
||||
}
|
||||
|
||||
private string JoinStringsWithAnd(List<string> strings) {
|
||||
string text = string.Join(", ", strings);
|
||||
int index = text.LastIndexOf(", ");
|
||||
|
||||
if (index != -1) {
|
||||
text = text.Substring(0, index) + " and " + text.Substring(index + 2);
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
private void OpenBeforeInstall() {
|
||||
HideAllPanels();
|
||||
string text;
|
||||
|
||||
if (pepperBox.Checked || netscapeBox.Checked || activeXBox.Checked || playerBox.Checked) {
|
||||
List<string> browsers = new List<string>();
|
||||
|
||||
if (pepperBox.Checked) {
|
||||
browsers.Add("Google Chrome");
|
||||
}
|
||||
if (netscapeBox.Checked) {
|
||||
browsers.Add("Mozilla Firefox");
|
||||
}
|
||||
if (activeXBox.Checked) {
|
||||
browsers.Add("Internet Explorer");
|
||||
}
|
||||
|
||||
text = string.Format("You are about to install Clean Flash Player.\nPlease close any browser windows running Flash content before you continue.\n\nThe installer will close all browser windows running Flash, uninstall previous versions of Flash Player and\nFlash Center, and install Flash for {0}.", JoinStringsWithAnd(browsers));
|
||||
nextButton.Text = "INSTALL";
|
||||
} else {
|
||||
text = "You are about to uninstall Clean Flash Player.\nPlease close any browser windows running Flash content before you continue.\n\nThe installer will completely remove all versions of Flash Player from this computer,\nincluding Clean Flash Player and older versions of Adobe Flash Player.";
|
||||
nextButton.Text = "UNINSTALL";
|
||||
}
|
||||
|
||||
beforeInstallLabel.Text = text;
|
||||
beforeInstallPanel.Visible = true;
|
||||
prevButton.Text = "BACK";
|
||||
}
|
||||
|
||||
private void OpenInstall() {
|
||||
HideAllPanels();
|
||||
installPanel.Visible = true;
|
||||
prevButton.Text = "BACK";
|
||||
nextButton.Text = "NEXT";
|
||||
prevButton.Enabled = false;
|
||||
nextButton.Visible = false;
|
||||
BeginInstall();
|
||||
}
|
||||
|
||||
private void OpenComplete() {
|
||||
HideAllPanels();
|
||||
completePanel.Visible = true;
|
||||
prevButton.Text = "QUIT";
|
||||
prevButton.Enabled = true;
|
||||
|
||||
completeLabel.Links.Clear();
|
||||
|
||||
if (pepperBox.Checked || netscapeBox.Checked || activeXBox.Checked) {
|
||||
completeLabel.Text = COMPLETE_INSTALL_TEXT;
|
||||
completeLabel.Links.Add(new LinkLabel.Link(187, 28));
|
||||
} else {
|
||||
completeLabel.Text = COMPLETE_UNINSTALL_TEXT;
|
||||
completeLabel.Links.Add(new LinkLabel.Link(110, 28));
|
||||
}
|
||||
}
|
||||
|
||||
private void OpenFailure(Exception e) {
|
||||
HideAllPanels();
|
||||
failurePanel.Visible = true;
|
||||
prevButton.Text = "QUIT";
|
||||
prevButton.Enabled = true;
|
||||
nextButton.Text = "RETRY";
|
||||
nextButton.Visible = true;
|
||||
failureBox.Text = e.ToString();
|
||||
}
|
||||
|
||||
private void BeginInstall() {
|
||||
InstallFlags flags = new InstallFlags();
|
||||
flags.SetConditionally(pepperBox.Checked, InstallFlags.PEPPER);
|
||||
flags.SetConditionally(netscapeBox.Checked, InstallFlags.NETSCAPE);
|
||||
flags.SetConditionally(activeXBox.Checked, InstallFlags.ACTIVEX);
|
||||
flags.SetConditionally(playerBox.Checked, InstallFlags.PLAYER);
|
||||
flags.SetConditionally(playerDesktopBox.Checked, InstallFlags.PLAYER_DESKTOP);
|
||||
flags.SetConditionally(playerStartMenuBox.Checked, InstallFlags.PLAYER_START_MENU);
|
||||
flags.SetConditionally(debugChosen, InstallFlags.DEBUG);
|
||||
|
||||
progressBar.Value = 0;
|
||||
progressBar.Maximum = flags.GetTicks();
|
||||
|
||||
new Task(new Action(() => {
|
||||
IntPtr redirection = RedirectionManager.DisableRedirection();
|
||||
|
||||
try {
|
||||
Uninstaller.Uninstall(this);
|
||||
Installer.Install(this, flags);
|
||||
Complete();
|
||||
} catch (Exception e) {
|
||||
Failure(e);
|
||||
} finally {
|
||||
RedirectionManager.EnableRedirection(redirection);
|
||||
}
|
||||
})).Start();
|
||||
}
|
||||
|
||||
private void disclaimerBox_CheckedChanged(object sender, EventArgs e) {
|
||||
CheckAgreeBox();
|
||||
}
|
||||
|
||||
private void disclaimerLabel_Click(object sender, EventArgs e) {
|
||||
disclaimerBox.Checked = !disclaimerBox.Checked;
|
||||
}
|
||||
|
||||
private void InstallForm_Load(object sender, EventArgs e) {
|
||||
string version = UpdateChecker.GetFlashVersion();
|
||||
|
||||
subtitleLabel.Text = string.Format("built from version {0} ({1})", version, "China");
|
||||
Text = string.Format("Clean Flash Player {0} Installer", version);
|
||||
|
||||
OpenDisclaimerPanel();
|
||||
CheckAgreeBox();
|
||||
}
|
||||
|
||||
private void prevButton_Click(object sender, EventArgs e) {
|
||||
if (disclaimerPanel.Visible || completePanel.Visible || failurePanel.Visible) {
|
||||
Application.Exit();
|
||||
} else if (choicePanel.Visible) {
|
||||
OpenDisclaimerPanel();
|
||||
} else if (beforeInstallPanel.Visible) {
|
||||
OpenDebugChoicePanel();
|
||||
} else if (playerChoicePanel.Visible) {
|
||||
OpenChoicePanel();
|
||||
} else if (debugChoicePanel.Visible) {
|
||||
OpenPlayerChoicePanel();
|
||||
}
|
||||
}
|
||||
|
||||
private void nextButton_Click(object sender, EventArgs e) {
|
||||
if (disclaimerPanel.Visible) {
|
||||
OpenChoicePanel();
|
||||
} else if (choicePanel.Visible) {
|
||||
OpenPlayerChoicePanel();
|
||||
} else if (playerChoicePanel.Visible) {
|
||||
OpenDebugChoicePanel();
|
||||
} else if (debugChoicePanel.Visible) {
|
||||
OpenBeforeInstall();
|
||||
} else if (beforeInstallPanel.Visible || failurePanel.Visible) {
|
||||
OpenInstall();
|
||||
}
|
||||
}
|
||||
|
||||
private void pepperLabel_Click(object sender, EventArgs e) {
|
||||
pepperBox.Checked = !pepperBox.Checked;
|
||||
}
|
||||
|
||||
private void netscapeLabel_Click(object sender, EventArgs e) {
|
||||
netscapeBox.Checked = !netscapeBox.Checked;
|
||||
}
|
||||
|
||||
private void activeXLabel_Click(object sender, EventArgs e) {
|
||||
activeXBox.Checked = !activeXBox.Checked;
|
||||
}
|
||||
|
||||
private void playerLabel_Click(object sender, EventArgs e) {
|
||||
playerBox.Checked = !playerBox.Checked;
|
||||
}
|
||||
|
||||
private void playerDesktopLabel_Click(object sender, EventArgs e) {
|
||||
if (playerBox.Checked) {
|
||||
playerDesktopBox.Checked = !playerDesktopBox.Checked;
|
||||
}
|
||||
}
|
||||
|
||||
private void playerStartMenuLabel_Click(object sender, EventArgs e) {
|
||||
if (playerBox.Checked) {
|
||||
playerStartMenuBox.Checked = !playerStartMenuBox.Checked;
|
||||
}
|
||||
}
|
||||
private void playerBox_CheckedChanged(object sender, EventArgs e) {
|
||||
bool enabled = playerBox.Checked;
|
||||
|
||||
playerDesktopBox.Enabled = enabled;
|
||||
playerStartMenuBox.Enabled = enabled;
|
||||
|
||||
if (!enabled) {
|
||||
playerDesktopBox.Checked = false;
|
||||
playerStartMenuBox.Checked = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateProgressLabel(string text, bool tick) {
|
||||
Invoke(new Action(() => {
|
||||
progressLabel.Text = text;
|
||||
|
||||
if (tick) {
|
||||
progressBar.Value++;
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
public void TickProgress() {
|
||||
Invoke(new Action(() => {
|
||||
progressBar.Value++;
|
||||
}));
|
||||
}
|
||||
|
||||
public void Complete() {
|
||||
Invoke(new Action(OpenComplete));
|
||||
}
|
||||
|
||||
public void Failure(Exception e) {
|
||||
Invoke(new Action(() => OpenFailure(e)));
|
||||
}
|
||||
|
||||
private void completeLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) {
|
||||
Process.Start("https://gitlab.com/cleanflash/installer#clean-flash-player");
|
||||
}
|
||||
|
||||
private void copyErrorButton_Click(object sender, EventArgs e) {
|
||||
Clipboard.SetText(failureBox.Text);
|
||||
MessageBox.Show("Copied error message to clipboard!", "Clean Flash Installer", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
|
||||
private void debugButton_Click(object sender, EventArgs e) {
|
||||
debugChosen = MessageBox.Show("Are you sure you want to install the debug version?\n\nThis version is only meant to be used by experienced developers!\nIf you are not sure, choose No.", "Clean Flash Installer", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes;
|
||||
OpenBeforeInstall();
|
||||
}
|
||||
|
||||
private void InstallForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
bool v1 = true;
|
||||
// if installing
|
||||
// note: msgbox not pauses the process
|
||||
if (installPanel.Visible)
|
||||
{
|
||||
if (v1)
|
||||
{
|
||||
// hardlock, only force quit process
|
||||
// follows current design since Back button is disabled
|
||||
MessageBox.Show("Please, wait until process end", "Clean Flash Installer", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
e.Cancel = true;
|
||||
}
|
||||
else
|
||||
// soft alternative, expert mode, todo: better warning of consequences
|
||||
if (MessageBox.Show("Are you sure you want to interrupt the process ?", "Clean Flash Installer", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
|
||||
{
|
||||
e.Cancel = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// use cases ?
|
||||
// uninstall, currently not implemented
|
||||
}
|
||||
|
||||
//todo: same for uninstaller: share same F
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,252 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="disclaimerLabel.Text" xml:space="preserve">
|
||||
<value>I am aware that Adobe Flash Player is no longer supported, nor provided by Adobe Inc.
|
||||
Clean Flash Player is a third-party version of Flash Player built from the latest Flash Player
|
||||
version with adware removed.
|
||||
|
||||
Adobe is not required by any means to provide support for this version of Flash Player.
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="checkboxImages.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<data name="checkboxImages.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACY
|
||||
CAAAAk1TRnQBSQFMAgEBAgEAAQgBAgEIAQIBDwEAAQ8BAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
AwABPAMAAQ8DAAEBAQABCAUAAYQBAxgAAYACAAGAAwACgAEAAYADAAGAAQABgAEAAoACAAPAAQABwAHc
|
||||
AcABAAHwAcoBpgEAATMFAAEzAQABMwEAATMBAAIzAgADFgEAAxwBAAMiAQADKQEAA1UBAANNAQADQgEA
|
||||
AzkBAAGAAXwB/wEAAlAB/wEAAZMBAAHWAQAB/wHsAcwBAAHGAdYB7wEAAdYC5wEAAZABqQGtAgAB/wEz
|
||||
AwABZgMAAZkDAAHMAgABMwMAAjMCAAEzAWYCAAEzAZkCAAEzAcwCAAEzAf8CAAFmAwABZgEzAgACZgIA
|
||||
AWYBmQIAAWYBzAIAAWYB/wIAAZkDAAGZATMCAAGZAWYCAAKZAgABmQHMAgABmQH/AgABzAMAAcwBMwIA
|
||||
AcwBZgIAAcwBmQIAAswCAAHMAf8CAAH/AWYCAAH/AZkCAAH/AcwBAAEzAf8CAAH/AQABMwEAATMBAAFm
|
||||
AQABMwEAAZkBAAEzAQABzAEAATMBAAH/AQAB/wEzAgADMwEAAjMBZgEAAjMBmQEAAjMBzAEAAjMB/wEA
|
||||
ATMBZgIAATMBZgEzAQABMwJmAQABMwFmAZkBAAEzAWYBzAEAATMBZgH/AQABMwGZAgABMwGZATMBAAEz
|
||||
AZkBZgEAATMCmQEAATMBmQHMAQABMwGZAf8BAAEzAcwCAAEzAcwBMwEAATMBzAFmAQABMwHMAZkBAAEz
|
||||
AswBAAEzAcwB/wEAATMB/wEzAQABMwH/AWYBAAEzAf8BmQEAATMB/wHMAQABMwL/AQABZgMAAWYBAAEz
|
||||
AQABZgEAAWYBAAFmAQABmQEAAWYBAAHMAQABZgEAAf8BAAFmATMCAAFmAjMBAAFmATMBZgEAAWYBMwGZ
|
||||
AQABZgEzAcwBAAFmATMB/wEAAmYCAAJmATMBAANmAQACZgGZAQACZgHMAQABZgGZAgABZgGZATMBAAFm
|
||||
AZkBZgEAAWYCmQEAAWYBmQHMAQABZgGZAf8BAAFmAcwCAAFmAcwBMwEAAWYBzAGZAQABZgLMAQABZgHM
|
||||
Af8BAAFmAf8CAAFmAf8BMwEAAWYB/wGZAQABZgH/AcwBAAHMAQAB/wEAAf8BAAHMAQACmQIAAZkBMwGZ
|
||||
AQABmQEAAZkBAAGZAQABzAEAAZkDAAGZAjMBAAGZAQABZgEAAZkBMwHMAQABmQEAAf8BAAGZAWYCAAGZ
|
||||
AWYBMwEAAZkBMwFmAQABmQFmAZkBAAGZAWYBzAEAAZkBMwH/AQACmQEzAQACmQFmAQADmQEAApkBzAEA
|
||||
ApkB/wEAAZkBzAIAAZkBzAEzAQABZgHMAWYBAAGZAcwBmQEAAZkCzAEAAZkBzAH/AQABmQH/AgABmQH/
|
||||
ATMBAAGZAcwBZgEAAZkB/wGZAQABmQH/AcwBAAGZAv8BAAHMAwABmQEAATMBAAHMAQABZgEAAcwBAAGZ
|
||||
AQABzAEAAcwBAAGZATMCAAHMAjMBAAHMATMBZgEAAcwBMwGZAQABzAEzAcwBAAHMATMB/wEAAcwBZgIA
|
||||
AcwBZgEzAQABmQJmAQABzAFmAZkBAAHMAWYBzAEAAZkBZgH/AQABzAGZAgABzAGZATMBAAHMAZkBZgEA
|
||||
AcwCmQEAAcwBmQHMAQABzAGZAf8BAALMAgACzAEzAQACzAFmAQACzAGZAQADzAEAAswB/wEAAcwB/wIA
|
||||
AcwB/wEzAQABmQH/AWYBAAHMAf8BmQEAAcwB/wHMAQABzAL/AQABzAEAATMBAAH/AQABZgEAAf8BAAGZ
|
||||
AQABzAEzAgAB/wIzAQAB/wEzAWYBAAH/ATMBmQEAAf8BMwHMAQAB/wEzAf8BAAH/AWYCAAH/AWYBMwEA
|
||||
AcwCZgEAAf8BZgGZAQAB/wFmAcwBAAHMAWYB/wEAAf8BmQIAAf8BmQEzAQAB/wGZAWYBAAH/ApkBAAH/
|
||||
AZkBzAEAAf8BmQH/AQAB/wHMAgAB/wHMATMBAAH/AcwBZgEAAf8BzAGZAQAB/wLMAQAB/wHMAf8BAAL/
|
||||
ATMBAAHMAf8BZgEAAv8BmQEAAv8BzAEAAmYB/wEAAWYB/wFmAQABZgL/AQAB/wJmAQAB/wFmAf8BAAL/
|
||||
AWYBAAEhAQABpQEAA18BAAN3AQADhgEAA5YBAAPLAQADsgEAA9cBAAPdAQAD4wEAA+oBAAPxAQAD+AEA
|
||||
AfAB+wH/AQABpAKgAQADgAMAAf8CAAH/AwAC/wEAAf8DAAH/AQAB/wEAAv8CAAP/AQAOEwHqDhMB6h4A
|
||||
AUMBDwsQAQ8BEwFDAQ8LEAEPARMeAAFDAQ8BFAkTARQBEAETAUMBDwsSARABEx4AAUMBEAISBxMCEgEQ
|
||||
ARMBQwEQC+oBEAETHgABQwEQCxIBEAETAUMBEAJtA+oBEgETARIB6gFtAeoBEAETHgABQwEQAuoHEgHq
|
||||
ARIBEAETAUMBEANtAeoCEgFtAuoCbQEQARMeAAFDARAL6gEQARMBQwEQA20BEgHqAewB7wHsAeoCbQEQ
|
||||
ARMeAAFDARABbQjqAm0BEAETAUMBEAJtARIB6gHtAQcB8AEHAewCbQEQARMeAAFDARACbQfqAm0BEAET
|
||||
AUMBEAHrAm0B7QEHArwB8AHvAesB6gEQARMeAAFDARALbQEQARMBQwEQAuwB7QIHAvcCvAH3AeoBEAET
|
||||
HgABQwEQC20BEAETAUMBEAfsAe8CvAHsAREBEx4AAUMBEAttARABEwFDARAH7AHtAe8B8AEHAW0BEx4A
|
||||
AUMBEAttARABEwFDARAI7AHtAQcB8AEHAW0eAAFDAQ8LEAEPARMBQwEPCRABEwHvAfABBx4ADkMBEw5D
|
||||
ARMeAAFCAU0BPgcAAT4DAAEoAwABPAMAAQ8DAAEBAQABAQUAAXgXAAP/eQAL
|
||||
</value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAUy/wQFMv8EBTP/BAUz/wQF
|
||||
M/8EBDP/BAQz/wQEM/8EBDP/BAQz/wQFM/8EBTP/BAUz/wQFMv8EBTL/BAUy/wQFMf8EBTH/BAQx/wQF
|
||||
MP8EBTD/BAQw/wQFL/8EBS//BAQu/wQFLv8EBC7/BAQt/wAAAAAAAAAAAAAAAAAAAAAEBDP/BAQz/wQF
|
||||
M/8EBTT/BAU0/wQFNP8EBTT/BAU0/wQFNP8EBTT/BAU0/wQFNP8EBTP/BAUz/wQEM/8EBTP/BAQy/wQE
|
||||
Mv8EBTH/BAUx/wQFMf8EBTD/BAQw/wQEL/8EBC//BAQu/wQFLv8EBC7/AAAAAAAAAAAAAAAABAQ0DwQF
|
||||
NP8EBTT/BAU1/wQFNf8EBTX/BAU1/wQFNf8EBTX/BAU1/wQFNf8EBTX/BAU1/wQFNP8EBDT/BAU0/wQF
|
||||
M/8EBDP/BAUz/wQEMv8EBTL/BAUx/wQEMf8EBTD/BAUw/wQFL/8EBC//BAQu/wQFLv8EBC4PAAAAAAAA
|
||||
AAAEBTU/BAU1/wQFNf8EBTX/BAU2/wQFNv8EBTb/BAU2/wQFNv8EBTb/BAU2/wQFNv8EBTb/BAU1/wQF
|
||||
Nf8EBTX/BAU0/wQFNP8EBTP/BAQz/wQFM/8EBDL/BAUx/wQEMf8EBTD/BAUw/wQFL/8EBC//BAQu/wQE
|
||||
Lj8AAAAAAAAAAAQFNT8EBTb/BAU2/wQFNv8EBTf/BAU3/wQFN/8EBTf/BAU3/wQFN/8EBTf/BAU3/wQE
|
||||
N/8EBDb/BAU2/wQFNv8EBTX/BAU1/wQFNP8EBTT/BAUz/wQFM/8EBTL/BAUx/wQEMf8EBTD/BAUw/wQE
|
||||
L/8EBS//BAQuPwAAAAAAAAAABAQ2PwQFN/8EBTf/AwU3/7OzwP94eZL/ExND/wQFOP8EBTj/BAU4/wQE
|
||||
OP8EBDj/BAU4/wQFN/8EBTf/BAU2/wQFNv8EBTX/BAU1/wQFNP8EBTT/BAUz/wQFM/8EBTL/BAUx/wQE
|
||||
Mf8EBDD/BAUw/wQEL/8EBC8/AAAAAAAAAAAEBTc/BAU4/wQEOP8DBTj/7+/v/+/v7//Dw83/EhRE/wMF
|
||||
Of8DBTn/AwU5/wMFOf8DBTj/BAU4/wQFOP8EBTf/BAU3/wQFNv8EBTb/BAU1/wQFNP8EBTT/BAUz/wQF
|
||||
M/8EBDL/BAUx/wQFMf8EBTD/BAQw/wQELz8AAAAAAAAAAAQFOE8DBTj/AwU5/wMFOf+3t8X/5OTn//Ly
|
||||
8v+nqLj/AwU6/wMFOv8DBDr/AwQ6/wMFOf8DBTn/AwU4/wQEOP8EBDj/BAU3/wQENv8EBTb/BAU1/wQF
|
||||
NP8EBTT/BAQz/wQFMv8EBTL/BAUx/wQFMP8EBDD/BAUvTwAAAAAAAAAAAwU5fwMFOf8DBDr/AwU6/wMF
|
||||
Ov8wMl7/5+fq//X19f9eX4H/AwQ7/wMFO/8DBTr/AwU6/wMFOv8DBTn/AwU5/wQFOP8EBDj/BAU3/wQF
|
||||
Nv8EBTX/BAU1/wQENP8EBTP/BAUz/wQFMv8EBTH/BAQx/wQFMP8EBDB/AAAAAAAAAAADBTl/AwQ6/wMF
|
||||
Ov8DBDv/AwU7/wMEPP99fpr/9/f3//f39//39/f/9/f3/wMFO/8DBDv/AwU6/wMEOv8DBTn/AwU5/wQE
|
||||
OP8DBTf/BAQ3/wQFNv8EBTX/BAU1/wQFNP8EBDP/BAUy/wQFMv8EBDH/BAQw/wQFMH8AAAAAAAAAAAME
|
||||
On8DBTr/AwU7/wMEPP8DBTz/AwU8/xITSf/r7O//+vr6//r6+v/6+vr/AwU8/wMEPP8DBTv/AwU6/wME
|
||||
Ov8DBTn/AwU4/wQEOP8EBTf/BAQ2/wQFNf8EBTX/BAU0/wQEM/8EBTP/BAQy/wQFMf8EBDH/BAQwfwAA
|
||||
AAAAAAAAAwU6fwMFO/8DBDz/AwU8/wMEPf8DBT3/AgQ+/5+gtf/8/Pz/vb7M/wMEPf8DBD3/AwU8/wMF
|
||||
O/8DBDv/AwU6/wMEOv8DBTn/BAU4/wMFN/8EBDf/BAU2/wQFNf8EBTT/BAUz/wQFM/8EBDL/BAUx/wQF
|
||||
Mf8EBTB/AAAAAAAAAAADBTuPAwQ7/wMFPP8DBD3/AwQ+/wIFPv8CBD//IiNX////////////gIKe/wME
|
||||
Pf8DBTz/AwU8/wMEO/8DBTr/AwQ6/wMFOf8EBTj/BAU4/wQFN/8EBTb/BAU1/wQFNP8EBDT/BAUz/wQF
|
||||
Mv8EBTH/BAUx/wQEMI8AAAAAAAAAAAMEO78DBDz/AwU8/wMEPf8CBT7/AgQ//wIEQP8CBEH/YWKI////
|
||||
////////7+/z/wMEPf8DBTz/AwU7/wMEO/8DBDr/AwU5/wMFOP8EBTj/BAU3/wQFNv8EBTX/BAU0/wQF
|
||||
NP8EBTP/BAQy/wQFMf8EBDH/BAQwvwAAAAAAAAAAAwU7vwMEPP8DBTz/AwQ9/wIFPv8CBT//AgRA/wIE
|
||||
Qf8CBED/QUNv/8DB0P//////AwQ9/wMFPP8DBTv/AwQ7/wMEOv8DBTn/BAU4/wQFOP8EBTf/BAU2/wQF
|
||||
Nf8EBTT/BAQ0/wQFM/8EBTL/BAUx/wQFMf8EBDC/AAAAAAAAAAADBTu/AwU7/wMFPP8DBD3/AwU+/wIE
|
||||
P/8CBT//AgQ//wIEP/8CBT//AgQ+/wMEPf8DBTz/AwU8/wMFO/8DBTr/AwQ6/wMFOf8EBTj/AwU3/wQE
|
||||
N/8EBTb/BAU1/wQFNP8EBTP/BAUz/wQEMv8EBTH/BAUx/wQFML8AAAAAAAAAAAMEO78DBDv/AwU8/wMF
|
||||
PP8DBD3/AwQ+/wIEPv8CBD7/AgU+/wMFPv8DBD3/AwU8/wMFPP8DBTv/AwU7/wMFOv8DBTn/AwU5/wQF
|
||||
OP8EBTf/BAQ2/wQFNv8EBTX/BAU0/wQEM/8EBTP/BAQy/wQFMf8EBTD/BAQwvwAAAAAAAAAAAwU63wMF
|
||||
O/8DBTv/AwU8/wMFPP8DBD3/AwQ9/wMEPf8DBD3/AwQ9/wMFPP8DBTz/AwU7/wMFO/8DBTr/AwQ6/wMF
|
||||
Of8EBTj/BAU4/wQFN/8EBTb/BAU1/wQFNf8EBTT/BAQz/wQFMv8EBTL/BAQx/wQEMP8EBDDfAAAAAAAA
|
||||
AAADBDr/AwU6/wMEO/8DBTv/AwU7/wMFPP8DBDz/AwU8/wMEPP8DBTz/AwU7/wMFO/8DBDv/AwU6/wME
|
||||
Ov8DBTn/AwU4/wQEOP8EBTf/BAQ2/wQFNv8EBTX/BAQ0/wQFM/8EBTP/BAQy/wQFMf8EBTH/BAQw/wQE
|
||||
L/8AAAAAAAAAAAMFOf8DBTn/AwQ6/wMFOv8DBDv/AwU7/wMFO/8DBTv/AwU7/wMFO/8DBDv/AwU6/wME
|
||||
Ov8DBTn/AwU5/wMFOP8EBDj/BAU3/wQFNv8EBTb/BAU1/wQFNP8EBTT/BAQz/wQFMv8EBTL/BAQx/wQF
|
||||
MP8EBTD/BAQv/wAAAAAAAAAABAQu/wQELv8EBC7/BAQv/wQEL/8EBC//BAQv/wQEL/8EBDD/BAQw/wQE
|
||||
MP8EBDD/BAQw/wQEMP8EBDD/BAQw/wQEMP8EBDD/BAQw/wQEMP8EBDD/BAQw/wQEL/8EBC//BAQv/wQE
|
||||
L/8EBC//BAQu/wQELv8EBC7/AAAAAAAAAAAEBDBgBAQw/wQEMf8EBDH/BAQx/wQEMv8EBDL/BAQy/wQE
|
||||
Mv8EBDP/BAQz/wQEM/8EBDP/BAQz/wQEM/8EBDP/BAQz/wQEM/8EBDP/BAQz/wQEM/8EBDL/BAQy/wQE
|
||||
Mv8EBDL/BAQx/wQEMf8EBDH/BAQw/wQEMGAAAAAAAAAAAAAAAAAEBDNgBAQz/wQEM/8EBDT/BAQ0/wQE
|
||||
Nf8EBDX/BAQ1/wQENv8EBDb/BAQ2/wQENv8EBDb/BAQ2/wQENv8EBDb/BAQ2/wQENv8EBDb/BAQ1/wQE
|
||||
Nf8EBDX/BAQ1/wQENP8EBDT/BAQz/wQEM/8EBDNgAAAAAAAAAAAAAAAAAAAAAAAAAAAEBDVgBAQ2/wQE
|
||||
Nv8EAzf/BAM3/wQEOP8EAzj/BAM4/wQDOf8DAzn/BAM5/wMDOf8EAzn/BAM5/wMDOf8EAzn/AwM5/wQD
|
||||
Of8EAzj/BAM4/wQEOP8EAzf/BAM3/wQENv8EBDb/BAQ1YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAEAzdgBAM4/wQDOP8EAzn/BAM6/wQDOv8DAzv/AwM8/wMDPP8DAzz/AwM9/wMDPf8DAz3/AwM9/wMD
|
||||
Pf8DAzz/AwM8/wMDO/8EAzr/AwM6/wMDOf8EAzj/BAM4/wQDN2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAEAzlgBAM5/wQDOv8DAzv/AwM8/wMDPf8DAz3/AwI+/wICP/8DAj//AwJA/wMC
|
||||
QP8CAkD/AwI//wMCPv8DAj7/AwM9/wMDPP8DAzv/BAM6/wMDOv8EAzlgAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAA/////////////////////8AAAAPAAAADgAAAAYAAAAGAAAABgAAAAYAA
|
||||
AAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAA
|
||||
AAHAAAAD4AAAB/AAAA/4AAAf//////////8=
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,187 +0,0 @@
|
||||
using CleanFlashCommon;
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Diagnostics;
|
||||
using SharpCompress.Archives.SevenZip;
|
||||
using SharpCompress.Common;
|
||||
using SharpCompress.Readers;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace CleanFlashInstaller {
|
||||
public class Installer {
|
||||
public static void RegisterActiveX(string filename) {
|
||||
string relativeFilename = Path.GetFileName(filename);
|
||||
ProcessStartInfo info = new ProcessStartInfo {
|
||||
FileName = "regsvr32.exe",
|
||||
UseShellExecute = false,
|
||||
CreateNoWindow = true
|
||||
};
|
||||
|
||||
Directory.SetCurrentDirectory(Path.GetDirectoryName(filename));
|
||||
|
||||
info.Arguments = "/s /u " + relativeFilename;
|
||||
ExitedProcess process = ProcessUtils.RunProcess(info);
|
||||
|
||||
if (!process.IsSuccessful) {
|
||||
throw new InstallException(string.Format("Failed to unregister ActiveX plugin: error code {0}\n\n{1}", process.ExitCode, process.Output));
|
||||
}
|
||||
|
||||
info.Arguments = "/s " + relativeFilename;
|
||||
process = ProcessUtils.RunProcess(info);
|
||||
|
||||
if (!process.IsSuccessful) {
|
||||
throw new InstallException(string.Format("Failed to register ActiveX plugin: error code {0}\n\n{1}", process.ExitCode, process.Output));
|
||||
}
|
||||
}
|
||||
|
||||
public static void ExtractArchive(SevenZipArchive archive, Dictionary<string, InstallEntry> entries, IProgressForm form, InstallFlags flags) {
|
||||
IReader reader = archive.ExtractAllEntries();
|
||||
bool legacy = SystemInfo.IsLegacyWindows();
|
||||
string lastKey = null;
|
||||
|
||||
while (reader.MoveToNextEntry()) {
|
||||
if (reader.Entry.IsDirectory) {
|
||||
continue;
|
||||
}
|
||||
|
||||
string filename = reader.Entry.Key.Split('/')[0];
|
||||
string installKey = filename.Split('-')[0];
|
||||
InstallEntry installEntry = entries[installKey];
|
||||
|
||||
if (installEntry.RequiredFlags.GetValue() != InstallFlags.NONE) {
|
||||
if (!flags.IsSet(installEntry.RequiredFlags)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (flags.IsSet(InstallFlags.DEBUG) != filename.Contains("-debug")) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (installEntry.RequiredFlags.IsSet(InstallFlags.ACTIVEX)) {
|
||||
if (legacy != filename.Contains("-legacy")) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!installKey.Equals(lastKey)) {
|
||||
form.UpdateProgressLabel(installEntry.InstallText, true);
|
||||
|
||||
if (!Directory.Exists(installEntry.TargetDirectory)) {
|
||||
Directory.CreateDirectory(installEntry.TargetDirectory);
|
||||
}
|
||||
|
||||
lastKey = installKey;
|
||||
}
|
||||
|
||||
reader.WriteEntryToDirectory(installEntry.TargetDirectory, new ExtractionOptions() {
|
||||
ExtractFullPath = false,
|
||||
Overwrite = true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public static void CreateShortcut(string folder, string executable, string name, string description) {
|
||||
Type t = Type.GetTypeFromCLSID(new Guid("72C24DD5-D70A-438B-8A42-98424B88AFB8"));
|
||||
dynamic shell = Activator.CreateInstance(t);
|
||||
|
||||
try {
|
||||
var lnk = shell.CreateShortcut(Path.Combine(folder, name + ".lnk"));
|
||||
|
||||
try {
|
||||
lnk.TargetPath = executable;
|
||||
lnk.IconLocation = executable;
|
||||
lnk.Description = description;
|
||||
lnk.WorkingDirectory = folder;
|
||||
lnk.Save();
|
||||
} finally {
|
||||
Marshal.FinalReleaseComObject(lnk);
|
||||
}
|
||||
} finally {
|
||||
Marshal.FinalReleaseComObject(shell);
|
||||
}
|
||||
}
|
||||
|
||||
private static void InstallFromArchive(SevenZipArchive archive, IProgressForm form, InstallFlags flags) {
|
||||
string flash32Path = SystemInfo.GetFlash32Path();
|
||||
string flash64Path = SystemInfo.GetFlash64Path();
|
||||
string system32Path = SystemInfo.GetSystem32Path();
|
||||
string flashProgram32Path = SystemInfo.GetProgramFlash32Path();
|
||||
List<string> registryToApply = new List<string>() { Properties.Resources.installGeneral };
|
||||
|
||||
if (Environment.Is64BitOperatingSystem) {
|
||||
flags.SetFlag(InstallFlags.X64);
|
||||
registryToApply.Add(Properties.Resources.installGeneral64);
|
||||
}
|
||||
|
||||
Dictionary<string, InstallEntry> entries = new Dictionary<string, InstallEntry>() {
|
||||
{ "controlpanel", new InstallEntry("Installing Flash Player utilities...", InstallFlags.NONE, system32Path) },
|
||||
{ "uninstaller", new InstallEntry("Extracting uninstaller...", InstallFlags.NONE, flashProgram32Path) },
|
||||
{ "standalone", new InstallEntry("Installing 32-bit Standalone Flash Player...", InstallFlags.PLAYER, flashProgram32Path) },
|
||||
{ "ocx32", new InstallEntry("Installing 32-bit Flash Player for Internet Explorer...", InstallFlags.ACTIVEX, flash32Path) },
|
||||
{ "np32", new InstallEntry("Installing 32-bit Flash Player for Firefox...", InstallFlags.NETSCAPE, flash32Path, Properties.Resources.installNP) },
|
||||
{ "pp32", new InstallEntry("Installing 32-bit Flash Player for Chrome...", InstallFlags.PEPPER, flash32Path, Properties.Resources.installPP) },
|
||||
{ "ocx64", new InstallEntry("Installing 64-bit Flash Player for Internet Explorer...", InstallFlags.ACTIVEX | InstallFlags.X64, flash64Path) },
|
||||
{ "np64", new InstallEntry("Installing 64-bit Flash Player for Firefox...", InstallFlags.NETSCAPE | InstallFlags.X64, flash64Path, Properties.Resources.installNP64) },
|
||||
{ "pp64", new InstallEntry("Installing 64-bit Flash Player for Chrome...", InstallFlags.PEPPER | InstallFlags.X64, flash64Path, Properties.Resources.installPP64) },
|
||||
};
|
||||
|
||||
ExtractArchive(archive, entries, form, flags);
|
||||
|
||||
if (flags.IsSet(InstallFlags.PLAYER)) {
|
||||
bool debug = flags.IsSet(InstallFlags.DEBUG);
|
||||
string name = "Flash Player";
|
||||
string description = "Standalone Flash Player " + UpdateChecker.GetFlashVersion();
|
||||
string executable = Path.Combine(flashProgram32Path, debug ? "flashplayer_sa_debug.exe" : "flashplayer_sa.exe");
|
||||
|
||||
if (debug) {
|
||||
name += " (Debug)";
|
||||
description += " (Debug)";
|
||||
}
|
||||
|
||||
if (flags.IsSet(InstallFlags.PLAYER_START_MENU)) {
|
||||
CreateShortcut(Environment.GetFolderPath(Environment.SpecialFolder.StartMenu), executable, name, description);
|
||||
}
|
||||
|
||||
if (flags.IsSet(InstallFlags.PLAYER_DESKTOP)) {
|
||||
CreateShortcut(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), executable, name, description);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (InstallEntry entry in entries.Values) {
|
||||
if (flags.IsSet(entry.RequiredFlags) && entry.RegistryInstructions != null) {
|
||||
registryToApply.Add(entry.RegistryInstructions);
|
||||
}
|
||||
}
|
||||
|
||||
form.UpdateProgressLabel("Applying registry changes...", true);
|
||||
RegistryManager.ApplyRegistry(registryToApply);
|
||||
|
||||
if (flags.IsSet(InstallFlags.ACTIVEX)) {
|
||||
form.UpdateProgressLabel("Activating 32-bit Flash Player for Internet Explorer...", true);
|
||||
RegisterActiveX(Path.Combine(flash32Path, string.Format("Flash32_{0}.ocx", SystemInfo.GetVersionPath())));
|
||||
|
||||
if (Environment.Is64BitOperatingSystem) {
|
||||
form.UpdateProgressLabel("Activating 64-bit Flash Player for Internet Explorer...", true);
|
||||
RegisterActiveX(Path.Combine(flash64Path, string.Format("Flash64_{0}.ocx", SystemInfo.GetVersionPath())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Install(IProgressForm form, InstallFlags flags) {
|
||||
if (flags.IsNoneSet()) {
|
||||
// No packages should be installed.
|
||||
return;
|
||||
}
|
||||
|
||||
using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("CleanFlashInstaller.cleanflash.7z")) {
|
||||
using (SevenZipArchive archive = SevenZipArchive.Open(stream)) {
|
||||
InstallFromArchive(archive, form, flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CleanFlashInstaller {
|
||||
static class Program {
|
||||
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main(string[] args) {
|
||||
if (Environment.OSVersion.Version.Major >= 6) {
|
||||
//SetProcessDPIAware();
|
||||
}
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new InstallForm());
|
||||
}
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool SetProcessDPIAware();
|
||||
}
|
||||
}
|
||||
@@ -1,186 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace CleanFlashInstaller.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CleanFlashInstaller.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap flashLogo {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("flashLogo", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Control Panel\Extended Properties\System.ControlPanel.Category]
|
||||
///"${SYSTEM_32_PATH}\\FlashPlayerCPLApp.cpl"=dword:0000000a
|
||||
///
|
||||
///[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashPlayerApp.exe]
|
||||
///"DisableExceptionChainValidation"=dword:00000000
|
||||
///
|
||||
///[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Clean Flash Player]
|
||||
///"DisplayName"="Clean Flash Player ${VERSION}"
|
||||
///"HelpLink"="https [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string installGeneral {
|
||||
get {
|
||||
return ResourceManager.GetString("installGeneral", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to [HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Control Panel\Extended Properties\System.ControlPanel.Category]
|
||||
///"${SYSTEM_32_PATH}\\FlashPlayerCPLApp.cpl"=dword:0000000a
|
||||
///
|
||||
///[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashPlayerApp.exe]
|
||||
///"DisableExceptionChainValidation"=dword:00000000.
|
||||
/// </summary>
|
||||
internal static string installGeneral64 {
|
||||
get {
|
||||
return ResourceManager.GetString("installGeneral64", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to [HKEY_LOCAL_MACHINE\Software\Macromedia\FlashPlayerPlugin]
|
||||
///"isPartner"=dword:00000001
|
||||
///"Version"="${VERSION}"
|
||||
///"PlayerPath"="${FLASH_64_PATH}\\NPSWF${ARCH}_${VERSION_PATH}.dll"
|
||||
///"UninstallerPath"=-
|
||||
///"isScriptDebugger"=dword:00000000
|
||||
///"isESR"=dword:00000000
|
||||
///"isMSI"=dword:00000000
|
||||
///
|
||||
///[HKEY_LOCAL_MACHINE\Software\Macromedia\FlashPlayerPluginReleaseType]
|
||||
///"Release"=dword:00000001
|
||||
///
|
||||
///[HKEY_LOCAL_MACHINE\Software\MozillaPlugins\@adobe.com/FlashPlayer]
|
||||
///"Vendor"="Adobe"
|
||||
///"ProductName"="Adobe® Flash® Player ${VER [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string installNP {
|
||||
get {
|
||||
return ResourceManager.GetString("installNP", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to [HKEY_LOCAL_MACHINE\Software\Wow6432Node\Macromedia\FlashPlayerPlugin]
|
||||
///"PlayerPath"="${FLASH_32_PATH}\\NPSWF_${VERSION_PATH}.dll"
|
||||
///"Version"="${VERSION}"
|
||||
///"UninstallerPath"=-
|
||||
///"isScriptDebugger"=dword:00000000
|
||||
///"isESR"=dword:00000000
|
||||
///"isMSI"=dword:00000000
|
||||
///"isPartner"=dword:00000001
|
||||
///
|
||||
///[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Macromedia\FlashPlayerPluginReleaseType]
|
||||
///"Release"=dword:00000001
|
||||
///
|
||||
///[HKEY_LOCAL_MACHINE\Software\Wow6432Node\MozillaPlugins\@adobe.com/FlashPlayer]
|
||||
///"ProductName"="Adobe® Flash® P [rest of string was truncated]";.
|
||||
/// </summary>
|
||||
internal static string installNP64 {
|
||||
get {
|
||||
return ResourceManager.GetString("installNP64", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to [HKEY_LOCAL_MACHINE\Software\Macromedia\FlashPlayerPepper]
|
||||
///"UninstallerPath"=-
|
||||
///"PlayerPath"="${FLASH_64_PATH}\\pepflashplayer${ARCH}_${VERSION_PATH}.dll"
|
||||
///"isScriptDebugger"=dword:00000000
|
||||
///"isESR"=dword:00000000
|
||||
///"isMSI"=dword:00000000
|
||||
///"isPartner"=dword:00000001
|
||||
///"Version"="${VERSION}"
|
||||
///
|
||||
///[HKEY_LOCAL_MACHINE\Software\Macromedia\FlashPlayerPepperReleaseType]
|
||||
///"Release"=dword:00000001.
|
||||
/// </summary>
|
||||
internal static string installPP {
|
||||
get {
|
||||
return ResourceManager.GetString("installPP", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to [HKEY_LOCAL_MACHINE\Software\Wow6432Node\Macromedia\FlashPlayerPepper]
|
||||
///"UninstallerPath"=-
|
||||
///"PlayerPath"="${FLASH_32_PATH}\\pepflashplayer32_${VERSION_PATH}.dll"
|
||||
///"isScriptDebugger"=dword:00000000
|
||||
///"isESR"=dword:00000000
|
||||
///"isMSI"=dword:00000000
|
||||
///"isPartner"=dword:00000001
|
||||
///"Version"="${VERSION}"
|
||||
///
|
||||
///[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Macromedia\FlashPlayerPepperReleaseType]
|
||||
///"Release"=dword:00000001.
|
||||
/// </summary>
|
||||
internal static string installPP64 {
|
||||
get {
|
||||
return ResourceManager.GetString("installPP64", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,226 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="flashLogo" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\..\CleanFlashCommon\flashLogo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="installGeneral" xml:space="preserve">
|
||||
<value>[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Control Panel\Extended Properties\System.ControlPanel.Category]
|
||||
"${SYSTEM_32_PATH}\\FlashPlayerCPLApp.cpl"=dword:0000000a
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashPlayerApp.exe]
|
||||
"DisableExceptionChainValidation"=dword:00000000
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Clean Flash Player]
|
||||
"DisplayName"="Clean Flash Player ${VERSION}"
|
||||
"HelpLink"="https://gitlab.com/cleanflash/installer#clean-flash-player"
|
||||
"NoModify"=dword:00000001
|
||||
"NoRepair"=dword:00000001
|
||||
"URLInfoAbout"="https://gitlab.com/cleanflash/installer#clean-flash-player"
|
||||
"URLUpdateInfo"="https://gitlab.com/cleanflash/installer#clean-flash-player"
|
||||
"VersionMajor"=dword:00000022
|
||||
"VersionMinor"=dword:00000000
|
||||
"Publisher"="CleanFlash Team"
|
||||
"EstimatedSize"=dword:00011cb8
|
||||
"DisplayIcon"="${PROGRAM_FLASH_32_PATH}\\FlashUtil_Uninstall.exe"
|
||||
"UninstallString"="${PROGRAM_FLASH_32_PATH}\\FlashUtil_Uninstall.exe"
|
||||
"DisplayVersion"="${VERSION}"</value>
|
||||
</data>
|
||||
<data name="installGeneral64" xml:space="preserve">
|
||||
<value>[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Control Panel\Extended Properties\System.ControlPanel.Category]
|
||||
"${SYSTEM_32_PATH}\\FlashPlayerCPLApp.cpl"=dword:0000000a
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashPlayerApp.exe]
|
||||
"DisableExceptionChainValidation"=dword:00000000</value>
|
||||
</data>
|
||||
<data name="installNP" xml:space="preserve">
|
||||
<value>[HKEY_LOCAL_MACHINE\Software\Macromedia\FlashPlayerPlugin]
|
||||
"isPartner"=dword:00000001
|
||||
"Version"="${VERSION}"
|
||||
"PlayerPath"="${FLASH_64_PATH}\\NPSWF${ARCH}_${VERSION_PATH}.dll"
|
||||
"UninstallerPath"=-
|
||||
"isScriptDebugger"=dword:00000000
|
||||
"isESR"=dword:00000000
|
||||
"isMSI"=dword:00000000
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Macromedia\FlashPlayerPluginReleaseType]
|
||||
"Release"=dword:00000001
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\MozillaPlugins\@adobe.com/FlashPlayer]
|
||||
"Vendor"="Adobe"
|
||||
"ProductName"="Adobe® Flash® Player ${VERSION} Plugin"
|
||||
"Path"="${FLASH_64_PATH}\\NPSWF${ARCH}_${VERSION_PATH}.dll"
|
||||
"Version"="${VERSION}"
|
||||
"Description"="Adobe® Flash® Player ${VERSION} Plugin"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashPlayerPlugin_${VERSION_PATH}.exe]
|
||||
"DisableExceptionChainValidation"=dword:00000000</value>
|
||||
</data>
|
||||
<data name="installNP64" xml:space="preserve">
|
||||
<value>[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Macromedia\FlashPlayerPlugin]
|
||||
"PlayerPath"="${FLASH_32_PATH}\\NPSWF_${VERSION_PATH}.dll"
|
||||
"Version"="${VERSION}"
|
||||
"UninstallerPath"=-
|
||||
"isScriptDebugger"=dword:00000000
|
||||
"isESR"=dword:00000000
|
||||
"isMSI"=dword:00000000
|
||||
"isPartner"=dword:00000001
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Macromedia\FlashPlayerPluginReleaseType]
|
||||
"Release"=dword:00000001
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Wow6432Node\MozillaPlugins\@adobe.com/FlashPlayer]
|
||||
"ProductName"="Adobe® Flash® Player ${VERSION} Plugin"
|
||||
"Description"="Adobe® Flash® Player ${VERSION} Plugin"
|
||||
"Version"="${VERSION}"
|
||||
"XPTPath"="${FLASH_32_PATH}\\flashplayer.xpt"
|
||||
"Vendor"="Adobe"
|
||||
"Path"="${FLASH_32_PATH}\\NPSWF32_${VERSION_PATH}.dll"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashPlayerPlugin_${VERSION_PATH}.exe]
|
||||
"DisableExceptionChainValidation"=dword:00000000</value>
|
||||
</data>
|
||||
<data name="installPP" xml:space="preserve">
|
||||
<value>[HKEY_LOCAL_MACHINE\Software\Macromedia\FlashPlayerPepper]
|
||||
"UninstallerPath"=-
|
||||
"PlayerPath"="${FLASH_64_PATH}\\pepflashplayer${ARCH}_${VERSION_PATH}.dll"
|
||||
"isScriptDebugger"=dword:00000000
|
||||
"isESR"=dword:00000000
|
||||
"isMSI"=dword:00000000
|
||||
"isPartner"=dword:00000001
|
||||
"Version"="${VERSION}"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Macromedia\FlashPlayerPepperReleaseType]
|
||||
"Release"=dword:00000001</value>
|
||||
</data>
|
||||
<data name="installPP64" xml:space="preserve">
|
||||
<value>[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Macromedia\FlashPlayerPepper]
|
||||
"UninstallerPath"=-
|
||||
"PlayerPath"="${FLASH_32_PATH}\\pepflashplayer32_${VERSION_PATH}.dll"
|
||||
"isScriptDebugger"=dword:00000000
|
||||
"isESR"=dword:00000000
|
||||
"isMSI"=dword:00000000
|
||||
"isPartner"=dword:00000001
|
||||
"Version"="${VERSION}"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Macromedia\FlashPlayerPepperReleaseType]
|
||||
"Release"=dword:00000001</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,26 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace CleanFlashInstaller.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.2.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<assemblyIdentity version="1.0.0.0" name="CleanFlashInstaller.app"/>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
|
||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
|
||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
|
||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
|
||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
|
||||
</application>
|
||||
</compatibility>
|
||||
</assembly>
|
||||
|
Before Width: | Height: | Size: 115 KiB |
@@ -1,50 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<RootNamespace>CleanFlashUninstaller</RootNamespace>
|
||||
<AssemblyName>CleanFlashUninstaller</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net40</TargetFramework>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<ApplicationIcon>icon.ico</ApplicationIcon>
|
||||
<StartupObject></StartupObject>
|
||||
<Product>Clean Flash Player 34.0.0.330 Uninstaller</Product>
|
||||
<AssemblyTitle>Clean Flash Player 34.0.0.330 Uninstaller</AssemblyTitle>
|
||||
<FileVersion>34.0.0.330</FileVersion>
|
||||
<AssemblyVersion>34.0.0.330</AssemblyVersion>
|
||||
<Version>34.0.0.330</Version>
|
||||
<Authors>FlashPatch Team</Authors>
|
||||
<Company>FlashPatch Team</Company>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="icon.ico" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="ILRepack.Lib.MSBuild.Task" Version="2.0.18.2" />
|
||||
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies.net40" Version="1.0.3">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CleanFlashCommon\CleanFlashCommon.csproj" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'">
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<DebugType>None</DebugType>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,89 +0,0 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace CleanFlashUninstaller {
|
||||
static class Program {
|
||||
[Flags]
|
||||
internal enum MoveFileFlags {
|
||||
None = 0,
|
||||
ReplaceExisting = 1,
|
||||
CopyAllowed = 2,
|
||||
DelayUntilReboot = 4,
|
||||
WriteThrough = 8,
|
||||
CreateHardlink = 16,
|
||||
FailIfNotTrackable = 32,
|
||||
}
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
static extern bool MoveFileEx(
|
||||
string lpExistingFileName,
|
||||
string lpNewFileName,
|
||||
MoveFileFlags dwFlags);
|
||||
|
||||
static bool DeleteOnReboot(string filename) {
|
||||
return MoveFileEx(filename, null, MoveFileFlags.DelayUntilReboot);
|
||||
}
|
||||
|
||||
static string TrimPath(string path) {
|
||||
return path.TrimEnd(new[] { '/', '\\' });
|
||||
}
|
||||
|
||||
static bool EnsureRunInTemp() {
|
||||
string tempFolder = TrimPath(Path.GetTempPath());
|
||||
string currentPath = Application.ExecutablePath;
|
||||
string currentFolder = TrimPath(Path.GetDirectoryName(currentPath));
|
||||
|
||||
if (currentFolder.Equals(tempFolder, StringComparison.OrdinalIgnoreCase)) {
|
||||
// Already running in the temp directory.
|
||||
return true;
|
||||
}
|
||||
|
||||
string currentExeName = Path.GetFileName(currentPath);
|
||||
string newPath = Path.Combine(tempFolder, currentExeName);
|
||||
|
||||
if (File.Exists(newPath)) {
|
||||
try {
|
||||
// Attempt to delete the old version of the uninstaller.
|
||||
File.Delete(newPath);
|
||||
} catch {
|
||||
// Uninstaller is already running.
|
||||
Application.Exit();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Copy the new file and mark it as delete-on-reboot
|
||||
File.Copy(currentPath, newPath);
|
||||
DeleteOnReboot(newPath);
|
||||
|
||||
// Start the new process and end the old one
|
||||
Process.Start(newPath);
|
||||
Application.Exit();
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main() {
|
||||
if (!EnsureRunInTemp()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Environment.OSVersion.Version.Major >= 6) {
|
||||
//SetProcessDPIAware();
|
||||
}
|
||||
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new UninstallForm());
|
||||
}
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
private static extern bool SetProcessDPIAware();
|
||||
}
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace CleanFlashUninstaller.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CleanFlashUninstaller.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap flashLogo {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("flashLogo", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="flashLogo" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\..\CleanFlashCommon\flashLogo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,25 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace CleanFlashUninstaller.Properties {
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
|
Before Width: | Height: | Size: 1.4 KiB |
@@ -1,324 +0,0 @@
|
||||
|
||||
namespace CleanFlashUninstaller {
|
||||
partial class UninstallForm {
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing) {
|
||||
if (disposing && (components != null)) {
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UninstallForm));
|
||||
this.separator = new System.Windows.Forms.Label();
|
||||
this.checkboxImages = new System.Windows.Forms.ImageList(this.components);
|
||||
this.flashLogo = new System.Windows.Forms.PictureBox();
|
||||
this.titleLabel = new System.Windows.Forms.Label();
|
||||
this.subtitleLabel = new System.Windows.Forms.Label();
|
||||
this.installPanel = new System.Windows.Forms.Panel();
|
||||
this.progressBar = new CleanFlashCommon.SmoothProgressBar();
|
||||
this.progressLabel = new System.Windows.Forms.Label();
|
||||
this.uninstallProgressLabel = new System.Windows.Forms.Label();
|
||||
this.beforeInstallPanel = new System.Windows.Forms.Panel();
|
||||
this.beforeInstallLabel = new System.Windows.Forms.Label();
|
||||
this.completePanel = new System.Windows.Forms.Panel();
|
||||
this.completeLabel = new System.Windows.Forms.LinkLabel();
|
||||
this.failurePanel = new System.Windows.Forms.Panel();
|
||||
this.copyErrorButton = new CleanFlashCommon.GradientButton();
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.InstallForm_FormClosing);
|
||||
this.failureBox = new System.Windows.Forms.TextBox();
|
||||
this.failureText = new System.Windows.Forms.Label();
|
||||
this.nextButton = new CleanFlashCommon.GradientButton();
|
||||
this.prevButton = new CleanFlashCommon.GradientButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.flashLogo)).BeginInit();
|
||||
this.installPanel.SuspendLayout();
|
||||
this.beforeInstallPanel.SuspendLayout();
|
||||
this.completePanel.SuspendLayout();
|
||||
this.failurePanel.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// separator
|
||||
//
|
||||
this.separator.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
|
||||
this.separator.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
|
||||
this.separator.Location = new System.Drawing.Point(0, 270);
|
||||
this.separator.Name = "separator";
|
||||
this.separator.Size = new System.Drawing.Size(732, 1);
|
||||
this.separator.TabIndex = 1;
|
||||
//
|
||||
// checkboxImages
|
||||
//
|
||||
this.checkboxImages.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("checkboxImages.ImageStream")));
|
||||
this.checkboxImages.TransparentColor = System.Drawing.Color.Transparent;
|
||||
this.checkboxImages.Images.SetKeyName(0, "checkboxOff.png");
|
||||
this.checkboxImages.Images.SetKeyName(1, "checkboxOn.png");
|
||||
//
|
||||
// flashLogo
|
||||
//
|
||||
this.flashLogo.Image = global::CleanFlashUninstaller.Properties.Resources.flashLogo;
|
||||
this.flashLogo.Location = new System.Drawing.Point(90, 36);
|
||||
this.flashLogo.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.flashLogo.Name = "flashLogo";
|
||||
this.flashLogo.Size = new System.Drawing.Size(109, 107);
|
||||
this.flashLogo.TabIndex = 4;
|
||||
this.flashLogo.TabStop = false;
|
||||
//
|
||||
// titleLabel
|
||||
//
|
||||
this.titleLabel.AutoSize = true;
|
||||
this.titleLabel.Font = new System.Drawing.Font("Segoe UI", 24F);
|
||||
this.titleLabel.Location = new System.Drawing.Point(233, 54);
|
||||
this.titleLabel.Name = "titleLabel";
|
||||
this.titleLabel.Size = new System.Drawing.Size(274, 45);
|
||||
this.titleLabel.TabIndex = 5;
|
||||
this.titleLabel.Text = "Clean Flash Player";
|
||||
//
|
||||
// subtitleLabel
|
||||
//
|
||||
this.subtitleLabel.AutoSize = true;
|
||||
this.subtitleLabel.Font = new System.Drawing.Font("Segoe UI", 13F);
|
||||
this.subtitleLabel.Location = new System.Drawing.Point(280, 99);
|
||||
this.subtitleLabel.Name = "subtitleLabel";
|
||||
this.subtitleLabel.Size = new System.Drawing.Size(231, 25);
|
||||
this.subtitleLabel.TabIndex = 6;
|
||||
this.subtitleLabel.Text = "built from unknown version";
|
||||
//
|
||||
// installPanel
|
||||
//
|
||||
this.installPanel.Controls.Add(this.progressBar);
|
||||
this.installPanel.Controls.Add(this.progressLabel);
|
||||
this.installPanel.Controls.Add(this.uninstallProgressLabel);
|
||||
this.installPanel.Location = new System.Drawing.Point(90, 162);
|
||||
this.installPanel.Name = "installPanel";
|
||||
this.installPanel.Size = new System.Drawing.Size(545, 105);
|
||||
this.installPanel.TabIndex = 10;
|
||||
//
|
||||
// progressBar
|
||||
//
|
||||
this.progressBar.Location = new System.Drawing.Point(49, 58);
|
||||
this.progressBar.Maximum = 100;
|
||||
this.progressBar.Minimum = 0;
|
||||
this.progressBar.Name = "progressBar";
|
||||
this.progressBar.ProgressBarColor1 = System.Drawing.Color.FromArgb(((int)(((byte)(97)))), ((int)(((byte)(147)))), ((int)(((byte)(232)))));
|
||||
this.progressBar.ProgressBarColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(28)))), ((int)(((byte)(99)))), ((int)(((byte)(232)))));
|
||||
this.progressBar.Size = new System.Drawing.Size(451, 23);
|
||||
this.progressBar.TabIndex = 2;
|
||||
this.progressBar.Value = 0;
|
||||
//
|
||||
// progressLabel
|
||||
//
|
||||
this.progressLabel.AutoSize = true;
|
||||
this.progressLabel.Location = new System.Drawing.Point(46, 30);
|
||||
this.progressLabel.Name = "progressLabel";
|
||||
this.progressLabel.Size = new System.Drawing.Size(74, 17);
|
||||
this.progressLabel.TabIndex = 1;
|
||||
this.progressLabel.Text = "Preparing...";
|
||||
//
|
||||
// uninstallProgressLabel
|
||||
//
|
||||
this.uninstallProgressLabel.AutoSize = true;
|
||||
this.uninstallProgressLabel.Location = new System.Drawing.Point(3, 0);
|
||||
this.uninstallProgressLabel.Name = "uninstallProgressLabel";
|
||||
this.uninstallProgressLabel.Size = new System.Drawing.Size(166, 17);
|
||||
this.uninstallProgressLabel.TabIndex = 0;
|
||||
this.uninstallProgressLabel.Text = "Uninstallation in progress...";
|
||||
//
|
||||
// beforeInstallPanel
|
||||
//
|
||||
this.beforeInstallPanel.Controls.Add(this.beforeInstallLabel);
|
||||
this.beforeInstallPanel.Location = new System.Drawing.Point(90, 162);
|
||||
this.beforeInstallPanel.Name = "beforeInstallPanel";
|
||||
this.beforeInstallPanel.Size = new System.Drawing.Size(545, 105);
|
||||
this.beforeInstallPanel.TabIndex = 11;
|
||||
//
|
||||
// beforeInstallLabel
|
||||
//
|
||||
this.beforeInstallLabel.AutoSize = true;
|
||||
this.beforeInstallLabel.Location = new System.Drawing.Point(3, 2);
|
||||
this.beforeInstallLabel.Name = "beforeInstallLabel";
|
||||
this.beforeInstallLabel.Size = new System.Drawing.Size(532, 85);
|
||||
this.beforeInstallLabel.TabIndex = 12;
|
||||
this.beforeInstallLabel.Text = resources.GetString("beforeInstallLabel.Text");
|
||||
//
|
||||
// completePanel
|
||||
//
|
||||
this.completePanel.Controls.Add(this.completeLabel);
|
||||
this.completePanel.Location = new System.Drawing.Point(90, 162);
|
||||
this.completePanel.Name = "completePanel";
|
||||
this.completePanel.Size = new System.Drawing.Size(545, 105);
|
||||
this.completePanel.TabIndex = 12;
|
||||
//
|
||||
// completeLabel
|
||||
//
|
||||
this.completeLabel.AutoSize = true;
|
||||
this.completeLabel.LinkArea = new System.Windows.Forms.LinkArea(0, 0);
|
||||
this.completeLabel.LinkColor = System.Drawing.Color.White;
|
||||
this.completeLabel.Location = new System.Drawing.Point(0, 0);
|
||||
this.completeLabel.Name = "completeLabel";
|
||||
this.completeLabel.Size = new System.Drawing.Size(409, 68);
|
||||
this.completeLabel.TabIndex = 0;
|
||||
this.completeLabel.Text = "\r\nAll versions of Flash Player have been successfully uninstalled.\r\n\r\nIf you ever" +
|
||||
" change your mind, check out Clean Flash Player\'s website!";
|
||||
this.completeLabel.VisitedLinkColor = System.Drawing.Color.White;
|
||||
this.completeLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.completeLabel_LinkClicked);
|
||||
//
|
||||
// failurePanel
|
||||
//
|
||||
this.failurePanel.Controls.Add(this.copyErrorButton);
|
||||
this.failurePanel.Controls.Add(this.failureBox);
|
||||
this.failurePanel.Controls.Add(this.failureText);
|
||||
this.failurePanel.Location = new System.Drawing.Point(90, 162);
|
||||
this.failurePanel.Name = "failurePanel";
|
||||
this.failurePanel.Size = new System.Drawing.Size(545, 105);
|
||||
this.failurePanel.TabIndex = 13;
|
||||
//
|
||||
// copyErrorButton
|
||||
//
|
||||
this.copyErrorButton.BackColor = System.Drawing.Color.Black;
|
||||
this.copyErrorButton.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(118)))), ((int)(((byte)(118)))), ((int)(((byte)(118)))));
|
||||
this.copyErrorButton.Color2 = System.Drawing.Color.FromArgb(((int)(((byte)(81)))), ((int)(((byte)(81)))), ((int)(((byte)(81)))));
|
||||
this.copyErrorButton.DisableAlpha = 0.644D;
|
||||
this.copyErrorButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.copyErrorButton.ForeColor = System.Drawing.SystemColors.Control;
|
||||
this.copyErrorButton.HoverAlpha = 0.875D;
|
||||
this.copyErrorButton.Location = new System.Drawing.Point(441, 58);
|
||||
this.copyErrorButton.Name = "copyErrorButton";
|
||||
this.copyErrorButton.Size = new System.Drawing.Size(104, 31);
|
||||
this.copyErrorButton.TabIndex = 14;
|
||||
this.copyErrorButton.Text = "COPY";
|
||||
this.copyErrorButton.UseVisualStyleBackColor = false;
|
||||
this.copyErrorButton.Click += new System.EventHandler(this.copyErrorButton_Click);
|
||||
//
|
||||
// failureBox
|
||||
//
|
||||
this.failureBox.Location = new System.Drawing.Point(4, 44);
|
||||
this.failureBox.Multiline = true;
|
||||
this.failureBox.Name = "failureBox";
|
||||
this.failureBox.ReadOnly = true;
|
||||
this.failureBox.Size = new System.Drawing.Size(431, 58);
|
||||
this.failureBox.TabIndex = 15;
|
||||
//
|
||||
// failureText
|
||||
//
|
||||
this.failureText.AutoSize = true;
|
||||
this.failureText.Location = new System.Drawing.Point(3, 2);
|
||||
this.failureText.Name = "failureText";
|
||||
this.failureText.Size = new System.Drawing.Size(432, 34);
|
||||
this.failureText.TabIndex = 14;
|
||||
this.failureText.Text = "Oops! The installation process has encountered an unexpected problem.\r\nThe follow" +
|
||||
"ing details could be useful. Press the Retry button to try again.";
|
||||
//
|
||||
// nextButton
|
||||
//
|
||||
this.nextButton.BackColor = System.Drawing.Color.Black;
|
||||
this.nextButton.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(118)))), ((int)(((byte)(118)))), ((int)(((byte)(118)))));
|
||||
this.nextButton.Color2 = System.Drawing.Color.FromArgb(((int)(((byte)(81)))), ((int)(((byte)(81)))), ((int)(((byte)(81)))));
|
||||
this.nextButton.DisableAlpha = 0.644D;
|
||||
this.nextButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.nextButton.ForeColor = System.Drawing.SystemColors.Control;
|
||||
this.nextButton.HoverAlpha = 0.875D;
|
||||
this.nextButton.Location = new System.Drawing.Point(497, 286);
|
||||
this.nextButton.Name = "nextButton";
|
||||
this.nextButton.Size = new System.Drawing.Size(138, 31);
|
||||
this.nextButton.TabIndex = 7;
|
||||
this.nextButton.Text = "UNINSTALL";
|
||||
this.nextButton.UseVisualStyleBackColor = false;
|
||||
this.nextButton.Click += new System.EventHandler(this.nextButton_Click);
|
||||
//
|
||||
// prevButton
|
||||
//
|
||||
prevButton.TabStop = false;
|
||||
this.prevButton.BackColor = System.Drawing.Color.Black;
|
||||
this.prevButton.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(118)))), ((int)(((byte)(118)))), ((int)(((byte)(118)))));
|
||||
this.prevButton.Color2 = System.Drawing.Color.FromArgb(((int)(((byte)(81)))), ((int)(((byte)(81)))), ((int)(((byte)(81)))));
|
||||
this.prevButton.DisableAlpha = 0.644D;
|
||||
this.prevButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
|
||||
this.prevButton.ForeColor = System.Drawing.SystemColors.Control;
|
||||
this.prevButton.HoverAlpha = 0.875D;
|
||||
this.prevButton.Location = new System.Drawing.Point(90, 286);
|
||||
this.prevButton.Name = "prevButton";
|
||||
this.prevButton.Size = new System.Drawing.Size(138, 31);
|
||||
this.prevButton.TabIndex = 3;
|
||||
this.prevButton.Text = "QUIT";
|
||||
this.prevButton.UseVisualStyleBackColor = false;
|
||||
this.prevButton.Click += new System.EventHandler(this.prevButton_Click);
|
||||
//
|
||||
// UninstallForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(50)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
|
||||
this.ClientSize = new System.Drawing.Size(712, 329);
|
||||
this.Controls.Add(this.nextButton);
|
||||
this.Controls.Add(this.subtitleLabel);
|
||||
this.Controls.Add(this.titleLabel);
|
||||
this.Controls.Add(this.flashLogo);
|
||||
this.Controls.Add(this.prevButton);
|
||||
this.Controls.Add(this.separator);
|
||||
this.Controls.Add(this.beforeInstallPanel);
|
||||
this.Controls.Add(this.installPanel);
|
||||
this.Controls.Add(this.failurePanel);
|
||||
this.Controls.Add(this.completePanel);
|
||||
this.Font = new System.Drawing.Font("Segoe UI", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.ForeColor = System.Drawing.SystemColors.ControlLightLight;
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Margin = new System.Windows.Forms.Padding(4);
|
||||
this.MaximizeBox = false;
|
||||
this.Name = "UninstallForm";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "Clean Flash Player Dev Uninstaller";
|
||||
this.Load += new System.EventHandler(this.UninstallForm_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.flashLogo)).EndInit();
|
||||
this.installPanel.ResumeLayout(false);
|
||||
this.installPanel.PerformLayout();
|
||||
this.beforeInstallPanel.ResumeLayout(false);
|
||||
this.beforeInstallPanel.PerformLayout();
|
||||
this.completePanel.ResumeLayout(false);
|
||||
this.completePanel.PerformLayout();
|
||||
this.failurePanel.ResumeLayout(false);
|
||||
this.failurePanel.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private System.Windows.Forms.Label separator;
|
||||
private System.Windows.Forms.ImageList checkboxImages;
|
||||
private CleanFlashCommon.GradientButton prevButton;
|
||||
private System.Windows.Forms.PictureBox flashLogo;
|
||||
private System.Windows.Forms.Label titleLabel;
|
||||
private System.Windows.Forms.Label subtitleLabel;
|
||||
private CleanFlashCommon.GradientButton nextButton;
|
||||
private System.Windows.Forms.Panel installPanel;
|
||||
private CleanFlashCommon.SmoothProgressBar progressBar;
|
||||
private System.Windows.Forms.Label progressLabel;
|
||||
private System.Windows.Forms.Label uninstallProgressLabel;
|
||||
private System.Windows.Forms.Panel beforeInstallPanel;
|
||||
private System.Windows.Forms.Label beforeInstallLabel;
|
||||
private System.Windows.Forms.Panel completePanel;
|
||||
private System.Windows.Forms.LinkLabel completeLabel;
|
||||
private System.Windows.Forms.Panel failurePanel;
|
||||
private System.Windows.Forms.TextBox failureBox;
|
||||
private System.Windows.Forms.Label failureText;
|
||||
private CleanFlashCommon.GradientButton copyErrorButton;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,156 +0,0 @@
|
||||
using CleanFlashCommon;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace CleanFlashUninstaller {
|
||||
public partial class UninstallForm : Form, IProgressForm {
|
||||
private static int UNINSTALL_TICKS = 9;
|
||||
|
||||
public UninstallForm() {
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void HideAllPanels() {
|
||||
beforeInstallPanel.Visible = false;
|
||||
installPanel.Visible = false;
|
||||
completePanel.Visible = false;
|
||||
failurePanel.Visible = false;
|
||||
}
|
||||
|
||||
private void OpenBeforeInstall() {
|
||||
HideAllPanels();
|
||||
beforeInstallPanel.Visible = true;
|
||||
prevButton.Enabled = true;
|
||||
nextButton.Text = "UNINSTALL";
|
||||
}
|
||||
|
||||
private void OpenInstall() {
|
||||
HideAllPanels();
|
||||
installPanel.Visible = true;
|
||||
prevButton.Enabled = false;
|
||||
nextButton.Visible = false;
|
||||
BeginInstall();
|
||||
}
|
||||
|
||||
private void OpenComplete() {
|
||||
HideAllPanels();
|
||||
completePanel.Visible = true;
|
||||
prevButton.Enabled = true;
|
||||
|
||||
completeLabel.Links.Clear();
|
||||
completeLabel.Links.Add(new LinkLabel.Link(110, 28));
|
||||
}
|
||||
|
||||
private void OpenFailure(Exception e) {
|
||||
HideAllPanels();
|
||||
failurePanel.Visible = true;
|
||||
prevButton.Enabled = true;
|
||||
nextButton.Text = "RETRY";
|
||||
nextButton.Visible = true;
|
||||
failureBox.Text = e.ToString();
|
||||
}
|
||||
|
||||
private void BeginInstall() {
|
||||
progressBar.Value = 0;
|
||||
progressBar.Maximum = UNINSTALL_TICKS;
|
||||
|
||||
new Task(new Action(() => {
|
||||
IntPtr redirection = RedirectionManager.DisableRedirection();
|
||||
|
||||
try {
|
||||
Uninstaller.Uninstall(this);
|
||||
Complete();
|
||||
} catch (Exception e) {
|
||||
Failure(e);
|
||||
} finally {
|
||||
RedirectionManager.EnableRedirection(redirection);
|
||||
}
|
||||
})).Start();
|
||||
}
|
||||
|
||||
private void UninstallForm_Load(object sender, EventArgs e) {
|
||||
string version = UpdateChecker.GetFlashVersion();
|
||||
|
||||
subtitleLabel.Text = string.Format("built from version {0} (China)", version);
|
||||
Text = string.Format("Clean Flash Player {0} Uninstaller", version);
|
||||
|
||||
OpenBeforeInstall();
|
||||
}
|
||||
|
||||
private void prevButton_Click(object sender, EventArgs e) {
|
||||
Application.Exit();
|
||||
}
|
||||
|
||||
private void nextButton_Click(object sender, EventArgs e) {
|
||||
if (beforeInstallPanel.Visible || failurePanel.Visible) {
|
||||
OpenInstall();
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateProgressLabel(string text, bool tick) {
|
||||
Invoke(new Action(() => {
|
||||
progressLabel.Text = text;
|
||||
|
||||
if (tick) {
|
||||
progressBar.Value++;
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
public void TickProgress() {
|
||||
Invoke(new Action(() => {
|
||||
progressBar.Value++;
|
||||
}));
|
||||
}
|
||||
|
||||
public void Complete() {
|
||||
Invoke(new Action(OpenComplete));
|
||||
}
|
||||
|
||||
public void Failure(Exception e) {
|
||||
Invoke(new Action(() => OpenFailure(e)));
|
||||
}
|
||||
|
||||
private void completeLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) {
|
||||
Process.Start("https://gitlab.com/cleanflash/installer#clean-flash-player");
|
||||
}
|
||||
|
||||
private void copyErrorButton_Click(object sender, EventArgs e) {
|
||||
Clipboard.SetText(failureBox.Text);
|
||||
MessageBox.Show("Copied error message to clipboard!", "Clean Flash Installer", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
|
||||
// note: copy pasted from installer; todo: single F for both
|
||||
private void InstallForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||
{
|
||||
bool v1 = true;
|
||||
// if installing
|
||||
// note: msgbox not pauses the process
|
||||
if (installPanel.Visible)
|
||||
{
|
||||
if (v1)
|
||||
{
|
||||
// hardlock, only force quit process
|
||||
// follows current design since Back button is disabled
|
||||
MessageBox.Show("Please, wait until process end", "Clean Flash Installer", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
e.Cancel = true;
|
||||
}
|
||||
else
|
||||
// soft alternative, expert mode, todo: better warning of consequences
|
||||
if (MessageBox.Show("Are you sure you want to interrupt the process ?", "Clean Flash Installer", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
|
||||
{
|
||||
e.Cancel = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// use cases ?
|
||||
// uninstall, currently not implemented
|
||||
}
|
||||
|
||||
//todo: same for uninstaller: share same F
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,252 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="checkboxImages.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<data name="checkboxImages.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACY
|
||||
CAAAAk1TRnQBSQFMAgEBAgEAAfABAQHwAQEBDwEAAQ8BAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
AwABPAMAAQ8DAAEBAQABCAUAAYQBAxgAAYACAAGAAwACgAEAAYADAAGAAQABgAEAAoACAAPAAQABwAHc
|
||||
AcABAAHwAcoBpgEAATMFAAEzAQABMwEAATMBAAIzAgADFgEAAxwBAAMiAQADKQEAA1UBAANNAQADQgEA
|
||||
AzkBAAGAAXwB/wEAAlAB/wEAAZMBAAHWAQAB/wHsAcwBAAHGAdYB7wEAAdYC5wEAAZABqQGtAgAB/wEz
|
||||
AwABZgMAAZkDAAHMAgABMwMAAjMCAAEzAWYCAAEzAZkCAAEzAcwCAAEzAf8CAAFmAwABZgEzAgACZgIA
|
||||
AWYBmQIAAWYBzAIAAWYB/wIAAZkDAAGZATMCAAGZAWYCAAKZAgABmQHMAgABmQH/AgABzAMAAcwBMwIA
|
||||
AcwBZgIAAcwBmQIAAswCAAHMAf8CAAH/AWYCAAH/AZkCAAH/AcwBAAEzAf8CAAH/AQABMwEAATMBAAFm
|
||||
AQABMwEAAZkBAAEzAQABzAEAATMBAAH/AQAB/wEzAgADMwEAAjMBZgEAAjMBmQEAAjMBzAEAAjMB/wEA
|
||||
ATMBZgIAATMBZgEzAQABMwJmAQABMwFmAZkBAAEzAWYBzAEAATMBZgH/AQABMwGZAgABMwGZATMBAAEz
|
||||
AZkBZgEAATMCmQEAATMBmQHMAQABMwGZAf8BAAEzAcwCAAEzAcwBMwEAATMBzAFmAQABMwHMAZkBAAEz
|
||||
AswBAAEzAcwB/wEAATMB/wEzAQABMwH/AWYBAAEzAf8BmQEAATMB/wHMAQABMwL/AQABZgMAAWYBAAEz
|
||||
AQABZgEAAWYBAAFmAQABmQEAAWYBAAHMAQABZgEAAf8BAAFmATMCAAFmAjMBAAFmATMBZgEAAWYBMwGZ
|
||||
AQABZgEzAcwBAAFmATMB/wEAAmYCAAJmATMBAANmAQACZgGZAQACZgHMAQABZgGZAgABZgGZATMBAAFm
|
||||
AZkBZgEAAWYCmQEAAWYBmQHMAQABZgGZAf8BAAFmAcwCAAFmAcwBMwEAAWYBzAGZAQABZgLMAQABZgHM
|
||||
Af8BAAFmAf8CAAFmAf8BMwEAAWYB/wGZAQABZgH/AcwBAAHMAQAB/wEAAf8BAAHMAQACmQIAAZkBMwGZ
|
||||
AQABmQEAAZkBAAGZAQABzAEAAZkDAAGZAjMBAAGZAQABZgEAAZkBMwHMAQABmQEAAf8BAAGZAWYCAAGZ
|
||||
AWYBMwEAAZkBMwFmAQABmQFmAZkBAAGZAWYBzAEAAZkBMwH/AQACmQEzAQACmQFmAQADmQEAApkBzAEA
|
||||
ApkB/wEAAZkBzAIAAZkBzAEzAQABZgHMAWYBAAGZAcwBmQEAAZkCzAEAAZkBzAH/AQABmQH/AgABmQH/
|
||||
ATMBAAGZAcwBZgEAAZkB/wGZAQABmQH/AcwBAAGZAv8BAAHMAwABmQEAATMBAAHMAQABZgEAAcwBAAGZ
|
||||
AQABzAEAAcwBAAGZATMCAAHMAjMBAAHMATMBZgEAAcwBMwGZAQABzAEzAcwBAAHMATMB/wEAAcwBZgIA
|
||||
AcwBZgEzAQABmQJmAQABzAFmAZkBAAHMAWYBzAEAAZkBZgH/AQABzAGZAgABzAGZATMBAAHMAZkBZgEA
|
||||
AcwCmQEAAcwBmQHMAQABzAGZAf8BAALMAgACzAEzAQACzAFmAQACzAGZAQADzAEAAswB/wEAAcwB/wIA
|
||||
AcwB/wEzAQABmQH/AWYBAAHMAf8BmQEAAcwB/wHMAQABzAL/AQABzAEAATMBAAH/AQABZgEAAf8BAAGZ
|
||||
AQABzAEzAgAB/wIzAQAB/wEzAWYBAAH/ATMBmQEAAf8BMwHMAQAB/wEzAf8BAAH/AWYCAAH/AWYBMwEA
|
||||
AcwCZgEAAf8BZgGZAQAB/wFmAcwBAAHMAWYB/wEAAf8BmQIAAf8BmQEzAQAB/wGZAWYBAAH/ApkBAAH/
|
||||
AZkBzAEAAf8BmQH/AQAB/wHMAgAB/wHMATMBAAH/AcwBZgEAAf8BzAGZAQAB/wLMAQAB/wHMAf8BAAL/
|
||||
ATMBAAHMAf8BZgEAAv8BmQEAAv8BzAEAAmYB/wEAAWYB/wFmAQABZgL/AQAB/wJmAQAB/wFmAf8BAAL/
|
||||
AWYBAAEhAQABpQEAA18BAAN3AQADhgEAA5YBAAPLAQADsgEAA9cBAAPdAQAD4wEAA+oBAAPxAQAD+AEA
|
||||
AfAB+wH/AQABpAKgAQADgAMAAf8CAAH/AwAC/wEAAf8DAAH/AQAB/wEAAv8CAAP/AQAOEwHqDhMB6h4A
|
||||
AUMBDwsQAQ8BEwFDAQ8LEAEPARMeAAFDAQ8BFAkTARQBEAETAUMBDwsSARABEx4AAUMBEAISBxMCEgEQ
|
||||
ARMBQwEQC+oBEAETHgABQwEQCxIBEAETAUMBEAJtA+oBEgETARIB6gFtAeoBEAETHgABQwEQAuoHEgHq
|
||||
ARIBEAETAUMBEANtAeoCEgFtAuoCbQEQARMeAAFDARAL6gEQARMBQwEQA20BEgHqAewB7wHsAeoCbQEQ
|
||||
ARMeAAFDARABbQjqAm0BEAETAUMBEAJtARIB6gHtAQcB8AEHAewCbQEQARMeAAFDARACbQfqAm0BEAET
|
||||
AUMBEAHrAm0B7QEHArwB8AHvAesB6gEQARMeAAFDARALbQEQARMBQwEQAuwB7QIHAvcCvAH3AeoBEAET
|
||||
HgABQwEQC20BEAETAUMBEAfsAe8CvAHsAREBEx4AAUMBEAttARABEwFDARAH7AHtAe8B8AEHAW0BEx4A
|
||||
AUMBEAttARABEwFDARAI7AHtAQcB8AEHAW0eAAFDAQ8LEAEPARMBQwEPCRABEwHvAfABBx4ADkMBEw5D
|
||||
ARMeAAFCAU0BPgcAAT4DAAEoAwABPAMAAQ8DAAEBAQABAQUAAXgXAAP/eQAL
|
||||
</value>
|
||||
</data>
|
||||
<data name="beforeInstallLabel.Text" xml:space="preserve">
|
||||
<value>You are about to uninstall Clean Flash Player.
|
||||
Please close all browsers, including Google Chrome, Mozilla Firefox and Internet Explorer.
|
||||
|
||||
The installer will completely remove all versions of Flash Player from this computer,
|
||||
including Clean Flash Player and older versions of Adobe Flash Player.
|
||||
</value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAUy/wQFMv8EBTP/BAUz/wQF
|
||||
M/8EBDP/BAQz/wQEM/8EBDP/BAQz/wQFM/8EBTP/BAUz/wQFMv8EBTL/BAUy/wQFMf8EBTH/BAQx/wQF
|
||||
MP8EBTD/BAQw/wQFL/8EBS//BAQu/wQFLv8EBC7/BAQt/wAAAAAAAAAAAAAAAAAAAAAEBDP/BAQz/wQF
|
||||
M/8EBTT/BAU0/wQFNP8EBTT/BAU0/wQFNP8EBTT/BAU0/wQFNP8EBTP/BAUz/wQEM/8EBTP/BAQy/wQE
|
||||
Mv8EBTH/BAUx/wQFMf8EBTD/BAQw/wQEL/8EBC//BAQu/wQFLv8EBC7/AAAAAAAAAAAAAAAABAQ0DwQF
|
||||
NP8EBTT/BAU1/wQFNf8EBTX/BAU1/wQFNf8EBTX/BAU1/wQFNf8EBTX/BAU1/wQFNP8EBDT/BAU0/wQF
|
||||
M/8EBDP/BAUz/wQEMv8EBTL/BAUx/wQEMf8EBTD/BAUw/wQFL/8EBC//BAQu/wQFLv8EBC4PAAAAAAAA
|
||||
AAAEBTU/BAU1/wQFNf8EBTX/BAU2/wQFNv8EBTb/BAU2/wQFNv8EBTb/BAU2/wQFNv8EBTb/BAU1/wQF
|
||||
Nf8EBTX/BAU0/wQFNP8EBTP/BAQz/wQFM/8EBDL/BAUx/wQEMf8EBTD/BAUw/wQFL/8EBC//BAQu/wQE
|
||||
Lj8AAAAAAAAAAAQFNT8EBTb/BAU2/wQFNv8EBTf/BAU3/wQFN/8EBTf/BAU3/wQFN/8EBTf/BAU3/wQE
|
||||
N/8EBDb/BAU2/wQFNv8EBTX/BAU1/wQFNP8EBTT/BAUz/wQFM/8EBTL/BAUx/wQEMf8EBTD/BAUw/wQE
|
||||
L/8EBS//BAQuPwAAAAAAAAAABAQ2PwQFN/8EBTf/AwU3/7OzwP94eZL/ExND/wQFOP8EBTj/BAU4/wQE
|
||||
OP8EBDj/BAU4/wQFN/8EBTf/BAU2/wQFNv8EBTX/BAU1/wQFNP8EBTT/BAUz/wQFM/8EBTL/BAUx/wQE
|
||||
Mf8EBDD/BAUw/wQEL/8EBC8/AAAAAAAAAAAEBTc/BAU4/wQEOP8DBTj/7+/v/+/v7//Dw83/EhRE/wMF
|
||||
Of8DBTn/AwU5/wMFOf8DBTj/BAU4/wQFOP8EBTf/BAU3/wQFNv8EBTb/BAU1/wQFNP8EBTT/BAUz/wQF
|
||||
M/8EBDL/BAUx/wQFMf8EBTD/BAQw/wQELz8AAAAAAAAAAAQFOE8DBTj/AwU5/wMFOf+3t8X/5OTn//Ly
|
||||
8v+nqLj/AwU6/wMFOv8DBDr/AwQ6/wMFOf8DBTn/AwU4/wQEOP8EBDj/BAU3/wQENv8EBTb/BAU1/wQF
|
||||
NP8EBTT/BAQz/wQFMv8EBTL/BAUx/wQFMP8EBDD/BAUvTwAAAAAAAAAAAwU5fwMFOf8DBDr/AwU6/wMF
|
||||
Ov8wMl7/5+fq//X19f9eX4H/AwQ7/wMFO/8DBTr/AwU6/wMFOv8DBTn/AwU5/wQFOP8EBDj/BAU3/wQF
|
||||
Nv8EBTX/BAU1/wQENP8EBTP/BAUz/wQFMv8EBTH/BAQx/wQFMP8EBDB/AAAAAAAAAAADBTl/AwQ6/wMF
|
||||
Ov8DBDv/AwU7/wMEPP99fpr/9/f3//f39//39/f/9/f3/wMFO/8DBDv/AwU6/wMEOv8DBTn/AwU5/wQE
|
||||
OP8DBTf/BAQ3/wQFNv8EBTX/BAU1/wQFNP8EBDP/BAUy/wQFMv8EBDH/BAQw/wQFMH8AAAAAAAAAAAME
|
||||
On8DBTr/AwU7/wMEPP8DBTz/AwU8/xITSf/r7O//+vr6//r6+v/6+vr/AwU8/wMEPP8DBTv/AwU6/wME
|
||||
Ov8DBTn/AwU4/wQEOP8EBTf/BAQ2/wQFNf8EBTX/BAU0/wQEM/8EBTP/BAQy/wQFMf8EBDH/BAQwfwAA
|
||||
AAAAAAAAAwU6fwMFO/8DBDz/AwU8/wMEPf8DBT3/AgQ+/5+gtf/8/Pz/vb7M/wMEPf8DBD3/AwU8/wMF
|
||||
O/8DBDv/AwU6/wMEOv8DBTn/BAU4/wMFN/8EBDf/BAU2/wQFNf8EBTT/BAUz/wQFM/8EBDL/BAUx/wQF
|
||||
Mf8EBTB/AAAAAAAAAAADBTuPAwQ7/wMFPP8DBD3/AwQ+/wIFPv8CBD//IiNX////////////gIKe/wME
|
||||
Pf8DBTz/AwU8/wMEO/8DBTr/AwQ6/wMFOf8EBTj/BAU4/wQFN/8EBTb/BAU1/wQFNP8EBDT/BAUz/wQF
|
||||
Mv8EBTH/BAUx/wQEMI8AAAAAAAAAAAMEO78DBDz/AwU8/wMEPf8CBT7/AgQ//wIEQP8CBEH/YWKI////
|
||||
////////7+/z/wMEPf8DBTz/AwU7/wMEO/8DBDr/AwU5/wMFOP8EBTj/BAU3/wQFNv8EBTX/BAU0/wQF
|
||||
NP8EBTP/BAQy/wQFMf8EBDH/BAQwvwAAAAAAAAAAAwU7vwMEPP8DBTz/AwQ9/wIFPv8CBT//AgRA/wIE
|
||||
Qf8CBED/QUNv/8DB0P//////AwQ9/wMFPP8DBTv/AwQ7/wMEOv8DBTn/BAU4/wQFOP8EBTf/BAU2/wQF
|
||||
Nf8EBTT/BAQ0/wQFM/8EBTL/BAUx/wQFMf8EBDC/AAAAAAAAAAADBTu/AwU7/wMFPP8DBD3/AwU+/wIE
|
||||
P/8CBT//AgQ//wIEP/8CBT//AgQ+/wMEPf8DBTz/AwU8/wMFO/8DBTr/AwQ6/wMFOf8EBTj/AwU3/wQE
|
||||
N/8EBTb/BAU1/wQFNP8EBTP/BAUz/wQEMv8EBTH/BAUx/wQFML8AAAAAAAAAAAMEO78DBDv/AwU8/wMF
|
||||
PP8DBD3/AwQ+/wIEPv8CBD7/AgU+/wMFPv8DBD3/AwU8/wMFPP8DBTv/AwU7/wMFOv8DBTn/AwU5/wQF
|
||||
OP8EBTf/BAQ2/wQFNv8EBTX/BAU0/wQEM/8EBTP/BAQy/wQFMf8EBTD/BAQwvwAAAAAAAAAAAwU63wMF
|
||||
O/8DBTv/AwU8/wMFPP8DBD3/AwQ9/wMEPf8DBD3/AwQ9/wMFPP8DBTz/AwU7/wMFO/8DBTr/AwQ6/wMF
|
||||
Of8EBTj/BAU4/wQFN/8EBTb/BAU1/wQFNf8EBTT/BAQz/wQFMv8EBTL/BAQx/wQEMP8EBDDfAAAAAAAA
|
||||
AAADBDr/AwU6/wMEO/8DBTv/AwU7/wMFPP8DBDz/AwU8/wMEPP8DBTz/AwU7/wMFO/8DBDv/AwU6/wME
|
||||
Ov8DBTn/AwU4/wQEOP8EBTf/BAQ2/wQFNv8EBTX/BAQ0/wQFM/8EBTP/BAQy/wQFMf8EBTH/BAQw/wQE
|
||||
L/8AAAAAAAAAAAMFOf8DBTn/AwQ6/wMFOv8DBDv/AwU7/wMFO/8DBTv/AwU7/wMFO/8DBDv/AwU6/wME
|
||||
Ov8DBTn/AwU5/wMFOP8EBDj/BAU3/wQFNv8EBTb/BAU1/wQFNP8EBTT/BAQz/wQFMv8EBTL/BAQx/wQF
|
||||
MP8EBTD/BAQv/wAAAAAAAAAABAQu/wQELv8EBC7/BAQv/wQEL/8EBC//BAQv/wQEL/8EBDD/BAQw/wQE
|
||||
MP8EBDD/BAQw/wQEMP8EBDD/BAQw/wQEMP8EBDD/BAQw/wQEMP8EBDD/BAQw/wQEL/8EBC//BAQv/wQE
|
||||
L/8EBC//BAQu/wQELv8EBC7/AAAAAAAAAAAEBDBgBAQw/wQEMf8EBDH/BAQx/wQEMv8EBDL/BAQy/wQE
|
||||
Mv8EBDP/BAQz/wQEM/8EBDP/BAQz/wQEM/8EBDP/BAQz/wQEM/8EBDP/BAQz/wQEM/8EBDL/BAQy/wQE
|
||||
Mv8EBDL/BAQx/wQEMf8EBDH/BAQw/wQEMGAAAAAAAAAAAAAAAAAEBDNgBAQz/wQEM/8EBDT/BAQ0/wQE
|
||||
Nf8EBDX/BAQ1/wQENv8EBDb/BAQ2/wQENv8EBDb/BAQ2/wQENv8EBDb/BAQ2/wQENv8EBDb/BAQ1/wQE
|
||||
Nf8EBDX/BAQ1/wQENP8EBDT/BAQz/wQEM/8EBDNgAAAAAAAAAAAAAAAAAAAAAAAAAAAEBDVgBAQ2/wQE
|
||||
Nv8EAzf/BAM3/wQEOP8EAzj/BAM4/wQDOf8DAzn/BAM5/wMDOf8EAzn/BAM5/wMDOf8EAzn/AwM5/wQD
|
||||
Of8EAzj/BAM4/wQEOP8EAzf/BAM3/wQENv8EBDb/BAQ1YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAEAzdgBAM4/wQDOP8EAzn/BAM6/wQDOv8DAzv/AwM8/wMDPP8DAzz/AwM9/wMDPf8DAz3/AwM9/wMD
|
||||
Pf8DAzz/AwM8/wMDO/8EAzr/AwM6/wMDOf8EAzj/BAM4/wQDN2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAEAzlgBAM5/wQDOv8DAzv/AwM8/wMDPf8DAz3/AwI+/wICP/8DAj//AwJA/wMC
|
||||
QP8CAkD/AwI//wMCPv8DAj7/AwM9/wMDPP8DAzv/BAM6/wMDOv8EAzlgAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
||||
AAAAAAAAAAAAAAAAAAAAAAAA/////////////////////8AAAAPAAAADgAAAAYAAAAGAAAABgAAAAYAA
|
||||
AAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAA
|
||||
AAHAAAAD4AAAB/AAAA/4AAAf//////////8=
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -1,25 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<assemblyIdentity version="1.0.0.0" name="CleanFlashUninstaller.app"/>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
<asmv3:application>
|
||||
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
|
||||
<dpiAware>true</dpiAware>
|
||||
</asmv3:windowsSettings>
|
||||
</asmv3:application>
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
|
||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
|
||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
|
||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
|
||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
|
||||
</application>
|
||||
</compatibility>
|
||||
</assembly>
|
||||
|
Before Width: | Height: | Size: 115 KiB |
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 darktohka
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -1,56 +1,7 @@
|
||||
# Clean Flash Player
|
||||
|
||||
[](https://ko-fi.com/disyer) [](https://gitlab.com/cleanflash/installer/-/blob/master/LICENSE)
|
||||
As you may all know, Clean Flash received a DMCA from Adobe.
|
||||
|
||||

|
||||
We'll be reworking the software so that it doesn't redistribute any binary packages. Until then, the source code will be unavailable for the project.
|
||||
|
||||
[Download latest version](https://gitlab.com/cleanflash/installer/-/releases)
|
||||
|
||||
## What's this?
|
||||
|
||||
Clean Flash Player is a distribution of Adobe Flash Player, with the mission of keeping the original Flash Player alive for compatibility and ease of use.
|
||||
|
||||
The original Flash Player was discontinued on January 12th, 2021. Adobe is committed to keeping Flash Player alive in the Chinese region, however, by providing official monthly updates to Flash Player in China.
|
||||
|
||||
Clean Flash Player uses a modified version of this updated Flash Player version, keeping Flash Player clean from adware.
|
||||
|
||||
Google Chrome, Mozilla Firefox and Internet Explorer browser plugins are supported. Clean Flash Player ships with a standalone Flash Projector as well.
|
||||
|
||||
**Clean Flash is compatible and tested with Windows XP, Windows Vista, Windows 7, Windows 8.1, Windows 10 and Windows 11**. If attempting to run on Windows XP, download [.NET Framework 4.0](https://dotnet.microsoft.com/download/dotnet-framework/net40) first and optionally update to [.NET Framework 4.0.3](https://www.microsoft.com/en-us/download/details.aspx?id=29053).
|
||||
|
||||
## Browser compatibility
|
||||
|
||||
Newer versions of Google Chrome and Mozilla Firefox do not support Flash Player anymore.
|
||||
|
||||
To keep using Flash Player on **Google Chrome**, install an older version of Chrome. The last supported version is Chrome 87.0.4280.168.
|
||||
|
||||
To keep using Flash Player on **Mozilla Firefox**, install [**Waterfox Classic**](https://classic.waterfox.net), [**Pale Moon**](https://palemoon.org) or [**K-Meleon**](http://kmeleonbrowser.org/forum/read.php?19,154431). They are forks of Mozilla Firefox with built-in Flash Player support.
|
||||
|
||||
**Internet Explorer** still supports Flash Player on Windows 10.
|
||||
|
||||
<details><summary>Alternatives</summary>
|
||||
|
||||
- [Cent Browser 4.3.9.248](https://static.centbrowser.com/win_stable/4.3.9.248)
|
||||
- [Chromium 88.0.4285.0](https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html): specify your platform and select/enter 814251
|
||||
- [Basilisk](https://www.basilisk-browser.org)
|
||||
- [Otter Browser](https://otter-browser.org)
|
||||
- [roytam's XP-compatible browser builds](http://rtfreesoft.blogspot.com)
|
||||
- [Portable old browser versions (guide)](https://www.raymond.cc/blog/how-to-enable-flash-support-in-firefox-portable)
|
||||
- [Mypal 29.3.0](https://www.mypal-browser.org/download.html)
|
||||
|
||||
</details>
|
||||
|
||||
## Usage
|
||||
|
||||
- Make sure you have a compatible browser to use Flash Player with
|
||||
- Download the latest version from [GitLab](https://gitlab.com/cleanflash/installer/-/releases)
|
||||
- Launch installer
|
||||
- Accept the disclaimer
|
||||
- Choose which browser plugins to install
|
||||
- Choose to install the standalone projector or not
|
||||
- Choose to install the debug build or not
|
||||
- Close all browser windows, or let the installer close them for you
|
||||
- Press the "Install" button and wait for Flash Player to install
|
||||
- Enjoy using Flash Player!
|
||||
|
||||
**P.S.** The Clean Flash Player installer will automatically close all browser windows when updating Flash Player. It will also uninstall all previous versions of Flash Player, as well as the adware Flash Center application. The installer will also create an uninstaller that you can use to uninstall Clean Flash at any time.
|
||||
We'll be back soon!
|
||||
@@ -1,35 +0,0 @@
|
||||
[workspace]
|
||||
resolver = "2"
|
||||
members = [
|
||||
"crates/clean_flash_common",
|
||||
"crates/clean_flash_ui",
|
||||
"crates/clean_flash_installer",
|
||||
"crates/clean_flash_uninstaller",
|
||||
]
|
||||
|
||||
[workspace.dependencies]
|
||||
ab_glyph = "0.2"
|
||||
sevenz-rust2 = { version = "0.20", default-features = false, features = ["compress", "util"] }
|
||||
minifb = "0.28"
|
||||
windows-sys = { version = "0.61", features = [
|
||||
"Win32_Foundation",
|
||||
"Win32_Networking_WinHttp",
|
||||
"Win32_Security",
|
||||
"Win32_Security_Authorization",
|
||||
"Win32_System_LibraryLoader",
|
||||
"Win32_System_RestartManager",
|
||||
"Win32_System_Threading",
|
||||
"Win32_System_ProcessStatus",
|
||||
"Win32_Storage_FileSystem",
|
||||
"Win32_System_Registry",
|
||||
"Win32_System_SystemInformation",
|
||||
"Win32_UI_HiDpi",
|
||||
"Win32_UI_Shell",
|
||||
"Win32_UI_WindowsAndMessaging",
|
||||
] }
|
||||
|
||||
[profile."release-lto"]
|
||||
inherits = "release"
|
||||
codegen-units = 1
|
||||
lto = "fat"
|
||||
strip = true
|
||||
@@ -1,7 +0,0 @@
|
||||
[package]
|
||||
name = "clean_flash_common"
|
||||
version = "34.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
windows-sys = { workspace = true }
|
||||
@@ -1,271 +0,0 @@
|
||||
#[cfg(windows)]
|
||||
use crate::uninstaller;
|
||||
use std::fs;
|
||||
use std::path::Path;
|
||||
#[cfg(windows)]
|
||||
use std::thread;
|
||||
#[cfg(windows)]
|
||||
use std::time::Duration;
|
||||
|
||||
/// Attempt to delete a single file, retrying with escalating measures if needed.
|
||||
pub fn delete_file(path: &Path) {
|
||||
if !path.exists() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Unregister ActiveX .ocx files before deletion (Windows only).
|
||||
#[cfg(windows)]
|
||||
if let Some(ext) = path.extension() {
|
||||
if ext.eq_ignore_ascii_case("ocx") {
|
||||
let _ = uninstaller::unregister_activex(&path.to_string_lossy());
|
||||
}
|
||||
}
|
||||
|
||||
// First attempt: clear read-only and delete.
|
||||
if try_clear_readonly_and_delete(path) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Retry loop with ownership acquisition.
|
||||
#[cfg(windows)]
|
||||
{
|
||||
for _ in 0..10 {
|
||||
if try_take_ownership_and_delete(path) {
|
||||
return;
|
||||
}
|
||||
thread::sleep(Duration::from_millis(500));
|
||||
}
|
||||
|
||||
// Last resort: kill any processes using the file, then delete.
|
||||
kill_locking_processes(path);
|
||||
thread::sleep(Duration::from_millis(500));
|
||||
let _ = fs::remove_file(path);
|
||||
}
|
||||
}
|
||||
|
||||
/// Recursively delete all files (optionally matching `filename`) under `base_dir`.
|
||||
pub fn recursive_delete(base_dir: &Path, filename: Option<&str>) {
|
||||
if !base_dir.exists() {
|
||||
return;
|
||||
}
|
||||
|
||||
let entries: Vec<_> = match fs::read_dir(base_dir) {
|
||||
Ok(rd) => rd.filter_map(|e| e.ok()).collect(),
|
||||
Err(_) => return,
|
||||
};
|
||||
|
||||
for entry in entries {
|
||||
let path = entry.path();
|
||||
|
||||
if path.is_dir() {
|
||||
recursive_delete(&path, filename);
|
||||
} else if path.is_file() {
|
||||
// Sanity check: path must start with the original base_dir.
|
||||
if !path.starts_with(base_dir) {
|
||||
continue;
|
||||
}
|
||||
|
||||
let should_delete = match filename {
|
||||
Some(name) => path
|
||||
.file_name()
|
||||
.map(|f| f == name)
|
||||
.unwrap_or(false),
|
||||
None => true,
|
||||
};
|
||||
|
||||
if should_delete {
|
||||
delete_file(&path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Delete all files in a folder, then try to remove the folder itself.
|
||||
pub fn wipe_folder(path: &Path) {
|
||||
if !path.exists() {
|
||||
return;
|
||||
}
|
||||
|
||||
recursive_delete(path, None);
|
||||
|
||||
// If folder is now empty, remove it.
|
||||
if is_dir_empty(path) {
|
||||
if fs::remove_dir(path).is_err() {
|
||||
#[cfg(windows)]
|
||||
{
|
||||
kill_locking_processes(path);
|
||||
thread::sleep(Duration::from_millis(500));
|
||||
let _ = fs::remove_dir(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn try_clear_readonly_and_delete(path: &Path) -> bool {
|
||||
if let Ok(meta) = fs::metadata(path) {
|
||||
let mut perms = meta.permissions();
|
||||
#[allow(clippy::permissions_set_readonly_false)]
|
||||
perms.set_readonly(false);
|
||||
let _ = fs::set_permissions(path, perms);
|
||||
}
|
||||
fs::remove_file(path).is_ok()
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
fn try_take_ownership_and_delete(path: &Path) -> bool {
|
||||
use windows_sys::Win32::Foundation::{CloseHandle, LocalFree};
|
||||
use windows_sys::Win32::Security::{
|
||||
GetTokenInformation, TokenUser, DACL_SECURITY_INFORMATION,
|
||||
OWNER_SECURITY_INFORMATION, TOKEN_QUERY, TOKEN_USER,
|
||||
};
|
||||
use windows_sys::Win32::Security::Authorization::{
|
||||
SetEntriesInAclW, SetNamedSecurityInfoW, EXPLICIT_ACCESS_W,
|
||||
SE_FILE_OBJECT, SET_ACCESS, TRUSTEE_IS_SID, TRUSTEE_IS_USER, TRUSTEE_W,
|
||||
};
|
||||
use windows_sys::Win32::System::Threading::{GetCurrentProcess, OpenProcessToken};
|
||||
|
||||
// Ensure SeTakeOwnershipPrivilege is enabled (idempotent).
|
||||
crate::winapi_helpers::allow_modifications();
|
||||
|
||||
let path_wide: Vec<u16> = path
|
||||
.to_string_lossy()
|
||||
.encode_utf16()
|
||||
.chain(std::iter::once(0))
|
||||
.collect();
|
||||
|
||||
unsafe {
|
||||
let mut token = std::ptr::null_mut();
|
||||
if OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &mut token) == 0 {
|
||||
return try_clear_readonly_and_delete(path);
|
||||
}
|
||||
|
||||
// Retrieve the current user's SID from the process token.
|
||||
let mut buf = vec![0u8; 512];
|
||||
let mut returned = 0u32;
|
||||
let ok = GetTokenInformation(
|
||||
token,
|
||||
TokenUser,
|
||||
buf.as_mut_ptr() as *mut _,
|
||||
buf.len() as u32,
|
||||
&mut returned,
|
||||
);
|
||||
CloseHandle(token);
|
||||
|
||||
if ok == 0 {
|
||||
return try_clear_readonly_and_delete(path);
|
||||
}
|
||||
|
||||
let token_user = &*(buf.as_ptr() as *const TOKEN_USER);
|
||||
let sid = token_user.User.Sid;
|
||||
|
||||
// Transfer ownership of the file to the current user.
|
||||
SetNamedSecurityInfoW(
|
||||
path_wide.as_ptr() as *mut _,
|
||||
SE_FILE_OBJECT,
|
||||
OWNER_SECURITY_INFORMATION,
|
||||
sid,
|
||||
std::ptr::null_mut(),
|
||||
std::ptr::null_mut(),
|
||||
std::ptr::null_mut(),
|
||||
);
|
||||
|
||||
// Build a new DACL that grants FullControl to the current user.
|
||||
let mut ea = EXPLICIT_ACCESS_W {
|
||||
grfAccessPermissions: 0x001F_01FF, // FILE_ALL_ACCESS
|
||||
grfAccessMode: SET_ACCESS,
|
||||
grfInheritance: 0, // NO_INHERITANCE
|
||||
Trustee: TRUSTEE_W {
|
||||
pMultipleTrustee: std::ptr::null_mut(),
|
||||
MultipleTrusteeOperation: 0, // NO_MULTIPLE_TRUSTEE
|
||||
TrusteeForm: TRUSTEE_IS_SID,
|
||||
TrusteeType: TRUSTEE_IS_USER,
|
||||
ptstrName: sid as *mut u16,
|
||||
},
|
||||
};
|
||||
let mut new_dacl: *mut windows_sys::Win32::Security::ACL = std::ptr::null_mut();
|
||||
SetEntriesInAclW(1, &mut ea, std::ptr::null_mut(), &mut new_dacl);
|
||||
|
||||
if !new_dacl.is_null() {
|
||||
SetNamedSecurityInfoW(
|
||||
path_wide.as_ptr() as *mut _,
|
||||
SE_FILE_OBJECT,
|
||||
DACL_SECURITY_INFORMATION,
|
||||
std::ptr::null_mut(),
|
||||
std::ptr::null_mut(),
|
||||
new_dacl,
|
||||
std::ptr::null_mut(),
|
||||
);
|
||||
LocalFree(new_dacl as *mut _);
|
||||
}
|
||||
}
|
||||
|
||||
try_clear_readonly_and_delete(path)
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
fn kill_locking_processes(path: &Path) {
|
||||
use windows_sys::Win32::Foundation::CloseHandle;
|
||||
use windows_sys::Win32::System::RestartManager::{
|
||||
RmEndSession, RmGetList, RmRegisterResources, RmStartSession, RM_PROCESS_INFO,
|
||||
};
|
||||
use windows_sys::Win32::System::Threading::{
|
||||
OpenProcess, TerminateProcess, WaitForSingleObject, PROCESS_TERMINATE,
|
||||
};
|
||||
|
||||
let path_wide: Vec<u16> = path
|
||||
.to_string_lossy()
|
||||
.encode_utf16()
|
||||
.chain(std::iter::once(0))
|
||||
.collect();
|
||||
|
||||
unsafe {
|
||||
let mut session: u32 = 0;
|
||||
// CCH_RM_SESSION_KEY = 32 chars; +1 for null terminator.
|
||||
let mut session_key = [0u16; 33];
|
||||
if RmStartSession(&mut session, 0, session_key.as_mut_ptr()) != 0 {
|
||||
return;
|
||||
}
|
||||
|
||||
let file_ptr = path_wide.as_ptr();
|
||||
let files = [file_ptr];
|
||||
RmRegisterResources(
|
||||
session,
|
||||
1,
|
||||
files.as_ptr(),
|
||||
0,
|
||||
std::ptr::null_mut(),
|
||||
0,
|
||||
std::ptr::null_mut(),
|
||||
);
|
||||
|
||||
let mut n_needed: u32 = 0;
|
||||
let mut n_info: u32 = 10;
|
||||
let mut procs: [RM_PROCESS_INFO; 10] = std::mem::zeroed();
|
||||
let mut reboot_reasons: u32 = 0;
|
||||
RmGetList(
|
||||
session,
|
||||
&mut n_needed,
|
||||
&mut n_info,
|
||||
procs.as_mut_ptr(),
|
||||
&mut reboot_reasons,
|
||||
);
|
||||
|
||||
for proc_info in procs.iter().take(n_info as usize) {
|
||||
let pid = proc_info.Process.dwProcessId;
|
||||
let handle = OpenProcess(PROCESS_TERMINATE, 0, pid);
|
||||
if !handle.is_null() {
|
||||
TerminateProcess(handle, 1);
|
||||
WaitForSingleObject(handle, 5000);
|
||||
CloseHandle(handle);
|
||||
}
|
||||
}
|
||||
|
||||
RmEndSession(session);
|
||||
}
|
||||
}
|
||||
|
||||
fn is_dir_empty(path: &Path) -> bool {
|
||||
fs::read_dir(path)
|
||||
.map(|mut rd| rd.next().is_none())
|
||||
.unwrap_or(true)
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
pub mod file_util;
|
||||
pub mod native_host;
|
||||
pub mod process_utils;
|
||||
pub mod redirection;
|
||||
pub mod registry;
|
||||
pub mod resources;
|
||||
pub mod system_info;
|
||||
|
||||
#[cfg(windows)]
|
||||
#[path = "uninstaller_windows.rs"]
|
||||
pub mod uninstaller;
|
||||
|
||||
#[cfg(not(windows))]
|
||||
#[path = "uninstaller_linux.rs"]
|
||||
pub mod uninstaller;
|
||||
|
||||
pub mod update_checker;
|
||||
pub mod winapi_helpers;
|
||||
|
||||
use std::fmt;
|
||||
|
||||
/// Progress callback trait, analogous to C# IProgressForm.
|
||||
pub trait ProgressCallback: Send {
|
||||
fn update_progress_label(&self, text: &str, tick: bool);
|
||||
fn tick_progress(&self);
|
||||
}
|
||||
|
||||
/// Install/uninstall error type.
|
||||
#[derive(Debug)]
|
||||
pub struct InstallError {
|
||||
pub message: String,
|
||||
}
|
||||
|
||||
impl InstallError {
|
||||
pub fn new(message: impl Into<String>) -> Self {
|
||||
Self {
|
||||
message: message.into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for InstallError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "{}", self.message)
|
||||
}
|
||||
}
|
||||
|
||||
impl std::error::Error for InstallError {}
|
||||
|
||||
/// Result of running an external process.
|
||||
pub struct ExitedProcess {
|
||||
pub exit_code: i32,
|
||||
pub output: String,
|
||||
}
|
||||
|
||||
impl ExitedProcess {
|
||||
pub fn is_successful(&self) -> bool {
|
||||
self.exit_code == 0
|
||||
}
|
||||
}
|
||||
@@ -1,512 +0,0 @@
|
||||
//! Install and uninstall the native messaging host for modern browsers.
|
||||
//!
|
||||
//! The native messaging host allows the Clean Flash Player browser extension
|
||||
//! to communicate with the local flash-player-host binary via stdio.
|
||||
|
||||
use crate::{InstallError, ProgressCallback};
|
||||
use std::fs;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
const MANIFEST_NAME: &str = "org.cleanflash.flash_player";
|
||||
const FIREFOX_MANIFEST_FILENAME: &str = "clean_flash_firefox.json";
|
||||
const CHROME_MANIFEST_FILENAME: &str = "clean_flash_chrome.json";
|
||||
const FIREFOX_ALLOWED_EXTENSION: &str = "flash-player@cleanflash.org";
|
||||
const ALLOWED_ORIGIN: &str = "chrome-extension://dcikaadaeajidejkoekdflmfdgeoldcb/";
|
||||
|
||||
#[cfg(windows)]
|
||||
const HOST_BINARY_NAME: &str = "flash-player-host.exe";
|
||||
|
||||
#[cfg(not(windows))]
|
||||
const HOST_BINARY_NAME: &str = "flash-player-host";
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
enum BrowserKind {
|
||||
Firefox,
|
||||
ChromeLike,
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
struct WindowsBrowser {
|
||||
detect_keys: &'static [&'static str],
|
||||
native_messaging_reg_path: &'static str,
|
||||
kind: BrowserKind,
|
||||
}
|
||||
|
||||
/// Browser registry key paths on Windows (HKCU/HKLM) for native messaging hosts.
|
||||
#[cfg(windows)]
|
||||
const WINDOWS_BROWSERS: &[WindowsBrowser] = &[
|
||||
WindowsBrowser {
|
||||
detect_keys: &[r"SOFTWARE\Google\Chrome"],
|
||||
native_messaging_reg_path: r"SOFTWARE\Google\Chrome\NativeMessagingHosts",
|
||||
kind: BrowserKind::ChromeLike,
|
||||
},
|
||||
WindowsBrowser {
|
||||
detect_keys: &[r"SOFTWARE\Microsoft\Edge"],
|
||||
native_messaging_reg_path: r"SOFTWARE\Microsoft\Edge\NativeMessagingHosts",
|
||||
kind: BrowserKind::ChromeLike,
|
||||
},
|
||||
WindowsBrowser {
|
||||
detect_keys: &[r"SOFTWARE\BraveSoftware\Brave-Browser"],
|
||||
native_messaging_reg_path: r"SOFTWARE\BraveSoftware\Brave-Browser\NativeMessagingHosts",
|
||||
kind: BrowserKind::ChromeLike,
|
||||
},
|
||||
WindowsBrowser {
|
||||
detect_keys: &[r"SOFTWARE\Vivaldi"],
|
||||
native_messaging_reg_path: r"SOFTWARE\Vivaldi\NativeMessagingHosts",
|
||||
kind: BrowserKind::ChromeLike,
|
||||
},
|
||||
WindowsBrowser {
|
||||
detect_keys: &[r"SOFTWARE\Opera Software"],
|
||||
native_messaging_reg_path: r"SOFTWARE\Opera Software\NativeMessagingHosts",
|
||||
kind: BrowserKind::ChromeLike,
|
||||
},
|
||||
WindowsBrowser {
|
||||
detect_keys: &[r"SOFTWARE\Chromium"],
|
||||
native_messaging_reg_path: r"SOFTWARE\Chromium\NativeMessagingHosts",
|
||||
kind: BrowserKind::ChromeLike,
|
||||
},
|
||||
WindowsBrowser {
|
||||
detect_keys: &[r"SOFTWARE\The Browser Company\Arc"],
|
||||
native_messaging_reg_path: r"SOFTWARE\The Browser Company\Arc\NativeMessagingHosts",
|
||||
kind: BrowserKind::ChromeLike,
|
||||
},
|
||||
WindowsBrowser {
|
||||
detect_keys: &[r"SOFTWARE\Mozilla\Mozilla Firefox", r"SOFTWARE\Mozilla"],
|
||||
native_messaging_reg_path: r"SOFTWARE\Mozilla\NativeMessagingHosts",
|
||||
kind: BrowserKind::Firefox,
|
||||
},
|
||||
WindowsBrowser {
|
||||
detect_keys: &[r"SOFTWARE\Mozilla\Mozilla Firefox Beta"],
|
||||
native_messaging_reg_path: r"SOFTWARE\Mozilla\NativeMessagingHosts",
|
||||
kind: BrowserKind::Firefox,
|
||||
},
|
||||
WindowsBrowser {
|
||||
detect_keys: &[r"SOFTWARE\Mozilla\Firefox Developer Edition"],
|
||||
native_messaging_reg_path: r"SOFTWARE\Mozilla\NativeMessagingHosts",
|
||||
kind: BrowserKind::Firefox,
|
||||
},
|
||||
WindowsBrowser {
|
||||
detect_keys: &[r"SOFTWARE\Mozilla\Mozilla Firefox ESR"],
|
||||
native_messaging_reg_path: r"SOFTWARE\Mozilla\NativeMessagingHosts",
|
||||
kind: BrowserKind::Firefox,
|
||||
},
|
||||
WindowsBrowser {
|
||||
detect_keys: &[r"SOFTWARE\Zen Browser"],
|
||||
native_messaging_reg_path: r"SOFTWARE\Zen Browser\NativeMessagingHosts",
|
||||
kind: BrowserKind::Firefox,
|
||||
},
|
||||
WindowsBrowser {
|
||||
detect_keys: &[r"SOFTWARE\LibreWolf"],
|
||||
native_messaging_reg_path: r"SOFTWARE\LibreWolf\NativeMessagingHosts",
|
||||
kind: BrowserKind::Firefox,
|
||||
},
|
||||
];
|
||||
|
||||
struct BrowserManifestTarget {
|
||||
detect_path: PathBuf,
|
||||
manifest_dir: PathBuf,
|
||||
kind: BrowserKind,
|
||||
}
|
||||
|
||||
/// Build the JSON manifest content for the native messaging host.
|
||||
fn build_manifest_json(host_path: &Path, kind: BrowserKind) -> String {
|
||||
// Escape backslashes in the path for JSON.
|
||||
let path_str = host_path.to_string_lossy().replace('\\', "\\\\");
|
||||
match kind {
|
||||
BrowserKind::Firefox => format!(
|
||||
"{{\n \"name\": \"{}\",\n \"description\": \"Flash Player Native Messaging Host\",\n \"path\": \"{}\",\n \"type\": \"stdio\",\n \"allowed_extensions\": [\"{}\"]\n}}\n",
|
||||
MANIFEST_NAME, path_str, FIREFOX_ALLOWED_EXTENSION,
|
||||
),
|
||||
BrowserKind::ChromeLike => format!(
|
||||
"{{\n \"name\": \"{}\",\n \"description\": \"Flash Player Native Messaging Host\",\n \"path\": \"{}\",\n \"type\": \"stdio\",\n \"allowed_origins\": [\"{}\"]\n}}\n",
|
||||
MANIFEST_NAME, path_str, ALLOWED_ORIGIN,
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the path where the native host exe should be installed on Windows.
|
||||
/// On a 64-bit system it goes into the System32\Macromed\Flash folder (the 64-bit one).
|
||||
/// On a 32-bit system it goes into the SysWOW64 (or System32) Macromed\Flash folder.
|
||||
#[cfg(windows)]
|
||||
pub fn get_native_host_install_dir() -> PathBuf {
|
||||
crate::system_info::with_system_info(|si| {
|
||||
if si.is_64bit {
|
||||
si.flash64_path.clone()
|
||||
} else {
|
||||
si.flash32_path.clone()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
pub fn get_native_host_install_dir() -> PathBuf {
|
||||
if cfg!(target_os = "macos") {
|
||||
// Install to ~/Library/Application Support/Clean Flash instead
|
||||
if let Ok(home) = std::env::var("HOME") {
|
||||
PathBuf::from(home).join("Library/Application Support/Clean Flash")
|
||||
} else {
|
||||
PathBuf::from("/Library/Application Support/Clean Flash")
|
||||
}
|
||||
} else if cfg!(target_os = "linux") {
|
||||
// Linux
|
||||
if let Ok(home) = std::env::var("HOME") {
|
||||
PathBuf::from(home).join(".cleanflash")
|
||||
} else {
|
||||
PathBuf::from("/tmp/.cleanflash")
|
||||
}
|
||||
} else {
|
||||
unreachable!()
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the full path to the installed native host executable.
|
||||
pub fn get_native_host_exe_path() -> PathBuf {
|
||||
get_native_host_install_dir().join(HOST_BINARY_NAME)
|
||||
}
|
||||
|
||||
fn manifest_filename_for_kind(kind: BrowserKind) -> &'static str {
|
||||
match kind {
|
||||
BrowserKind::Firefox => FIREFOX_MANIFEST_FILENAME,
|
||||
BrowserKind::ChromeLike => CHROME_MANIFEST_FILENAME,
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
fn get_non_windows_browser_targets(home: &Path) -> Vec<BrowserManifestTarget> {
|
||||
if cfg!(target_os = "macos") {
|
||||
vec![
|
||||
BrowserManifestTarget {
|
||||
detect_path: home.join("Library/Application Support/Google/Chrome"),
|
||||
manifest_dir: home.join("Library/Application Support/Google/Chrome/NativeMessagingHosts"),
|
||||
kind: BrowserKind::ChromeLike,
|
||||
},
|
||||
BrowserManifestTarget {
|
||||
detect_path: home.join("Library/Application Support/Microsoft Edge"),
|
||||
manifest_dir: home.join("Library/Application Support/Microsoft Edge/NativeMessagingHosts"),
|
||||
kind: BrowserKind::ChromeLike,
|
||||
},
|
||||
BrowserManifestTarget {
|
||||
detect_path: home.join("Library/Application Support/BraveSoftware/Brave-Browser"),
|
||||
manifest_dir: home.join("Library/Application Support/BraveSoftware/Brave-Browser/NativeMessagingHosts"),
|
||||
kind: BrowserKind::ChromeLike,
|
||||
},
|
||||
BrowserManifestTarget {
|
||||
detect_path: home.join("Library/Application Support/Vivaldi"),
|
||||
manifest_dir: home.join("Library/Application Support/Vivaldi/NativeMessagingHosts"),
|
||||
kind: BrowserKind::ChromeLike,
|
||||
},
|
||||
BrowserManifestTarget {
|
||||
detect_path: home.join("Library/Application Support/Chromium"),
|
||||
manifest_dir: home.join("Library/Application Support/Chromium/NativeMessagingHosts"),
|
||||
kind: BrowserKind::ChromeLike,
|
||||
},
|
||||
BrowserManifestTarget {
|
||||
detect_path: home.join("Library/Application Support/Arc"),
|
||||
manifest_dir: home.join("Library/Application Support/Arc/NativeMessagingHosts"),
|
||||
kind: BrowserKind::ChromeLike,
|
||||
},
|
||||
BrowserManifestTarget {
|
||||
detect_path: home.join("Library/Application Support/Mozilla"),
|
||||
manifest_dir: home.join("Library/Application Support/Mozilla/NativeMessagingHosts"),
|
||||
kind: BrowserKind::Firefox,
|
||||
},
|
||||
BrowserManifestTarget {
|
||||
detect_path: home.join("Library/Application Support/Firefox Developer Edition"),
|
||||
manifest_dir: home.join("Library/Application Support/Mozilla/NativeMessagingHosts"),
|
||||
kind: BrowserKind::Firefox,
|
||||
},
|
||||
BrowserManifestTarget {
|
||||
detect_path: home.join("Library/Application Support/zen"),
|
||||
manifest_dir: home.join("Library/Application Support/zen/NativeMessagingHosts"),
|
||||
kind: BrowserKind::Firefox,
|
||||
},
|
||||
BrowserManifestTarget {
|
||||
detect_path: home.join("Library/Application Support/LibreWolf"),
|
||||
manifest_dir: home.join("Library/Application Support/LibreWolf/NativeMessagingHosts"),
|
||||
kind: BrowserKind::Firefox,
|
||||
},
|
||||
BrowserManifestTarget {
|
||||
detect_path: home.join("Library/Application Support/net.imput.helium"),
|
||||
manifest_dir: home.join("Library/Application Support/net.imput.helium/NativeMessagingHosts"),
|
||||
kind: BrowserKind::ChromeLike,
|
||||
}
|
||||
]
|
||||
} else {
|
||||
vec![
|
||||
BrowserManifestTarget {
|
||||
detect_path: home.join(".config/google-chrome"),
|
||||
manifest_dir: home.join(".config/google-chrome/NativeMessagingHosts"),
|
||||
kind: BrowserKind::ChromeLike,
|
||||
},
|
||||
BrowserManifestTarget {
|
||||
detect_path: home.join(".config/microsoft-edge"),
|
||||
manifest_dir: home.join(".config/microsoft-edge/NativeMessagingHosts"),
|
||||
kind: BrowserKind::ChromeLike,
|
||||
},
|
||||
BrowserManifestTarget {
|
||||
detect_path: home.join(".config/BraveSoftware/Brave-Browser"),
|
||||
manifest_dir: home.join(".config/BraveSoftware/Brave-Browser/NativeMessagingHosts"),
|
||||
kind: BrowserKind::ChromeLike,
|
||||
},
|
||||
BrowserManifestTarget {
|
||||
detect_path: home.join(".config/vivaldi"),
|
||||
manifest_dir: home.join(".config/vivaldi/NativeMessagingHosts"),
|
||||
kind: BrowserKind::ChromeLike,
|
||||
},
|
||||
BrowserManifestTarget {
|
||||
detect_path: home.join(".config/chromium"),
|
||||
manifest_dir: home.join(".config/chromium/NativeMessagingHosts"),
|
||||
kind: BrowserKind::ChromeLike,
|
||||
},
|
||||
BrowserManifestTarget {
|
||||
detect_path: home.join(".config/arc"),
|
||||
manifest_dir: home.join(".config/arc/NativeMessagingHosts"),
|
||||
kind: BrowserKind::ChromeLike,
|
||||
},
|
||||
BrowserManifestTarget {
|
||||
detect_path: home.join(".config/net.imput.helium"),
|
||||
manifest_dir: home.join(".config/net.imput.helium/NativeMessagingHosts"),
|
||||
kind: BrowserKind::ChromeLike,
|
||||
},
|
||||
BrowserManifestTarget {
|
||||
detect_path: home.join(".mozilla"),
|
||||
manifest_dir: home.join(".mozilla/native-messaging-hosts"),
|
||||
kind: BrowserKind::Firefox,
|
||||
},
|
||||
BrowserManifestTarget {
|
||||
detect_path: home.join(".zen"),
|
||||
manifest_dir: home.join(".zen/native-messaging-hosts"),
|
||||
kind: BrowserKind::Firefox,
|
||||
},
|
||||
BrowserManifestTarget {
|
||||
detect_path: home.join(".librewolf"),
|
||||
manifest_dir: home.join(".librewolf/native-messaging-hosts"),
|
||||
kind: BrowserKind::Firefox,
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
fn set_windows_manifest_registry_value(nmh_base_key: &str, manifest_path: &str) {
|
||||
use windows_sys::Win32::System::Registry::{
|
||||
RegCloseKey, RegCreateKeyExW, RegSetValueExW, HKEY_CURRENT_USER,
|
||||
KEY_WOW64_64KEY, KEY_WRITE, REG_OPTION_NON_VOLATILE, REG_SZ,
|
||||
};
|
||||
|
||||
let reg_key = format!("{}\\{}", nmh_base_key, MANIFEST_NAME);
|
||||
let key_wide: Vec<u16> = reg_key.encode_utf16().chain(std::iter::once(0)).collect();
|
||||
let val_wide: Vec<u16> = manifest_path
|
||||
.encode_utf16()
|
||||
.chain(std::iter::once(0))
|
||||
.collect();
|
||||
|
||||
unsafe {
|
||||
let mut hkey = std::ptr::null_mut();
|
||||
let mut disposition: u32 = 0;
|
||||
let result = RegCreateKeyExW(
|
||||
HKEY_CURRENT_USER,
|
||||
key_wide.as_ptr(),
|
||||
0,
|
||||
std::ptr::null(),
|
||||
REG_OPTION_NON_VOLATILE,
|
||||
KEY_WRITE | KEY_WOW64_64KEY,
|
||||
std::ptr::null(),
|
||||
&mut hkey,
|
||||
&mut disposition,
|
||||
);
|
||||
if result == 0 {
|
||||
RegSetValueExW(
|
||||
hkey,
|
||||
std::ptr::null(),
|
||||
0,
|
||||
REG_SZ as u32,
|
||||
val_wide.as_ptr() as *const u8,
|
||||
(val_wide.len() * 2) as u32,
|
||||
);
|
||||
RegCloseKey(hkey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
fn delete_windows_manifest_registry_value(nmh_base_key: &str) {
|
||||
use windows_sys::Win32::System::Registry::{
|
||||
RegCloseKey, RegDeleteTreeW, RegOpenKeyExW, HKEY_CURRENT_USER,
|
||||
KEY_WOW64_64KEY, KEY_WRITE,
|
||||
};
|
||||
|
||||
unsafe {
|
||||
let parent_wide: Vec<u16> = nmh_base_key
|
||||
.encode_utf16()
|
||||
.chain(std::iter::once(0))
|
||||
.collect();
|
||||
let name_wide: Vec<u16> = MANIFEST_NAME
|
||||
.encode_utf16()
|
||||
.chain(std::iter::once(0))
|
||||
.collect();
|
||||
|
||||
let mut parent_hkey = std::ptr::null_mut();
|
||||
let result = RegOpenKeyExW(
|
||||
HKEY_CURRENT_USER,
|
||||
parent_wide.as_ptr(),
|
||||
0,
|
||||
KEY_WRITE | KEY_WOW64_64KEY,
|
||||
&mut parent_hkey,
|
||||
);
|
||||
if result == 0 {
|
||||
RegDeleteTreeW(parent_hkey, name_wide.as_ptr());
|
||||
RegCloseKey(parent_hkey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Install the native messaging host manifests for all detected browsers.
|
||||
#[cfg(windows)]
|
||||
pub fn install_native_host(form: &dyn ProgressCallback) -> Result<(), InstallError> {
|
||||
form.update_progress_label("Installing native messaging host for modern browsers...", true);
|
||||
|
||||
let host_exe = get_native_host_exe_path();
|
||||
let chrome_manifest_json = build_manifest_json(&host_exe, BrowserKind::ChromeLike);
|
||||
let firefox_manifest_json = build_manifest_json(&host_exe, BrowserKind::Firefox);
|
||||
|
||||
// Create manifest directory inside the install dir.
|
||||
let manifest_dir = get_native_host_install_dir().join("manifests");
|
||||
let _ = fs::create_dir_all(&manifest_dir);
|
||||
let chrome_manifest_path = manifest_dir.join(CHROME_MANIFEST_FILENAME);
|
||||
fs::write(&chrome_manifest_path, chrome_manifest_json.as_bytes()).map_err(|e| {
|
||||
InstallError::new(format!(
|
||||
"Failed to write Chrome native messaging manifest: {}",
|
||||
e
|
||||
))
|
||||
})?;
|
||||
let firefox_manifest_path = manifest_dir.join(FIREFOX_MANIFEST_FILENAME);
|
||||
fs::write(&firefox_manifest_path, firefox_manifest_json.as_bytes()).map_err(|e| {
|
||||
InstallError::new(format!(
|
||||
"Failed to write Firefox native messaging manifest: {}",
|
||||
e
|
||||
))
|
||||
})?;
|
||||
|
||||
let chrome_manifest_path_str = chrome_manifest_path.to_string_lossy().to_string();
|
||||
let firefox_manifest_path_str = firefox_manifest_path.to_string_lossy().to_string();
|
||||
|
||||
// For each browser that is detected via registry, register the manifest.
|
||||
for browser in WINDOWS_BROWSERS {
|
||||
if !browser
|
||||
.detect_keys
|
||||
.iter()
|
||||
.any(|detect_key| windows_registry_key_exists(detect_key))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
let manifest_path = match browser.kind {
|
||||
BrowserKind::Firefox => &firefox_manifest_path_str,
|
||||
BrowserKind::ChromeLike => &chrome_manifest_path_str,
|
||||
};
|
||||
set_windows_manifest_registry_value(browser.native_messaging_reg_path, manifest_path);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
pub fn install_native_host(form: &dyn ProgressCallback) -> Result<(), InstallError> {
|
||||
form.update_progress_label("Installing native messaging host for modern browsers...", true);
|
||||
|
||||
let host_exe = get_native_host_exe_path();
|
||||
let chrome_manifest_json = build_manifest_json(&host_exe, BrowserKind::ChromeLike);
|
||||
let firefox_manifest_json = build_manifest_json(&host_exe, BrowserKind::Firefox);
|
||||
|
||||
// Determine browser config directories that exist.
|
||||
let home = std::env::var("HOME")
|
||||
.map_err(|_| InstallError::new("HOME environment variable not set"))?;
|
||||
let home = PathBuf::from(home);
|
||||
|
||||
// Check known browser paths and install manifests only for those that exist.
|
||||
for target in get_non_windows_browser_targets(&home) {
|
||||
if !target.detect_path.exists() {
|
||||
continue;
|
||||
}
|
||||
|
||||
let _ = fs::create_dir_all(&target.manifest_dir);
|
||||
let manifest_filename = manifest_filename_for_kind(target.kind);
|
||||
let manifest_json = match target.kind {
|
||||
BrowserKind::Firefox => &firefox_manifest_json,
|
||||
BrowserKind::ChromeLike => &chrome_manifest_json,
|
||||
};
|
||||
let manifest_path = target.manifest_dir.join(manifest_filename);
|
||||
let _ = fs::write(&manifest_path, manifest_json.as_bytes());
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Uninstall the native messaging host: remove manifests and registry entries.
|
||||
#[cfg(windows)]
|
||||
pub fn uninstall_native_host(form: &dyn ProgressCallback) {
|
||||
form.update_progress_label("Removing native messaging host...", true);
|
||||
|
||||
// Remove manifest files.
|
||||
let install_dir = get_native_host_install_dir();
|
||||
let manifest_dir = install_dir.join("manifests");
|
||||
let _ = fs::remove_file(manifest_dir.join(CHROME_MANIFEST_FILENAME));
|
||||
let _ = fs::remove_file(manifest_dir.join(FIREFOX_MANIFEST_FILENAME));
|
||||
let _ = fs::remove_dir(&manifest_dir);
|
||||
|
||||
// Remove the host exe.
|
||||
let host_exe = install_dir.join(HOST_BINARY_NAME);
|
||||
crate::file_util::delete_file(&host_exe);
|
||||
|
||||
// Remove registry entries for all browsers.
|
||||
for browser in WINDOWS_BROWSERS {
|
||||
delete_windows_manifest_registry_value(browser.native_messaging_reg_path);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
pub fn uninstall_native_host(form: &dyn ProgressCallback) {
|
||||
form.update_progress_label("Removing native messaging host...", true);
|
||||
|
||||
// Remove the manifests.
|
||||
let home = match std::env::var("HOME") {
|
||||
Ok(h) => PathBuf::from(h),
|
||||
Err(_) => return,
|
||||
};
|
||||
|
||||
for target in get_non_windows_browser_targets(&home) {
|
||||
let _ = fs::remove_file(target.manifest_dir.join(CHROME_MANIFEST_FILENAME));
|
||||
let _ = fs::remove_file(target.manifest_dir.join(FIREFOX_MANIFEST_FILENAME));
|
||||
}
|
||||
|
||||
// Remove the host folder and everything inside it.
|
||||
let install_dir = get_native_host_install_dir();
|
||||
let host_exe = install_dir.join(HOST_BINARY_NAME);
|
||||
let _ = fs::remove_file(&host_exe);
|
||||
let _ = fs::remove_dir_all(&install_dir);
|
||||
}
|
||||
|
||||
/// Check if a registry key exists under HKCU.
|
||||
#[cfg(windows)]
|
||||
fn windows_registry_key_exists(subkey: &str) -> bool {
|
||||
use windows_sys::Win32::System::Registry::{
|
||||
RegCloseKey, RegOpenKeyExW, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE,
|
||||
KEY_READ, KEY_WOW64_64KEY,
|
||||
};
|
||||
|
||||
let key_wide: Vec<u16> = subkey.encode_utf16().chain(std::iter::once(0)).collect();
|
||||
|
||||
// Check HKCU first, then HKLM.
|
||||
for &root in &[HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE] {
|
||||
unsafe {
|
||||
let mut hkey = std::ptr::null_mut();
|
||||
let result = RegOpenKeyExW(root, key_wide.as_ptr(), 0, KEY_READ | KEY_WOW64_64KEY, &mut hkey);
|
||||
if result == 0 {
|
||||
RegCloseKey(hkey);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
false
|
||||
}
|
||||
@@ -1,116 +0,0 @@
|
||||
use crate::ExitedProcess;
|
||||
use std::process::{Command, Stdio};
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
use std::os::windows::process::CommandExt;
|
||||
|
||||
const CREATE_NO_WINDOW: u32 = 0x08000000;
|
||||
|
||||
/// Run a process, capturing stdout and stderr, and wait for it to exit.
|
||||
pub fn run_process(program: &str, args: &[&str]) -> ExitedProcess {
|
||||
let mut cmd = Command::new(program);
|
||||
cmd.args(args)
|
||||
.stdout(Stdio::piped())
|
||||
.stderr(Stdio::piped());
|
||||
|
||||
#[cfg(windows)]
|
||||
cmd.creation_flags(CREATE_NO_WINDOW);
|
||||
|
||||
let result = cmd.output();
|
||||
|
||||
match result {
|
||||
Ok(output) => {
|
||||
let stdout = String::from_utf8_lossy(&output.stdout);
|
||||
let stderr = String::from_utf8_lossy(&output.stderr);
|
||||
let combined = format!("{}{}", stdout.trim(), stderr.trim());
|
||||
ExitedProcess {
|
||||
exit_code: output.status.code().unwrap_or(-1),
|
||||
output: combined,
|
||||
}
|
||||
}
|
||||
Err(e) => ExitedProcess {
|
||||
exit_code: -1,
|
||||
output: e.to_string(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/// Run a process and wait for it to exit (no output capture).
|
||||
pub fn run_unmanaged_process(program: &str, args: &[&str]) {
|
||||
let mut cmd = Command::new(program);
|
||||
cmd.args(args)
|
||||
.stdout(Stdio::null())
|
||||
.stderr(Stdio::null());
|
||||
|
||||
#[cfg(windows)]
|
||||
cmd.creation_flags(CREATE_NO_WINDOW);
|
||||
|
||||
let _ = cmd.status();
|
||||
}
|
||||
|
||||
/// Collect the names of DLL modules loaded in a given process.
|
||||
/// Used to detect whether a browser has Flash DLLs loaded.
|
||||
#[cfg(windows)]
|
||||
pub fn collect_modules(pid: u32) -> Vec<String> {
|
||||
use windows_sys::Win32::Foundation::CloseHandle;
|
||||
use windows_sys::Win32::System::ProcessStatus::{
|
||||
EnumProcessModulesEx, GetModuleFileNameExW, LIST_MODULES_ALL,
|
||||
};
|
||||
use windows_sys::Win32::System::Threading::{
|
||||
OpenProcess, PROCESS_QUERY_INFORMATION, PROCESS_VM_READ,
|
||||
};
|
||||
|
||||
let mut modules = Vec::new();
|
||||
|
||||
unsafe {
|
||||
let handle = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, 0, pid);
|
||||
if handle.is_null() {
|
||||
return modules;
|
||||
}
|
||||
#[allow(unused_imports)]
|
||||
use std::ptr;
|
||||
|
||||
// HMODULE is *mut c_void on windows-sys 0.59
|
||||
let mut h_modules: [*mut std::ffi::c_void; 1024] =
|
||||
[std::ptr::null_mut(); 1024];
|
||||
let mut cb_needed: u32 = 0;
|
||||
|
||||
let ok = EnumProcessModulesEx(
|
||||
handle,
|
||||
h_modules.as_mut_ptr().cast(),
|
||||
std::mem::size_of_val(&h_modules) as u32,
|
||||
&mut cb_needed,
|
||||
LIST_MODULES_ALL,
|
||||
);
|
||||
|
||||
if ok != 0 {
|
||||
let count =
|
||||
cb_needed as usize / std::mem::size_of::<*mut std::ffi::c_void>();
|
||||
for item in h_modules.iter().take(count.min(h_modules.len())) {
|
||||
let mut name_buf = [0u16; 512];
|
||||
let len = GetModuleFileNameExW(
|
||||
handle,
|
||||
*item as _,
|
||||
name_buf.as_mut_ptr(),
|
||||
name_buf.len() as u32,
|
||||
);
|
||||
if len > 0 {
|
||||
let full_path =
|
||||
String::from_utf16_lossy(&name_buf[..len as usize]);
|
||||
if let Some(file_name) = full_path.rsplit('\\').next() {
|
||||
modules.push(file_name.to_string());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CloseHandle(handle);
|
||||
}
|
||||
|
||||
modules
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
pub fn collect_modules(_pid: u32) -> Vec<String> {
|
||||
Vec::new()
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
/// Disable WoW64 file system redirection. Returns a cookie to restore later.
|
||||
#[cfg(windows)]
|
||||
pub fn disable_redirection() -> *mut std::ffi::c_void {
|
||||
let mut old_value: *mut std::ffi::c_void = std::ptr::null_mut();
|
||||
unsafe {
|
||||
Wow64DisableWow64FsRedirection(&mut old_value);
|
||||
}
|
||||
old_value
|
||||
}
|
||||
|
||||
/// Re-enable WoW64 file system redirection using the cookie from `disable_redirection`.
|
||||
#[cfg(windows)]
|
||||
pub fn enable_redirection(old_value: *mut std::ffi::c_void) {
|
||||
unsafe {
|
||||
Wow64RevertWow64FsRedirection(old_value);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
extern "system" {
|
||||
fn Wow64DisableWow64FsRedirection(old_value: *mut *mut std::ffi::c_void) -> i32;
|
||||
fn Wow64RevertWow64FsRedirection(old_value: *mut std::ffi::c_void) -> i32;
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
pub fn disable_redirection() -> *mut std::ffi::c_void {
|
||||
std::ptr::null_mut()
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
pub fn enable_redirection(_old_value: *mut std::ffi::c_void) {}
|
||||
@@ -1,50 +0,0 @@
|
||||
use crate::{process_utils, system_info, InstallError};
|
||||
use std::fs;
|
||||
use std::io::Write;
|
||||
|
||||
/// Apply registry contents by writing a .reg file and importing with reg.exe.
|
||||
#[cfg(windows)]
|
||||
pub fn apply_registry(entries: &[&str]) -> Result<(), InstallError> {
|
||||
let combined = entries.join("\n\n");
|
||||
let filled = system_info::fill_string(&combined);
|
||||
|
||||
let content = format!("Windows Registry Editor Version 5.00\n\n{}", filled);
|
||||
|
||||
let temp_dir = std::env::temp_dir();
|
||||
// Include the process ID to avoid collisions when two instances run concurrently,
|
||||
// matching the unique-file guarantee of C#'s Path.GetTempFileName().
|
||||
let reg_file = temp_dir.join(format!("cleanflash_reg_{}.tmp", std::process::id()));
|
||||
|
||||
// Write as UTF-16LE with BOM (Windows .reg format).
|
||||
{
|
||||
let mut f = fs::File::create(®_file)
|
||||
.map_err(|e| InstallError::new(format!("Failed to create temp reg file: {}", e)))?;
|
||||
let utf16: Vec<u16> = content.encode_utf16().collect();
|
||||
// BOM
|
||||
f.write_all(&[0xFF, 0xFE])
|
||||
.map_err(|e| InstallError::new(format!("Failed to write BOM: {}", e)))?;
|
||||
for word in &utf16 {
|
||||
f.write_all(&word.to_le_bytes())
|
||||
.map_err(|e| InstallError::new(format!("Failed to write reg data: {}", e)))?;
|
||||
}
|
||||
}
|
||||
|
||||
let reg_filename = reg_file.to_string_lossy().to_string();
|
||||
let result = process_utils::run_process("reg.exe", &["import", ®_filename]);
|
||||
|
||||
let _ = fs::remove_file(®_file);
|
||||
|
||||
if !result.is_successful() {
|
||||
return Err(InstallError::new(format!(
|
||||
"Failed to apply changes to registry: error code {}\n\n{}",
|
||||
result.exit_code, result.output
|
||||
)));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
pub fn apply_registry(_entries: &[&str]) -> Result<(), InstallError> {
|
||||
Ok(())
|
||||
}
|
||||
@@ -1,224 +0,0 @@
|
||||
/// Embedded registry resources, matching the original C# resource strings.
|
||||
|
||||
pub const UNINSTALL_REGISTRY: &str = r#"[HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION]
|
||||
"FlashHelperService.exe"=-
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Control Panel\Extended Properties\System.ControlPanel.Category]
|
||||
"${SYSTEM_64_PATH}\\FlashPlayerCPLApp.cpl"=-
|
||||
|
||||
[-HKEY_CURRENT_USER\Software\FlashCenter]
|
||||
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\App Paths\FlashCenter.exe]
|
||||
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall\FlashCenter]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\AppID\{119DA84B-E3DB-4D47-A8DD-7FF6D5804689}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\AppID\{B9020634-CE8F-4F09-9FBC-D108A73A4676}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\TypeLib\{37EF68ED-16D3-4191-86BF-AB731D75AAB7}]
|
||||
[-HKEY_LOCAL_MACHINE\System\ControlSet001\services\Flash Helper Service]
|
||||
[-HKEY_LOCAL_MACHINE\System\ControlSet001\services\FlashCenterService]
|
||||
[-HKEY_LOCAL_MACHINE\System\CurrentControlSet\services\Flash Helper Service]
|
||||
[-HKEY_LOCAL_MACHINE\System\CurrentControlSet\services\FlashCenterService]
|
||||
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\MacromediaFlashPaper.MacromediaFlashPaper]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Low Rights\ElevationPolicy\{FAF199D2-BFA7-4394-A4DE-044A08E59B32}]
|
||||
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashPlayerUpdateService.exe]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashUtil32_${VERSION_PATH}_ActiveX.exe]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashUtil64_${VERSION_PATH}_ActiveX.exe]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashUtil32_${VERSION_PATH}_Plugin.exe]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashUtil64_${VERSION_PATH}_Plugin.exe]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashPlayerPlugin_${VERSION_PATH}.exe]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashUtil32_${VERSION_PATH}_pepper.exe]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashUtil64_${VERSION_PATH}_pepper.exe]
|
||||
|
||||
[-HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Internet Explorer\Low Rights\ElevationPolicy\{FAF199D2-BFA7-4394-A4DE-044A08E59B32}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player ActiveX]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player NPAPI]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Adobe Flash Player PPAPI]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Clean Flash Player]
|
||||
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\.mfp]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\.sol]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\.sor]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\.spl]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\.swf]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\AppID\{B9020634-CE8F-4F09-9FBC-D108A73A4676}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\CLSID\{B019E3BF-E7E5-453C-A2E4-D2C18CA0866F}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\CLSID\{D27CDB6E-AE6D-11cf-96B8-444553540000}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\FlashFactory.FlashFactory]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\FlashFactory.FlashFactory.1]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Interface\{299817DA-1FAC-4CE2-8F48-A108237013BD}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Interface\{307F64C0-621D-4D56-BBC6-91EFC13CE40D}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Interface\{57A0E747-3863-4D20-A811-950C84F1DB9B}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Interface\{86230738-D762-4C50-A2DE-A753E5B1686F}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Interface\{D27CDB6C-AE6D-11CF-96B8-444553540000}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Interface\{D27CDB6D-AE6D-11CF-96B8-444553540000}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\MIME\Database\Content Type\application/futuresplash]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\MIME\Database\Content Type\application/x-shockwave-flash]
|
||||
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.1]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.2]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.3]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.4]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.5]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.6]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.7]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.8]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.9]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.10]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.11]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.12]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.13]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.14]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.15]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.16]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.17]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.18]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.19]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.20]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.21]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.22]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.23]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.24]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.25]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.26]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.27]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.28]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.29]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.30]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.31]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.32]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.33]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\ShockwaveFlash.ShockwaveFlash.34]
|
||||
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\TypeLib\{57A0E746-3863-4D20-A811-950C84F1DB9B}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\TypeLib\{D27CDB6B-AE6D-11CF-96B8-444553540000}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\TypeLib\{FAB3E735-69C7-453B-A446-B6823C6DF1C9}]
|
||||
|
||||
[-HKEY_LOCAL_MACHINE\Software\Macromedia]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\ActiveX Compatibility\{D27CDB6E-AE6D-11CF-96B8-444553540000}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\ActiveX Compatibility\{D27CDB70-AE6D-11cf-96B8-444553540000}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\NavigatorPluginsList\Shockwave Flash]
|
||||
|
||||
[-HKEY_LOCAL_MACHINE\Software\MozillaPlugins\@adobe.com/FlashPlayer]
|
||||
|
||||
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\miniconfig]
|
||||
[-HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\miniconfig]"#;
|
||||
|
||||
pub const UNINSTALL_REGISTRY_64: &str = r#"[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION]
|
||||
"FlashHelperService.exe"=-
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Control Panel\Extended Properties\System.ControlPanel.Category]
|
||||
"${SYSTEM_32_PATH}\\FlashPlayerCPLApp.cpl"=-
|
||||
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node\CLSID\{B019E3BF-E7E5-453C-A2E4-D2C18CA0866F}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node\CLSID\{D27CDB6E-AE6D-11cf-96B8-444553540000}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node\CLSID\{D27CDB70-AE6D-11cf-96B8-444553540000}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node\Interface\{299817DA-1FAC-4CE2-8F48-A108237013BD}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node\Interface\{307F64C0-621D-4D56-BBC6-91EFC13CE40D}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node\Interface\{57A0E747-3863-4D20-A811-950C84F1DB9B}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node\Interface\{86230738-D762-4C50-A2DE-A753E5B1686F}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node\Interface\{D27CDB6C-AE6D-11CF-96B8-444553540000}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node\Interface\{D27CDB6D-AE6D-11CF-96B8-444553540000}]
|
||||
|
||||
[-HKEY_LOCAL_MACHINE\Software\Wow6432Node\Macromedia]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Internet Explorer\ActiveX Compatibility\{D27CDB6E-AE6D-11CF-96B8-444553540000}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Internet Explorer\ActiveX Compatibility\{D27CDB70-AE6D-11cf-96B8-444553540000}]
|
||||
[-HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Internet Explorer\NavigatorPluginsList\Shockwave Flash]
|
||||
|
||||
[-HKEY_LOCAL_MACHINE\Software\Wow6432Node\MozillaPlugins\@adobe.com/FlashPlayer]"#;
|
||||
|
||||
pub const INSTALL_GENERAL: &str = r#"[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Control Panel\Extended Properties\System.ControlPanel.Category]
|
||||
"${SYSTEM_32_PATH}\\FlashPlayerCPLApp.cpl"=dword:0000000a
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashPlayerApp.exe]
|
||||
"DisableExceptionChainValidation"=dword:00000000
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\Clean Flash Player]
|
||||
"DisplayName"="Clean Flash Player ${VERSION}"
|
||||
"HelpLink"="https://gitlab.com/cleanflash/installer#clean-flash-player"
|
||||
"NoModify"=dword:00000001
|
||||
"NoRepair"=dword:00000001
|
||||
"URLInfoAbout"="https://gitlab.com/cleanflash/installer#clean-flash-player"
|
||||
"URLUpdateInfo"="https://gitlab.com/cleanflash/installer#clean-flash-player"
|
||||
"VersionMajor"=dword:00000022
|
||||
"VersionMinor"=dword:00000000
|
||||
"Publisher"="CleanFlash Team"
|
||||
"EstimatedSize"=dword:00011cb8
|
||||
"DisplayIcon"="${PROGRAM_FLASH_32_PATH}\\FlashUtil_Uninstall.exe"
|
||||
"UninstallString"="${PROGRAM_FLASH_32_PATH}\\FlashUtil_Uninstall.exe"
|
||||
"DisplayVersion"="${VERSION}""#;
|
||||
|
||||
pub const INSTALL_GENERAL_64: &str = r#"[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Control Panel\Extended Properties\System.ControlPanel.Category]
|
||||
"${SYSTEM_32_PATH}\\FlashPlayerCPLApp.cpl"=dword:0000000a
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashPlayerApp.exe]
|
||||
"DisableExceptionChainValidation"=dword:00000000"#;
|
||||
|
||||
pub const INSTALL_NP: &str = r#"[HKEY_LOCAL_MACHINE\Software\Macromedia\FlashPlayerPlugin]
|
||||
"isPartner"=dword:00000001
|
||||
"Version"="${VERSION}"
|
||||
"PlayerPath"="${FLASH_64_PATH}\\NPSWF${ARCH}_${VERSION_PATH}.dll"
|
||||
"UninstallerPath"=-
|
||||
"isScriptDebugger"=dword:00000000
|
||||
"isESR"=dword:00000000
|
||||
"isMSI"=dword:00000000
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Macromedia\FlashPlayerPluginReleaseType]
|
||||
"Release"=dword:00000001
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\MozillaPlugins\@adobe.com/FlashPlayer]
|
||||
"Vendor"="Adobe"
|
||||
"ProductName"="Adobe® Flash® Player ${VERSION} Plugin"
|
||||
"Path"="${FLASH_64_PATH}\\NPSWF${ARCH}_${VERSION_PATH}.dll"
|
||||
"Version"="${VERSION}"
|
||||
"Description"="Adobe® Flash® Player ${VERSION} Plugin"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashPlayerPlugin_${VERSION_PATH}.exe]
|
||||
"DisableExceptionChainValidation"=dword:00000000"#;
|
||||
|
||||
pub const INSTALL_NP_64: &str = r#"[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Macromedia\FlashPlayerPlugin]
|
||||
"PlayerPath"="${FLASH_32_PATH}\\NPSWF_${VERSION_PATH}.dll"
|
||||
"Version"="${VERSION}"
|
||||
"UninstallerPath"=-
|
||||
"isScriptDebugger"=dword:00000000
|
||||
"isESR"=dword:00000000
|
||||
"isMSI"=dword:00000000
|
||||
"isPartner"=dword:00000001
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Macromedia\FlashPlayerPluginReleaseType]
|
||||
"Release"=dword:00000001
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Wow6432Node\MozillaPlugins\@adobe.com/FlashPlayer]
|
||||
"ProductName"="Adobe® Flash® Player ${VERSION} Plugin"
|
||||
"Description"="Adobe® Flash® Player ${VERSION} Plugin"
|
||||
"Version"="${VERSION}"
|
||||
"XPTPath"="${FLASH_32_PATH}\\flashplayer.xpt"
|
||||
"Vendor"="Adobe"
|
||||
"Path"="${FLASH_32_PATH}\\NPSWF32_${VERSION_PATH}.dll"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\FlashPlayerPlugin_${VERSION_PATH}.exe]
|
||||
"DisableExceptionChainValidation"=dword:00000000"#;
|
||||
|
||||
pub const INSTALL_PP: &str = r#"[HKEY_LOCAL_MACHINE\Software\Macromedia\FlashPlayerPepper]
|
||||
"UninstallerPath"=-
|
||||
"PlayerPath"="${FLASH_64_PATH}\\pepflashplayer${ARCH}_${VERSION_PATH}.dll"
|
||||
"isScriptDebugger"=dword:00000000
|
||||
"isESR"=dword:00000000
|
||||
"isMSI"=dword:00000000
|
||||
"isPartner"=dword:00000001
|
||||
"Version"="${VERSION}"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Macromedia\FlashPlayerPepperReleaseType]
|
||||
"Release"=dword:00000001"#;
|
||||
|
||||
pub const INSTALL_PP_64: &str = r#"[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Macromedia\FlashPlayerPepper]
|
||||
"UninstallerPath"=-
|
||||
"PlayerPath"="${FLASH_32_PATH}\\pepflashplayer32_${VERSION_PATH}.dll"
|
||||
"isScriptDebugger"=dword:00000000
|
||||
"isESR"=dword:00000000
|
||||
"isMSI"=dword:00000000
|
||||
"isPartner"=dword:00000001
|
||||
"Version"="${VERSION}"
|
||||
|
||||
[HKEY_LOCAL_MACHINE\Software\Wow6432Node\Macromedia\FlashPlayerPepperReleaseType]
|
||||
"Release"=dword:00000001"#;
|
||||
@@ -1,187 +0,0 @@
|
||||
use crate::update_checker;
|
||||
use std::collections::HashMap;
|
||||
use std::env;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
/// Lazily-initialized system path info, analogous to C# SystemInfo class.
|
||||
pub struct SystemInfo {
|
||||
pub system32_path: PathBuf,
|
||||
pub system64_path: PathBuf,
|
||||
pub program32_path: PathBuf,
|
||||
pub flash_program32_path: PathBuf,
|
||||
pub macromed32_path: PathBuf,
|
||||
pub macromed64_path: PathBuf,
|
||||
pub flash32_path: PathBuf,
|
||||
pub flash64_path: PathBuf,
|
||||
pub version: String,
|
||||
pub version_path: String,
|
||||
pub version_comma: String,
|
||||
pub is_64bit: bool,
|
||||
replacements: HashMap<String, String>,
|
||||
}
|
||||
|
||||
impl SystemInfo {
|
||||
pub fn new() -> Self {
|
||||
let system32_path = get_syswow64_path();
|
||||
let system64_path = get_system32_path();
|
||||
let program32_path = get_program_files_x86();
|
||||
let flash_program32_path = program32_path.join("Flash Player");
|
||||
let macromed32_path = system32_path.join("Macromed");
|
||||
let macromed64_path = system64_path.join("Macromed");
|
||||
let flash32_path = macromed32_path.join("Flash");
|
||||
let flash64_path = macromed64_path.join("Flash");
|
||||
let version = update_checker::FLASH_VERSION.to_string();
|
||||
let version_path = version.replace('.', "_");
|
||||
let version_comma = version.replace('.', ",");
|
||||
let is_64bit = cfg!(target_pointer_width = "64")
|
||||
|| env::var("PROCESSOR_ARCHITEW6432").is_ok();
|
||||
|
||||
let arch = if is_64bit { "64" } else { "32" };
|
||||
|
||||
let mut replacements = HashMap::new();
|
||||
replacements.insert(
|
||||
"${SYSTEM_32_PATH}".into(),
|
||||
system32_path.to_string_lossy().replace('\\', "\\\\"),
|
||||
);
|
||||
replacements.insert(
|
||||
"${SYSTEM_64_PATH}".into(),
|
||||
system64_path.to_string_lossy().replace('\\', "\\\\"),
|
||||
);
|
||||
replacements.insert(
|
||||
"${PROGRAM_32_PATH}".into(),
|
||||
program32_path.to_string_lossy().replace('\\', "\\\\"),
|
||||
);
|
||||
replacements.insert(
|
||||
"${PROGRAM_FLASH_32_PATH}".into(),
|
||||
flash_program32_path.to_string_lossy().replace('\\', "\\\\"),
|
||||
);
|
||||
replacements.insert(
|
||||
"${FLASH_32_PATH}".into(),
|
||||
flash32_path.to_string_lossy().replace('\\', "\\\\"),
|
||||
);
|
||||
replacements.insert(
|
||||
"${FLASH_64_PATH}".into(),
|
||||
flash64_path.to_string_lossy().replace('\\', "\\\\"),
|
||||
);
|
||||
replacements.insert("${VERSION}".into(), version.clone());
|
||||
replacements.insert("${VERSION_PATH}".into(), version_path.clone());
|
||||
replacements.insert("${VERSION_COMMA}".into(), version_comma.clone());
|
||||
replacements.insert("${ARCH}".into(), arch.into());
|
||||
|
||||
Self {
|
||||
system32_path,
|
||||
system64_path,
|
||||
program32_path,
|
||||
flash_program32_path,
|
||||
macromed32_path,
|
||||
macromed64_path,
|
||||
flash32_path,
|
||||
flash64_path,
|
||||
version,
|
||||
version_path,
|
||||
version_comma,
|
||||
is_64bit,
|
||||
replacements,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn system_paths(&self) -> Vec<&Path> {
|
||||
if self.is_64bit {
|
||||
vec![&self.system32_path, &self.system64_path]
|
||||
} else {
|
||||
vec![&self.system32_path]
|
||||
}
|
||||
}
|
||||
|
||||
pub fn macromed_paths(&self) -> Vec<&Path> {
|
||||
if self.is_64bit {
|
||||
vec![&self.macromed32_path, &self.macromed64_path]
|
||||
} else {
|
||||
vec![&self.macromed32_path]
|
||||
}
|
||||
}
|
||||
|
||||
pub fn fill_string(&self, s: &str) -> String {
|
||||
let mut result = s.to_string();
|
||||
for (key, value) in &self.replacements {
|
||||
result = result.replace(key.as_str(), value);
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
pub fn is_legacy_windows(&self) -> bool {
|
||||
// Windows version < 6.2 (before Windows 8).
|
||||
unsafe {
|
||||
let mut info: windows_sys::Win32::System::SystemInformation::OSVERSIONINFOW =
|
||||
std::mem::zeroed();
|
||||
info.dwOSVersionInfoSize =
|
||||
std::mem::size_of::<windows_sys::Win32::System::SystemInformation::OSVERSIONINFOW>()
|
||||
as u32;
|
||||
// RtlGetVersion always succeeds and isn't deprecated like GetVersionEx.
|
||||
rtl_get_version(&mut info);
|
||||
info.dwMajorVersion < 6
|
||||
|| (info.dwMajorVersion == 6 && info.dwMinorVersion < 2)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
pub fn is_legacy_windows(&self) -> bool {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
extern "system" {
|
||||
fn RtlGetVersion(
|
||||
lp_version_information: *mut windows_sys::Win32::System::SystemInformation::OSVERSIONINFOW,
|
||||
) -> i32;
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
unsafe fn rtl_get_version(
|
||||
info: &mut windows_sys::Win32::System::SystemInformation::OSVERSIONINFOW,
|
||||
) {
|
||||
RtlGetVersion(info as *mut _);
|
||||
}
|
||||
|
||||
/// Global convenience: fill replacement strings using a default SystemInfo.
|
||||
pub fn fill_string(s: &str) -> String {
|
||||
SYSTEM_INFO.with(|si| si.fill_string(s))
|
||||
}
|
||||
|
||||
thread_local! {
|
||||
static SYSTEM_INFO: SystemInfo = SystemInfo::new();
|
||||
}
|
||||
|
||||
pub fn with_system_info<F, R>(f: F) -> R
|
||||
where
|
||||
F: FnOnce(&SystemInfo) -> R,
|
||||
{
|
||||
SYSTEM_INFO.with(f)
|
||||
}
|
||||
|
||||
fn get_system32_path() -> PathBuf {
|
||||
PathBuf::from(env::var("SYSTEMROOT").unwrap_or_else(|_| r"C:\Windows".into()))
|
||||
.join("System32")
|
||||
}
|
||||
|
||||
fn get_syswow64_path() -> PathBuf {
|
||||
let root = env::var("SYSTEMROOT").unwrap_or_else(|_| r"C:\Windows".into());
|
||||
let wow64 = PathBuf::from(&root).join("SysWOW64");
|
||||
if wow64.exists() {
|
||||
wow64
|
||||
} else {
|
||||
PathBuf::from(&root).join("System32")
|
||||
}
|
||||
}
|
||||
|
||||
fn get_program_files_x86() -> PathBuf {
|
||||
if let Ok(pf86) = env::var("PROGRAMFILES(X86)") {
|
||||
PathBuf::from(pf86)
|
||||
} else if let Ok(pf) = env::var("PROGRAMFILES") {
|
||||
PathBuf::from(pf)
|
||||
} else {
|
||||
PathBuf::from(r"C:\Program Files")
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
use crate::{native_host, InstallError, ProgressCallback};
|
||||
use std::fs;
|
||||
|
||||
/// Perform the full uninstallation sequence on Linux.
|
||||
///
|
||||
/// This removes the native messaging host binary, the Pepper (pp64) files
|
||||
/// installed alongside it, and the browser manifests.
|
||||
pub fn uninstall(form: &dyn ProgressCallback) -> Result<(), InstallError> {
|
||||
form.update_progress_label("Removing native messaging host...", true);
|
||||
native_host::uninstall_native_host(form);
|
||||
|
||||
// Remove the entire install directory (host binary + pp64 files).
|
||||
let install_dir = native_host::get_native_host_install_dir();
|
||||
if install_dir.exists() {
|
||||
form.update_progress_label("Removing installed files...", true);
|
||||
let _ = fs::remove_dir_all(&install_dir);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -1,367 +0,0 @@
|
||||
use crate::{
|
||||
file_util, native_host, process_utils, registry, resources, system_info, winapi_helpers, InstallError,
|
||||
ProgressCallback,
|
||||
};
|
||||
use std::env;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
const PROCESSES_TO_KILL: &[&str] = &[
|
||||
"fcbrowser",
|
||||
"fcbrowsermanager",
|
||||
"fclogin",
|
||||
"fctips",
|
||||
"flashcenter",
|
||||
"flashcenterservice",
|
||||
"flashcenteruninst",
|
||||
"flashplay",
|
||||
"update",
|
||||
"wow_helper",
|
||||
"dummy_cmd",
|
||||
"flashhelperservice",
|
||||
"flashplayerapp",
|
||||
"flashplayer_sa",
|
||||
"flashplayer_sa_debug",
|
||||
"flash-player-host",
|
||||
];
|
||||
|
||||
const CONDITIONAL_PROCESSES: &[&str] = &[
|
||||
"plugin-container",
|
||||
"opera",
|
||||
"iexplore",
|
||||
"chrome",
|
||||
"chromium",
|
||||
"brave",
|
||||
"vivaldi",
|
||||
"msedge",
|
||||
];
|
||||
|
||||
/// Unregister an ActiveX OCX file via regsvr32.
|
||||
pub fn unregister_activex(filename: &str) -> Result<(), InstallError> {
|
||||
winapi_helpers::allow_modifications();
|
||||
|
||||
let path = Path::new(filename);
|
||||
let dir = path.parent().unwrap_or(Path::new("."));
|
||||
let file_name = path
|
||||
.file_name()
|
||||
.unwrap_or_default()
|
||||
.to_string_lossy()
|
||||
.to_string();
|
||||
|
||||
let _prev = env::current_dir();
|
||||
let _ = env::set_current_dir(dir);
|
||||
|
||||
let process = process_utils::run_process("regsvr32.exe", &["/s", "/u", &file_name]);
|
||||
if !process.is_successful() {
|
||||
return Err(InstallError::new(format!(
|
||||
"Failed to unregister ActiveX plugin: error code {}\n\n{}",
|
||||
process.exit_code, process.output
|
||||
)));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn uninstall_registry() -> Result<(), InstallError> {
|
||||
system_info::with_system_info(|si| {
|
||||
if si.is_64bit {
|
||||
registry::apply_registry(&[
|
||||
resources::UNINSTALL_REGISTRY,
|
||||
resources::UNINSTALL_REGISTRY_64,
|
||||
])
|
||||
} else {
|
||||
registry::apply_registry(&[resources::UNINSTALL_REGISTRY])
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fn delete_task(task: &str) {
|
||||
process_utils::run_unmanaged_process("schtasks.exe", &["/delete", "/tn", task, "/f"]);
|
||||
}
|
||||
|
||||
fn stop_service(service: &str) {
|
||||
process_utils::run_unmanaged_process("net.exe", &["stop", service]);
|
||||
}
|
||||
|
||||
fn delete_service(service: &str) {
|
||||
stop_service(service);
|
||||
process_utils::run_unmanaged_process("sc.exe", &["delete", service]);
|
||||
}
|
||||
|
||||
fn delete_flash_center() {
|
||||
// Remove Flash Center from Program Files.
|
||||
let pf = env::var("PROGRAMFILES").unwrap_or_default();
|
||||
file_util::wipe_folder(&PathBuf::from(&pf).join("FlashCenter"));
|
||||
|
||||
if let Ok(pf86) = env::var("PROGRAMFILES(X86)") {
|
||||
file_util::wipe_folder(&PathBuf::from(&pf86).join("FlashCenter"));
|
||||
}
|
||||
|
||||
// Remove start menu shortcuts.
|
||||
if let Some(appdata) = env::var("PROGRAMDATA").ok() {
|
||||
file_util::wipe_folder(
|
||||
&PathBuf::from(&appdata)
|
||||
.join("Microsoft")
|
||||
.join("Windows")
|
||||
.join("Start Menu")
|
||||
.join("Programs")
|
||||
.join("Flash Center"),
|
||||
);
|
||||
}
|
||||
|
||||
// Remove Flash Center cache / user data.
|
||||
if let Some(local) = env::var("LOCALAPPDATA").ok() {
|
||||
file_util::wipe_folder(&PathBuf::from(&local).join("Flash_Center"));
|
||||
}
|
||||
|
||||
// Remove common start menu shortcuts.
|
||||
if let Some(appdata) = env::var("APPDATA").ok() {
|
||||
file_util::wipe_folder(
|
||||
&PathBuf::from(&appdata)
|
||||
.join("Microsoft")
|
||||
.join("Windows")
|
||||
.join("Start Menu")
|
||||
.join("Programs")
|
||||
.join("Flash Center"),
|
||||
);
|
||||
}
|
||||
|
||||
// Remove Desktop shortcuts.
|
||||
if let Some(desktop) = get_common_desktop() {
|
||||
file_util::delete_file(&desktop.join("Flash Center.lnk"));
|
||||
}
|
||||
if let Some(desktop) = dirs_desktop() {
|
||||
file_util::delete_file(&desktop.join("Flash Player.lnk"));
|
||||
}
|
||||
|
||||
// Remove Flash Player from Program Files.
|
||||
system_info::with_system_info(|si| {
|
||||
file_util::wipe_folder(&si.flash_program32_path);
|
||||
});
|
||||
|
||||
// Clean up temp folder spyware remnants.
|
||||
let temp = env::temp_dir();
|
||||
if let Ok(entries) = std::fs::read_dir(&temp) {
|
||||
for entry in entries.flatten() {
|
||||
let name = entry.file_name().to_string_lossy().to_string();
|
||||
if name.len() == 11 && name.ends_with(".tmp") && entry.path().is_dir() {
|
||||
let _ = file_util::wipe_folder(&entry.path());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Remove Quick Launch shortcuts from Internet Explorer.
|
||||
if let Ok(appdata) = env::var("APPDATA") {
|
||||
file_util::recursive_delete(
|
||||
&PathBuf::from(&appdata)
|
||||
.join("Microsoft")
|
||||
.join("Internet Explorer")
|
||||
.join("Quick Launch"),
|
||||
Some("Flash Center.lnk"),
|
||||
);
|
||||
}
|
||||
|
||||
// Remove Flash Player shortcut from the user's Start Menu root.
|
||||
if let Ok(appdata) = env::var("APPDATA") {
|
||||
file_util::delete_file(
|
||||
&PathBuf::from(appdata)
|
||||
.join("Microsoft")
|
||||
.join("Windows")
|
||||
.join("Start Menu")
|
||||
.join("Flash Player.lnk"),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
fn delete_flash_player() {
|
||||
system_info::with_system_info(|si| {
|
||||
// Remove Macromed folders.
|
||||
for dir in si.macromed_paths() {
|
||||
file_util::recursive_delete(dir, None);
|
||||
}
|
||||
|
||||
// Remove Flash Player control panel apps.
|
||||
for sys_dir in si.system_paths() {
|
||||
file_util::delete_file(&sys_dir.join("FlashPlayerApp.exe"));
|
||||
file_util::delete_file(&sys_dir.join("FlashPlayerCPLApp.cpl"));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
fn should_kill_conditional_process(name: &str, pid: u32) -> bool {
|
||||
if !CONDITIONAL_PROCESSES
|
||||
.iter()
|
||||
.any(|p| p.eq_ignore_ascii_case(name))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
let modules = process_utils::collect_modules(pid);
|
||||
modules.iter().any(|m| {
|
||||
let lower = m.to_lowercase();
|
||||
lower.starts_with("flash32")
|
||||
|| lower.starts_with("flash64")
|
||||
|| lower.starts_with("libpepflash")
|
||||
|| lower.starts_with("npswf")
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
fn stop_processes() {
|
||||
use windows_sys::Win32::Foundation::CloseHandle;
|
||||
use windows_sys::Win32::System::Threading::{
|
||||
OpenProcess, TerminateProcess, WaitForSingleObject, PROCESS_QUERY_INFORMATION,
|
||||
PROCESS_TERMINATE, PROCESS_VM_READ,
|
||||
};
|
||||
|
||||
// Enumerate all processes via the snapshot API.
|
||||
let mut pids = enumerate_processes();
|
||||
|
||||
// Sort by creation time (oldest first), matching C#'s .OrderBy(o => o.StartTime).
|
||||
pids.sort_by_key(|(pid, _)| get_process_creation_time(*pid));
|
||||
|
||||
for (pid, name) in &pids {
|
||||
let lower = name.to_lowercase();
|
||||
let should_kill = PROCESSES_TO_KILL.iter().any(|p| *p == lower)
|
||||
|| should_kill_conditional_process(&lower, *pid);
|
||||
|
||||
if !should_kill {
|
||||
continue;
|
||||
}
|
||||
|
||||
unsafe {
|
||||
let handle = OpenProcess(PROCESS_TERMINATE | PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, 0, *pid);
|
||||
if !handle.is_null() {
|
||||
TerminateProcess(handle, 1);
|
||||
WaitForSingleObject(handle, 5000);
|
||||
CloseHandle(handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
fn stop_processes() {
|
||||
// Process termination via Windows API not available on Unix.
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
fn get_process_creation_time(pid: u32) -> u64 {
|
||||
use windows_sys::Win32::Foundation::{CloseHandle, FILETIME};
|
||||
use windows_sys::Win32::System::Threading::{GetProcessTimes, OpenProcess, PROCESS_QUERY_INFORMATION};
|
||||
unsafe {
|
||||
let handle = OpenProcess(PROCESS_QUERY_INFORMATION, 0, pid);
|
||||
if handle.is_null() {
|
||||
return 0;
|
||||
}
|
||||
let mut create = FILETIME { dwLowDateTime: 0, dwHighDateTime: 0 };
|
||||
let mut exit_time = FILETIME { dwLowDateTime: 0, dwHighDateTime: 0 };
|
||||
let mut kernel_time = FILETIME { dwLowDateTime: 0, dwHighDateTime: 0 };
|
||||
let mut user_time = FILETIME { dwLowDateTime: 0, dwHighDateTime: 0 };
|
||||
GetProcessTimes(handle, &mut create, &mut exit_time, &mut kernel_time, &mut user_time);
|
||||
CloseHandle(handle);
|
||||
((create.dwHighDateTime as u64) << 32) | create.dwLowDateTime as u64
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
fn get_process_creation_time(_pid: u32) -> u64 {
|
||||
0
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
fn enumerate_processes() -> Vec<(u32, String)> {
|
||||
use windows_sys::Win32::System::ProcessStatus::{EnumProcesses, GetModuleBaseNameW};
|
||||
use windows_sys::Win32::System::Threading::{OpenProcess, PROCESS_QUERY_INFORMATION, PROCESS_VM_READ};
|
||||
use windows_sys::Win32::Foundation::CloseHandle;
|
||||
|
||||
let mut results = Vec::new();
|
||||
let mut pids = [0u32; 4096];
|
||||
let mut bytes_returned: u32 = 0;
|
||||
|
||||
unsafe {
|
||||
if EnumProcesses(
|
||||
pids.as_mut_ptr(),
|
||||
std::mem::size_of_val(&pids) as u32,
|
||||
&mut bytes_returned,
|
||||
) == 0
|
||||
{
|
||||
return results;
|
||||
}
|
||||
|
||||
let count = bytes_returned as usize / std::mem::size_of::<u32>();
|
||||
|
||||
for &pid in &pids[..count] {
|
||||
if pid == 0 {
|
||||
continue;
|
||||
}
|
||||
|
||||
let handle = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, 0, pid);
|
||||
if handle.is_null() {
|
||||
continue;
|
||||
}
|
||||
|
||||
let mut name_buf = [0u16; 260];
|
||||
let len = GetModuleBaseNameW(handle, std::ptr::null_mut(), name_buf.as_mut_ptr(), 260);
|
||||
CloseHandle(handle);
|
||||
|
||||
if len > 0 {
|
||||
let name = String::from_utf16_lossy(&name_buf[..len as usize]);
|
||||
// Strip .exe suffix for matching.
|
||||
let base = name.strip_suffix(".exe").unwrap_or(&name).to_string();
|
||||
results.push((pid, base));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
results
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
fn enumerate_processes() -> Vec<(u32, String)> {
|
||||
Vec::new()
|
||||
}
|
||||
|
||||
/// Perform the full uninstallation sequence.
|
||||
pub fn uninstall(form: &dyn ProgressCallback) -> Result<(), InstallError> {
|
||||
winapi_helpers::allow_modifications();
|
||||
|
||||
form.update_progress_label("Stopping Flash auto-updater task...", true);
|
||||
delete_task("Adobe Flash Player Updater");
|
||||
delete_task("Adobe Flash Player Updater");
|
||||
|
||||
form.update_progress_label("Stopping Flash auto-updater service...", true);
|
||||
delete_service("AdobeFlashPlayerUpdateSvc");
|
||||
|
||||
form.update_progress_label("Stopping Flash Center services...", true);
|
||||
delete_service("Flash Helper Service");
|
||||
form.tick_progress();
|
||||
delete_service("FlashCenterService");
|
||||
|
||||
form.update_progress_label("Exiting all browsers...", true);
|
||||
stop_processes();
|
||||
|
||||
form.update_progress_label("Cleaning up registry...", true);
|
||||
uninstall_registry()?;
|
||||
|
||||
form.update_progress_label("Removing Flash Center...", true);
|
||||
delete_flash_center();
|
||||
|
||||
form.update_progress_label("Removing Flash Player...", true);
|
||||
delete_flash_player();
|
||||
|
||||
native_host::uninstall_native_host(form);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// Helper to get common desktop path.
|
||||
fn get_common_desktop() -> Option<PathBuf> {
|
||||
env::var("PUBLIC")
|
||||
.ok()
|
||||
.map(|p| PathBuf::from(p).join("Desktop"))
|
||||
}
|
||||
|
||||
fn dirs_desktop() -> Option<PathBuf> {
|
||||
env::var("USERPROFILE")
|
||||
.ok()
|
||||
.map(|p| PathBuf::from(p).join("Desktop"))
|
||||
}
|
||||
@@ -1,149 +0,0 @@
|
||||
pub const FLASH_VERSION: &str = "34.0.0.330";
|
||||
pub const VERSION: &str = "34.0.0.330";
|
||||
|
||||
const API_HOST: &str = "api.github.com";
|
||||
const API_PATH: &str = "/repos/cleanflash/installer/releases/latest";
|
||||
const USER_AGENT: &str = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36";
|
||||
|
||||
pub struct VersionInfo {
|
||||
pub name: String,
|
||||
pub version: String,
|
||||
pub url: String,
|
||||
}
|
||||
|
||||
pub fn get_latest_version() -> Option<VersionInfo> {
|
||||
let json = fetch_https(API_HOST, API_PATH, USER_AGENT)?;
|
||||
let name = extract_json_string(&json, "name")?;
|
||||
let tag = extract_json_string(&json, "tag_name")?;
|
||||
let url = extract_json_string(&json, "html_url")?;
|
||||
|
||||
// Validate the URL to guard against a malicious/unexpected response.
|
||||
if !url.starts_with("https://") {
|
||||
return None;
|
||||
}
|
||||
|
||||
println!("Latest release: {} ({}) {}", name, tag, url);
|
||||
Some(VersionInfo { name, version: tag, url })
|
||||
}
|
||||
|
||||
/// Perform an HTTPS GET request using WinHTTP and return the response body as UTF-8.
|
||||
fn fetch_https(host: &str, path: &str, user_agent: &str) -> Option<String> {
|
||||
use windows_sys::Win32::Networking::WinHttp::{
|
||||
WinHttpCloseHandle, WinHttpConnect, WinHttpOpen, WinHttpOpenRequest,
|
||||
WinHttpQueryDataAvailable, WinHttpReadData, WinHttpReceiveResponse,
|
||||
WinHttpSendRequest, WINHTTP_FLAG_SECURE,
|
||||
};
|
||||
|
||||
let wide = |s: &str| -> Vec<u16> { s.encode_utf16().chain(std::iter::once(0)).collect() };
|
||||
|
||||
let agent_w = wide(user_agent);
|
||||
let host_w = wide(host);
|
||||
let path_w = wide(path);
|
||||
|
||||
unsafe {
|
||||
// Open session with system default proxy settings (WINHTTP_ACCESS_TYPE_DEFAULT_PROXY = 0).
|
||||
let session = WinHttpOpen(agent_w.as_ptr(), 0, std::ptr::null(), std::ptr::null(), 0);
|
||||
if session.is_null() {
|
||||
return None;
|
||||
}
|
||||
|
||||
let connection = WinHttpConnect(session, host_w.as_ptr(), 443, 0);
|
||||
if connection.is_null() {
|
||||
WinHttpCloseHandle(session);
|
||||
return None;
|
||||
}
|
||||
|
||||
// Open a GET request over HTTPS (null verb = GET, null version = HTTP/1.1).
|
||||
let request = WinHttpOpenRequest(
|
||||
connection,
|
||||
std::ptr::null(),
|
||||
path_w.as_ptr(),
|
||||
std::ptr::null(),
|
||||
std::ptr::null(),
|
||||
std::ptr::null(),
|
||||
WINHTTP_FLAG_SECURE,
|
||||
);
|
||||
if request.is_null() {
|
||||
WinHttpCloseHandle(connection);
|
||||
WinHttpCloseHandle(session);
|
||||
return None;
|
||||
}
|
||||
|
||||
if WinHttpSendRequest(request, std::ptr::null(), 0, std::ptr::null(), 0, 0, 0) == 0 {
|
||||
WinHttpCloseHandle(request);
|
||||
WinHttpCloseHandle(connection);
|
||||
WinHttpCloseHandle(session);
|
||||
return None;
|
||||
}
|
||||
|
||||
if WinHttpReceiveResponse(request, std::ptr::null_mut()) == 0 {
|
||||
WinHttpCloseHandle(request);
|
||||
WinHttpCloseHandle(connection);
|
||||
WinHttpCloseHandle(session);
|
||||
return None;
|
||||
}
|
||||
|
||||
let mut response: Vec<u8> = Vec::new();
|
||||
loop {
|
||||
let mut available: u32 = 0;
|
||||
if WinHttpQueryDataAvailable(request, &mut available) == 0 || available == 0 {
|
||||
break;
|
||||
}
|
||||
let offset = response.len();
|
||||
response.resize(offset + available as usize, 0);
|
||||
let mut read: u32 = 0;
|
||||
if WinHttpReadData(
|
||||
request,
|
||||
response[offset..].as_mut_ptr() as *mut _,
|
||||
available,
|
||||
&mut read,
|
||||
) == 0
|
||||
{
|
||||
break;
|
||||
}
|
||||
response.truncate(offset + read as usize);
|
||||
}
|
||||
|
||||
WinHttpCloseHandle(request);
|
||||
WinHttpCloseHandle(connection);
|
||||
WinHttpCloseHandle(session);
|
||||
|
||||
String::from_utf8(response).ok()
|
||||
}
|
||||
}
|
||||
|
||||
/// Extract a JSON string value for the given key from a JSON object.
|
||||
/// Handles the escape sequences that appear in GitHub API responses.
|
||||
fn extract_json_string(json: &str, key: &str) -> Option<String> {
|
||||
let search = format!("\"{}\"", key);
|
||||
let key_pos = json.find(&search)?;
|
||||
let rest = &json[key_pos + search.len()..];
|
||||
let colon = rest.find(':')?;
|
||||
let rest = rest[colon + 1..].trim_start();
|
||||
if !rest.starts_with('"') {
|
||||
return None;
|
||||
}
|
||||
let rest = &rest[1..];
|
||||
let mut result = String::new();
|
||||
let mut chars = rest.chars();
|
||||
loop {
|
||||
match chars.next()? {
|
||||
'"' => break,
|
||||
'\\' => match chars.next()? {
|
||||
'"' => result.push('"'),
|
||||
'\\' => result.push('\\'),
|
||||
'/' => result.push('/'),
|
||||
'n' => result.push('\n'),
|
||||
'r' => result.push('\r'),
|
||||
't' => result.push('\t'),
|
||||
c => {
|
||||
result.push('\\');
|
||||
result.push(c);
|
||||
}
|
||||
},
|
||||
c => result.push(c),
|
||||
}
|
||||
}
|
||||
Some(result)
|
||||
}
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
/// Enable SeRestorePrivilege and SeTakeOwnershipPrivilege for the current process.
|
||||
#[cfg(windows)]
|
||||
pub fn allow_modifications() {
|
||||
let _ = modify_privilege("SeRestorePrivilege\0", true);
|
||||
let _ = modify_privilege("SeTakeOwnershipPrivilege\0", true);
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
pub fn allow_modifications() {
|
||||
// No privilege modifications needed on Unix.
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
fn modify_privilege(name: &str, enable: bool) -> Result<(), ()> {
|
||||
use windows_sys::Win32::Foundation::CloseHandle;
|
||||
use windows_sys::Win32::Security::{
|
||||
AdjustTokenPrivileges, LookupPrivilegeValueW, LUID_AND_ATTRIBUTES,
|
||||
SE_PRIVILEGE_ENABLED, TOKEN_ADJUST_PRIVILEGES, TOKEN_PRIVILEGES, TOKEN_QUERY,
|
||||
};
|
||||
use windows_sys::Win32::System::Threading::{GetCurrentProcess, OpenProcessToken};
|
||||
|
||||
unsafe {
|
||||
let mut token: *mut std::ffi::c_void = std::ptr::null_mut();
|
||||
if OpenProcessToken(
|
||||
GetCurrentProcess(),
|
||||
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,
|
||||
&mut token,
|
||||
) == 0
|
||||
{
|
||||
return Err(());
|
||||
}
|
||||
|
||||
let wide_name: Vec<u16> = name.encode_utf16().collect();
|
||||
let mut luid = std::mem::zeroed();
|
||||
if LookupPrivilegeValueW(std::ptr::null(), wide_name.as_ptr(), &mut luid) == 0 {
|
||||
CloseHandle(token);
|
||||
return Err(());
|
||||
}
|
||||
|
||||
let mut tp = TOKEN_PRIVILEGES {
|
||||
PrivilegeCount: 1,
|
||||
Privileges: [LUID_AND_ATTRIBUTES {
|
||||
Luid: luid,
|
||||
Attributes: if enable { SE_PRIVILEGE_ENABLED } else { 0 },
|
||||
}],
|
||||
};
|
||||
|
||||
let result = AdjustTokenPrivileges(
|
||||
token,
|
||||
0,
|
||||
&mut tp,
|
||||
std::mem::size_of::<TOKEN_PRIVILEGES>() as u32,
|
||||
std::ptr::null_mut(),
|
||||
std::ptr::null_mut(),
|
||||
);
|
||||
|
||||
CloseHandle(token);
|
||||
|
||||
if result == 0 {
|
||||
Err(())
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
[package]
|
||||
name = "clean_flash_installer"
|
||||
version = "34.0.0"
|
||||
edition = "2021"
|
||||
authors = ["FlashPatch Team"]
|
||||
|
||||
[dependencies]
|
||||
clean_flash_common = { path = "../clean_flash_common" }
|
||||
clean_flash_ui = { path = "../clean_flash_ui" }
|
||||
minifb = { workspace = true }
|
||||
windows-sys = { workspace = true }
|
||||
sevenz-rust2 = { workspace = true }
|
||||
|
||||
[build-dependencies]
|
||||
winresource = "0.1"
|
||||
@@ -1,43 +0,0 @@
|
||||
fn main() {
|
||||
// Set application icon from .ico resource (if present).
|
||||
if cfg!(target_os = "windows") {
|
||||
let mut res = winresource::WindowsResource::new();
|
||||
// Attempt to set icon; ignore if file doesn't exist.
|
||||
if std::path::Path::new("../../resources/icon.ico").exists() {
|
||||
res.set_icon("../../resources/icon.ico");
|
||||
}
|
||||
res.set("ProductName", "Clean Flash Player Installer");
|
||||
res.set("FileDescription", "Clean Flash Player Installer");
|
||||
res.set("ProductVersion", "34.0.0.330");
|
||||
res.set("CompanyName", "FlashPatch Team");
|
||||
res.set("LegalCopyright", "FlashPatch Team");
|
||||
res.set_manifest(r#"<?xml version="1.0" encoding="utf-8"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<assemblyIdentity version="1.0.0.0" name="CleanFlashInstaller.app"/>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
|
||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
|
||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
|
||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
|
||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
|
||||
</application>
|
||||
</compatibility>
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
|
||||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
</assembly>
|
||||
"#);
|
||||
let _ = res.compile();
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
/// Bitflag-based install options, mirroring the C# InstallFlags class.
|
||||
|
||||
pub const NONE: u32 = 0;
|
||||
pub const PEPPER: u32 = 1 << 0;
|
||||
pub const NETSCAPE: u32 = 1 << 1;
|
||||
pub const ACTIVEX: u32 = 1 << 2;
|
||||
pub const PLAYER: u32 = 1 << 3;
|
||||
pub const PLAYER_START_MENU: u32 = 1 << 4;
|
||||
pub const PLAYER_DESKTOP: u32 = 1 << 5;
|
||||
pub const X64: u32 = 1 << 6;
|
||||
pub const DEBUG: u32 = 1 << 7;
|
||||
pub const NATIVE_HOST: u32 = 1 << 8;
|
||||
|
||||
const UNINSTALL_TICKS: u32 = 10;
|
||||
const INSTALL_GENERAL_TICKS: u32 = 5;
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct InstallFlags {
|
||||
value: u32,
|
||||
}
|
||||
|
||||
impl InstallFlags {
|
||||
pub fn new() -> Self {
|
||||
Self { value: 0 }
|
||||
}
|
||||
|
||||
pub fn from(value: u32) -> Self {
|
||||
Self { value }
|
||||
}
|
||||
|
||||
pub fn get_value(self) -> u32 {
|
||||
self.value
|
||||
}
|
||||
|
||||
pub fn is_set(self, flag: u32) -> bool {
|
||||
(self.value & flag) == flag
|
||||
}
|
||||
|
||||
pub fn is_none_set(self) -> bool {
|
||||
self.value == 0
|
||||
}
|
||||
|
||||
pub fn set_flag(&mut self, flag: u32) {
|
||||
self.value |= flag;
|
||||
}
|
||||
|
||||
pub fn set_conditionally(&mut self, condition: bool, flag: u32) {
|
||||
if condition {
|
||||
self.set_flag(flag);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_ticks(self) -> u32 {
|
||||
let is_64bit = cfg!(target_pointer_width = "64")
|
||||
|| std::env::var("PROCESSOR_ARCHITEW6432").is_ok();
|
||||
|
||||
let mut ticks = (if self.is_set(PEPPER) { 1 } else { 0 })
|
||||
+ (if self.is_set(NETSCAPE) { 1 } else { 0 })
|
||||
+ (if self.is_set(ACTIVEX) { 2 } else { 0 });
|
||||
|
||||
if is_64bit {
|
||||
ticks *= 2;
|
||||
}
|
||||
|
||||
if self.is_set(PLAYER) {
|
||||
ticks += 1;
|
||||
}
|
||||
|
||||
if self.is_set(NATIVE_HOST) {
|
||||
ticks += 1;
|
||||
}
|
||||
|
||||
ticks += UNINSTALL_TICKS;
|
||||
ticks += INSTALL_GENERAL_TICKS;
|
||||
ticks
|
||||
}
|
||||
}
|
||||
@@ -1,722 +0,0 @@
|
||||
use crate::install_flags::{self, InstallFlags};
|
||||
use crate::installer;
|
||||
use clean_flash_common::{uninstaller, redirection, update_checker, ProgressCallback};
|
||||
use clean_flash_ui::font::FontManager;
|
||||
use clean_flash_ui::renderer::Renderer;
|
||||
use clean_flash_ui::widgets::button::GradientButton;
|
||||
use clean_flash_ui::widgets::checkbox::ImageCheckBox;
|
||||
use clean_flash_ui::widgets::label::Label;
|
||||
use clean_flash_ui::widgets::progress_bar::ProgressBar;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
// Window dimensions matching the C# form.
|
||||
pub const WIDTH: usize = 712;
|
||||
pub const HEIGHT: usize = 329;
|
||||
const BG_COLOR: u32 = Renderer::rgb(50, 51, 51);
|
||||
const FG_COLOR: u32 = Renderer::rgb(245, 245, 245);
|
||||
|
||||
const PANEL_X: i32 = 90;
|
||||
const PANEL_Y: i32 = 162;
|
||||
|
||||
const DISCLAIMER_TEXT: &str = "I am aware that Adobe Flash Player is no longer supported, nor provided by Adobe Inc.\n\
|
||||
Clean Flash Player is a third-party version of Flash Player built from the latest Flash Player version with adware removed.\n\n\
|
||||
Adobe is not required by any means to provide support for this version of Flash Player.";
|
||||
|
||||
const COMPLETE_INSTALL_TEXT: &str = "Clean Flash Player has been successfully installed!\n\
|
||||
Don't forget, Flash Player is no longer compatible with new browsers.\n\n\
|
||||
For browser recommendations and Flash Player updates, check out Clean Flash Player's website!";
|
||||
|
||||
const COMPLETE_INSTALL_WITH_EXTENSION_TEXT: &str = "Clean Flash Player has been successfully installed!\n\n\
|
||||
To use Flash in modern browsers, install the Clean Flash Player extension into your browser.\n\n\
|
||||
For Flash Player updates, check out Clean Flash Player's website!";
|
||||
|
||||
const COMPLETE_UNINSTALL_TEXT: &str = "\nAll versions of Flash Player have been successfully uninstalled.\n\n\
|
||||
If you ever change your mind, check out Clean Flash Player's website!";
|
||||
|
||||
/// Which panel is currently shown in the wizard.
|
||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||
pub enum Panel {
|
||||
Disclaimer,
|
||||
Choice,
|
||||
PlayerChoice,
|
||||
DebugChoice,
|
||||
BeforeInstall,
|
||||
Install,
|
||||
Complete,
|
||||
Failure,
|
||||
}
|
||||
|
||||
/// Shared progress state set by the background install thread.
|
||||
pub struct ProgressState {
|
||||
pub label: String,
|
||||
pub value: i32,
|
||||
pub done: bool,
|
||||
pub error: Option<String>,
|
||||
}
|
||||
|
||||
/// Full application state for the installer form.
|
||||
pub struct InstallForm {
|
||||
scale: f32,
|
||||
pub panel: Panel,
|
||||
// Header
|
||||
pub title_text: String,
|
||||
pub subtitle_text: String,
|
||||
flash_logo_cache: clean_flash_ui::flash_logo::FlashLogoCache,
|
||||
// Navigation buttons
|
||||
pub prev_button: GradientButton,
|
||||
pub next_button: GradientButton,
|
||||
// Disclaimer panel
|
||||
pub disclaimer_label: Label,
|
||||
pub disclaimer_box: ImageCheckBox,
|
||||
// Choice panel (browser plugins)
|
||||
pub browser_ask_label: Label,
|
||||
pub native_host_box: ImageCheckBox,
|
||||
pub native_host_label: Label,
|
||||
pub pepper_box: ImageCheckBox,
|
||||
pub pepper_label: Label,
|
||||
pub netscape_box: ImageCheckBox,
|
||||
pub netscape_label: Label,
|
||||
pub activex_box: ImageCheckBox,
|
||||
pub activex_label: Label,
|
||||
// Player choice panel
|
||||
pub player_ask_label: Label,
|
||||
pub player_box: ImageCheckBox,
|
||||
pub player_label: Label,
|
||||
pub player_desktop_box: ImageCheckBox,
|
||||
pub player_desktop_label: Label,
|
||||
pub player_start_menu_box: ImageCheckBox,
|
||||
pub player_start_menu_label: Label,
|
||||
// Debug choice panel
|
||||
pub debug_ask_label: Label,
|
||||
pub debug_button: GradientButton,
|
||||
pub debug_chosen: bool,
|
||||
// Before install panel
|
||||
pub before_install_label: Label,
|
||||
// Install panel
|
||||
pub install_header_label: Label,
|
||||
pub progress_label: Label,
|
||||
pub progress_bar: ProgressBar,
|
||||
// Complete panel
|
||||
pub complete_label: Label,
|
||||
// Failure panel
|
||||
pub failure_text_label: Label,
|
||||
pub failure_detail: String,
|
||||
pub copy_error_button: GradientButton,
|
||||
// Shared progress state (for background thread communication).
|
||||
pub progress_state: Arc<Mutex<ProgressState>>,
|
||||
// Fonts loaded once.
|
||||
pub fonts: FontManager,
|
||||
// Mouse tracking
|
||||
prev_mouse_down: bool,
|
||||
}
|
||||
|
||||
impl InstallForm {
|
||||
pub fn new(scale: f32) -> Self {
|
||||
// Integer coordinate scaler.
|
||||
let s = |v: i32| (v as f32 * scale).round() as i32;
|
||||
// Font size / spacing scaler.
|
||||
let sf = |v: f32| v * scale;
|
||||
// Scaled label helper: font_size is the logical total (base+offset).
|
||||
let lbl = |x: i32, y: i32, text: &str, size: f32| {
|
||||
let mut l = Label::new(s(x), s(y), text, sf(size));
|
||||
l.line_spacing = sf(2.0);
|
||||
l.max_width = sf((WIDTH as i32 - x - 60) as f32);
|
||||
l
|
||||
};
|
||||
// Scaled button helper.
|
||||
let btn = |x: i32, y: i32, w: i32, h: i32, text: &str| GradientButton {
|
||||
font_size: sf(13.0),
|
||||
..GradientButton::new(s(x), s(y), s(w), s(h), text)
|
||||
};
|
||||
// Scaled checkbox helper.
|
||||
let chk = |x: i32, y: i32| ImageCheckBox::with_size(s(x), s(y), s(21));
|
||||
let version = update_checker::FLASH_VERSION;
|
||||
let title_text = "Clean Flash Player".to_string();
|
||||
let subtitle_text = format!("built from version {} (China)", version);
|
||||
|
||||
let fonts = FontManager::new();
|
||||
|
||||
let mut form = Self {
|
||||
scale,
|
||||
panel: Panel::Disclaimer,
|
||||
title_text,
|
||||
subtitle_text,
|
||||
flash_logo_cache: clean_flash_ui::flash_logo::FlashLogoCache::new(),
|
||||
prev_button: btn(90, 286, 138, 31, "QUIT"),
|
||||
next_button: btn(497, 286, 138, 31, "AGREE"),
|
||||
// Disclaimer panel
|
||||
disclaimer_label: lbl(PANEL_X + 25, PANEL_Y, DISCLAIMER_TEXT, 15.0),
|
||||
disclaimer_box: chk(PANEL_X, PANEL_Y),
|
||||
// Choice panel
|
||||
browser_ask_label: lbl(PANEL_X - 2, PANEL_Y + 2, "Which browser plugins would you like to install?", 15.0),
|
||||
native_host_box: chk(PANEL_X, PANEL_Y + 27),
|
||||
native_host_label: lbl(PANEL_X + 24, PANEL_Y + 27, "Modern Browsers (MV3)\n(Chrome/Firefox/Edge)", 15.0),
|
||||
pepper_box: chk(PANEL_X, PANEL_Y + 73),
|
||||
pepper_label: lbl(PANEL_X + 24, PANEL_Y + 73, "Pepper API (PPAPI)\n(Chrome/Opera/Brave)", 15.0),
|
||||
netscape_box: chk(PANEL_X + 186, PANEL_Y + 73),
|
||||
netscape_label: lbl(PANEL_X + 210, PANEL_Y + 73, "Netscape API (NPAPI)\n(Firefox/ESR/Waterfox)", 15.0),
|
||||
activex_box: chk(PANEL_X + 365, PANEL_Y + 73),
|
||||
activex_label: lbl(PANEL_X + 389, PANEL_Y + 73, "ActiveX (OCX)\n(IE/Embedded/Desktop)", 15.0),
|
||||
// Player choice panel
|
||||
player_ask_label: lbl(PANEL_X - 2, PANEL_Y + 2, "Would you like to install the standalone Flash Player?", 15.0),
|
||||
player_box: chk(PANEL_X, PANEL_Y + 47),
|
||||
player_label: lbl(PANEL_X + 24, PANEL_Y + 47, "Install Standalone\nFlash Player", 15.0),
|
||||
player_desktop_box: chk(PANEL_X + 186, PANEL_Y + 47),
|
||||
player_desktop_label: lbl(PANEL_X + 210, PANEL_Y + 47, "Create Shortcuts\non Desktop", 15.0),
|
||||
player_start_menu_box: chk(PANEL_X + 365, PANEL_Y + 47),
|
||||
player_start_menu_label: lbl(PANEL_X + 389, PANEL_Y + 47, "Create Shortcuts\nin Start Menu", 15.0),
|
||||
// Debug choice panel
|
||||
debug_ask_label: lbl(
|
||||
PANEL_X - 2,
|
||||
PANEL_Y + 2,
|
||||
"Would you like to install the debug version of Clean Flash Player?\n\
|
||||
You should only choose the debug version if you are planning to create Flash applications.\n\
|
||||
If you are not sure, simply press NEXT.",
|
||||
15.0,
|
||||
),
|
||||
debug_button: btn(PANEL_X + 186, PANEL_Y + 65, 176, 31, "INSTALL DEBUG VERSION"),
|
||||
debug_chosen: false,
|
||||
// Before install panel
|
||||
before_install_label: lbl(PANEL_X + 3, PANEL_Y + 2, "", 15.0),
|
||||
// Install panel
|
||||
install_header_label: lbl(PANEL_X + 3, PANEL_Y, "Installation in progress...", 15.0),
|
||||
progress_label: lbl(PANEL_X + 46, PANEL_Y + 30, "Preparing...", 15.0),
|
||||
progress_bar: ProgressBar::new(s(PANEL_X + 49), s(PANEL_Y + 58), s(451), s(23)),
|
||||
// Complete panel
|
||||
complete_label: lbl(PANEL_X, PANEL_Y, "", 15.0),
|
||||
// Failure panel
|
||||
failure_text_label: lbl(
|
||||
PANEL_X + 3,
|
||||
PANEL_Y + 2,
|
||||
"Oops! The installation process has encountered an unexpected problem.\n\
|
||||
The following details could be useful. Press the Retry button to try again.",
|
||||
15.0,
|
||||
),
|
||||
failure_detail: String::new(),
|
||||
copy_error_button: btn(PANEL_X + 441, PANEL_Y + 58, 104, 31, "COPY"),
|
||||
progress_state: Arc::new(Mutex::new(ProgressState {
|
||||
label: "Preparing...".into(),
|
||||
value: 0,
|
||||
done: false,
|
||||
error: None,
|
||||
})),
|
||||
fonts,
|
||||
prev_mouse_down: false,
|
||||
};
|
||||
|
||||
// Modern browser support should be the default choice.
|
||||
form.native_host_box.checked = true;
|
||||
|
||||
// On non-Windows platforms, disable legacy browser plugins and player options.
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
{
|
||||
form.pepper_box.checked = false;
|
||||
form.pepper_box.enabled = false;
|
||||
form.netscape_box.checked = false;
|
||||
form.netscape_box.enabled = false;
|
||||
form.activex_box.checked = false;
|
||||
form.activex_box.enabled = false;
|
||||
form.player_box.checked = false;
|
||||
form.player_box.enabled = false;
|
||||
form.player_desktop_box.checked = false;
|
||||
form.player_desktop_box.enabled = false;
|
||||
form.player_start_menu_box.checked = false;
|
||||
form.player_start_menu_box.enabled = false;
|
||||
}
|
||||
|
||||
form
|
||||
}
|
||||
|
||||
/// Scale a logical integer coordinate to physical pixels.
|
||||
fn s(&self, v: i32) -> i32 { (v as f32 * self.scale).round() as i32 }
|
||||
/// Scale a logical float value to physical pixels.
|
||||
fn sf(&self, v: f32) -> f32 { v * self.scale }
|
||||
|
||||
/// Called each frame: handle input, update state, draw.
|
||||
pub fn update_and_draw(
|
||||
&mut self,
|
||||
renderer: &mut Renderer,
|
||||
mx: i32,
|
||||
my: i32,
|
||||
mouse_down: bool,
|
||||
) {
|
||||
let mouse_released = self.prev_mouse_down && !mouse_down;
|
||||
self.prev_mouse_down = mouse_down;
|
||||
|
||||
// Update navigation button hover states.
|
||||
self.prev_button.update(mx, my, mouse_down);
|
||||
self.next_button.update(mx, my, mouse_down);
|
||||
|
||||
// Handle click events.
|
||||
self.handle_input(mx, my, mouse_released);
|
||||
|
||||
// Poll progress state from background thread if installing.
|
||||
if self.panel == Panel::Install {
|
||||
self.poll_progress();
|
||||
}
|
||||
|
||||
// ----- Draw -----
|
||||
renderer.clear(BG_COLOR);
|
||||
|
||||
// Header: flash logo (cached software render).
|
||||
self.flash_logo_cache.draw(
|
||||
renderer, self.s(90), self.s(36), self.s(109), self.s(107),
|
||||
);
|
||||
|
||||
// Title.
|
||||
self.fonts.draw_text(
|
||||
renderer,
|
||||
self.s(233),
|
||||
self.s(54),
|
||||
&self.title_text,
|
||||
self.sf(32.0),
|
||||
FG_COLOR,
|
||||
);
|
||||
|
||||
// Subtitle.
|
||||
self.fonts.draw_text(
|
||||
renderer,
|
||||
self.s(280),
|
||||
self.s(99),
|
||||
&self.subtitle_text,
|
||||
self.sf(17.0),
|
||||
FG_COLOR,
|
||||
);
|
||||
|
||||
// Separator line.
|
||||
renderer.fill_rect(0, self.s(270), renderer.width as i32, self.s(1).max(1), Renderer::rgb(105, 105, 105));
|
||||
|
||||
// Draw current panel.
|
||||
match self.panel {
|
||||
Panel::Disclaimer => self.draw_disclaimer(renderer),
|
||||
Panel::Choice => self.draw_choice(renderer),
|
||||
Panel::PlayerChoice => self.draw_player_choice(renderer),
|
||||
Panel::DebugChoice => self.draw_debug_choice(renderer),
|
||||
Panel::BeforeInstall => self.draw_before_install(renderer),
|
||||
Panel::Install => self.draw_install(renderer),
|
||||
Panel::Complete => self.draw_complete(renderer),
|
||||
Panel::Failure => self.draw_failure(renderer),
|
||||
}
|
||||
|
||||
// Navigation buttons.
|
||||
self.prev_button.draw(renderer, &self.fonts);
|
||||
self.next_button.draw(renderer, &self.fonts);
|
||||
}
|
||||
|
||||
fn handle_input(&mut self, mx: i32, my: i32, mouse_released: bool) {
|
||||
// Navigation button clicks.
|
||||
if self.prev_button.clicked(mx, my, mouse_released) {
|
||||
self.on_prev_clicked();
|
||||
return;
|
||||
}
|
||||
if self.next_button.clicked(mx, my, mouse_released) {
|
||||
self.on_next_clicked();
|
||||
return;
|
||||
}
|
||||
|
||||
// Panel-specific input.
|
||||
match self.panel {
|
||||
Panel::Disclaimer => {
|
||||
let toggled = self.disclaimer_box.toggle_if_clicked(mx, my, mouse_released);
|
||||
if toggled || self.disclaimer_label.clicked(mx, my, mouse_released, &self.fonts) {
|
||||
if !toggled {
|
||||
self.disclaimer_box.checked = !self.disclaimer_box.checked;
|
||||
}
|
||||
self.next_button.enabled = self.disclaimer_box.checked;
|
||||
}
|
||||
}
|
||||
Panel::Choice => {
|
||||
self.native_host_box.toggle_if_clicked(mx, my, mouse_released);
|
||||
self.pepper_box.toggle_if_clicked(mx, my, mouse_released);
|
||||
self.netscape_box.toggle_if_clicked(mx, my, mouse_released);
|
||||
self.activex_box.toggle_if_clicked(mx, my, mouse_released);
|
||||
if self.native_host_box.enabled
|
||||
&& self
|
||||
.native_host_label
|
||||
.clicked(mx, my, mouse_released, &self.fonts)
|
||||
{
|
||||
self.native_host_box.checked = !self.native_host_box.checked;
|
||||
}
|
||||
if self.pepper_box.enabled
|
||||
&& self.pepper_label.clicked(mx, my, mouse_released, &self.fonts)
|
||||
{
|
||||
self.pepper_box.checked = !self.pepper_box.checked;
|
||||
}
|
||||
if self.netscape_box.enabled
|
||||
&& self.netscape_label.clicked(mx, my, mouse_released, &self.fonts)
|
||||
{
|
||||
self.netscape_box.checked = !self.netscape_box.checked;
|
||||
}
|
||||
if self.activex_box.enabled
|
||||
&& self.activex_label.clicked(mx, my, mouse_released, &self.fonts)
|
||||
{
|
||||
self.activex_box.checked = !self.activex_box.checked;
|
||||
}
|
||||
}
|
||||
Panel::PlayerChoice => {
|
||||
self.player_box.toggle_if_clicked(mx, my, mouse_released);
|
||||
self.player_desktop_box.toggle_if_clicked(mx, my, mouse_released);
|
||||
self.player_start_menu_box.toggle_if_clicked(mx, my, mouse_released);
|
||||
if self.player_box.enabled
|
||||
&& self.player_label.clicked(mx, my, mouse_released, &self.fonts)
|
||||
{
|
||||
self.player_box.checked = !self.player_box.checked;
|
||||
}
|
||||
if self.player_desktop_box.enabled
|
||||
&& self
|
||||
.player_desktop_label
|
||||
.clicked(mx, my, mouse_released, &self.fonts)
|
||||
&& self.player_box.checked
|
||||
{
|
||||
self.player_desktop_box.checked = !self.player_desktop_box.checked;
|
||||
}
|
||||
if self.player_start_menu_box.enabled
|
||||
&& self
|
||||
.player_start_menu_label
|
||||
.clicked(mx, my, mouse_released, &self.fonts)
|
||||
&& self.player_box.checked
|
||||
{
|
||||
self.player_start_menu_box.checked = !self.player_start_menu_box.checked;
|
||||
}
|
||||
// Disable sub-options when player unchecked.
|
||||
self.player_desktop_box.enabled = self.player_box.checked;
|
||||
self.player_start_menu_box.enabled = self.player_box.checked;
|
||||
if !self.player_box.checked {
|
||||
self.player_desktop_box.checked = false;
|
||||
self.player_start_menu_box.checked = false;
|
||||
}
|
||||
}
|
||||
Panel::DebugChoice => {
|
||||
if self.debug_button.clicked(mx, my, mouse_released) {
|
||||
// In the C# app this shows a MessageBox. For the Rust port we toggle directly.
|
||||
self.debug_chosen = true;
|
||||
self.open_before_install();
|
||||
}
|
||||
self.debug_button.update(mx, my, self.prev_mouse_down);
|
||||
}
|
||||
Panel::Failure => {
|
||||
self.copy_error_button.update(mx, my, self.prev_mouse_down);
|
||||
if self.copy_error_button.clicked(mx, my, mouse_released) {
|
||||
// Copy error to clipboard via clip.exe.
|
||||
let _ = std::process::Command::new("cmd")
|
||||
.args(["/C", &format!("echo {} | clip", self.failure_detail)])
|
||||
.output();
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn on_prev_clicked(&mut self) {
|
||||
match self.panel {
|
||||
Panel::Disclaimer | Panel::Complete | Panel::Failure => {
|
||||
std::process::exit(0);
|
||||
}
|
||||
Panel::Choice => self.open_disclaimer(),
|
||||
Panel::PlayerChoice => self.open_choice(),
|
||||
Panel::DebugChoice => self.open_player_choice(),
|
||||
Panel::BeforeInstall => {
|
||||
if cfg!(target_os = "windows") {
|
||||
self.open_debug_choice();
|
||||
} else {
|
||||
self.open_choice();
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn on_next_clicked(&mut self) {
|
||||
match self.panel {
|
||||
Panel::Disclaimer => self.open_choice(),
|
||||
Panel::Choice => {
|
||||
if cfg!(target_os = "windows") {
|
||||
self.open_player_choice();
|
||||
} else {
|
||||
self.open_before_install();
|
||||
}
|
||||
}
|
||||
Panel::PlayerChoice => self.open_debug_choice(),
|
||||
Panel::DebugChoice => self.open_before_install(),
|
||||
Panel::BeforeInstall | Panel::Failure => self.open_install(),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn open_disclaimer(&mut self) {
|
||||
self.panel = Panel::Disclaimer;
|
||||
self.prev_button.text = "QUIT".into();
|
||||
self.next_button.text = "AGREE".into();
|
||||
self.next_button.visible = true;
|
||||
self.next_button.enabled = self.disclaimer_box.checked;
|
||||
self.prev_button.enabled = true;
|
||||
}
|
||||
|
||||
fn open_choice(&mut self) {
|
||||
self.panel = Panel::Choice;
|
||||
self.prev_button.text = "BACK".into();
|
||||
self.next_button.text = "NEXT".into();
|
||||
self.next_button.visible = true;
|
||||
self.next_button.enabled = true;
|
||||
self.prev_button.enabled = true;
|
||||
}
|
||||
|
||||
fn open_player_choice(&mut self) {
|
||||
self.panel = Panel::PlayerChoice;
|
||||
self.prev_button.text = "BACK".into();
|
||||
self.next_button.text = "NEXT".into();
|
||||
self.next_button.visible = true;
|
||||
self.next_button.enabled = true;
|
||||
self.prev_button.enabled = true;
|
||||
}
|
||||
|
||||
fn open_debug_choice(&mut self) {
|
||||
self.panel = Panel::DebugChoice;
|
||||
self.debug_chosen = false;
|
||||
self.prev_button.text = "BACK".into();
|
||||
self.next_button.text = "NEXT".into();
|
||||
self.next_button.visible = true;
|
||||
self.next_button.enabled = true;
|
||||
self.prev_button.enabled = true;
|
||||
}
|
||||
|
||||
fn open_before_install(&mut self) {
|
||||
self.panel = Panel::BeforeInstall;
|
||||
self.prev_button.text = "BACK".into();
|
||||
self.prev_button.enabled = true;
|
||||
|
||||
let has_plugins =
|
||||
self.native_host_box.checked || self.pepper_box.checked || self.netscape_box.checked || self.activex_box.checked || self.player_box.checked;
|
||||
|
||||
if has_plugins {
|
||||
let mut browsers = Vec::new();
|
||||
if self.native_host_box.checked {
|
||||
browsers.push("Modern Browsers (via extension)");
|
||||
}
|
||||
if self.pepper_box.checked {
|
||||
browsers.push("Google Chrome");
|
||||
}
|
||||
if self.netscape_box.checked {
|
||||
browsers.push("Mozilla Firefox");
|
||||
}
|
||||
if self.activex_box.checked {
|
||||
browsers.push("Internet Explorer");
|
||||
}
|
||||
|
||||
let browser_str = join_with_and(&browsers);
|
||||
self.before_install_label.text = format!(
|
||||
"You are about to install Clean Flash Player.\n\
|
||||
Please close any browser windows running Flash content before you continue.\n\n\
|
||||
The installer will close all browser windows running Flash, uninstall previous versions of Flash Player and Flash Center, and install Flash for {}.",
|
||||
browser_str
|
||||
);
|
||||
self.next_button.text = "INSTALL".into();
|
||||
} else {
|
||||
self.before_install_label.text =
|
||||
"You are about to uninstall Clean Flash Player.\n\
|
||||
Please close any browser windows running Flash content before you continue.\n\n\
|
||||
The installer will completely remove all versions of Flash Player from this computer, including Clean Flash Player and older versions of Adobe Flash Player."
|
||||
.to_string();
|
||||
self.next_button.text = "UNINSTALL".into();
|
||||
}
|
||||
self.next_button.visible = true;
|
||||
self.next_button.enabled = true;
|
||||
}
|
||||
|
||||
fn open_install(&mut self) {
|
||||
self.panel = Panel::Install;
|
||||
self.prev_button.enabled = false;
|
||||
self.next_button.visible = false;
|
||||
|
||||
let mut flags = InstallFlags::new();
|
||||
flags.set_conditionally(self.native_host_box.checked, install_flags::NATIVE_HOST);
|
||||
flags.set_conditionally(self.pepper_box.checked, install_flags::PEPPER);
|
||||
flags.set_conditionally(self.netscape_box.checked, install_flags::NETSCAPE);
|
||||
flags.set_conditionally(self.activex_box.checked, install_flags::ACTIVEX);
|
||||
flags.set_conditionally(self.player_box.checked, install_flags::PLAYER);
|
||||
flags.set_conditionally(self.player_desktop_box.checked, install_flags::PLAYER_DESKTOP);
|
||||
flags.set_conditionally(
|
||||
self.player_start_menu_box.checked,
|
||||
install_flags::PLAYER_START_MENU,
|
||||
);
|
||||
flags.set_conditionally(self.debug_chosen, install_flags::DEBUG);
|
||||
|
||||
self.progress_bar.maximum = flags.get_ticks() as i32;
|
||||
self.progress_bar.value = 0;
|
||||
|
||||
// Reset shared state.
|
||||
{
|
||||
let mut state = self.progress_state.lock().unwrap();
|
||||
state.label = "Preparing...".into();
|
||||
state.value = 0;
|
||||
state.done = false;
|
||||
state.error = None;
|
||||
}
|
||||
|
||||
// Spawn background thread.
|
||||
let progress = Arc::clone(&self.progress_state);
|
||||
std::thread::spawn(move || {
|
||||
let callback = ThreadProgressCallback {
|
||||
state: Arc::clone(&progress),
|
||||
};
|
||||
|
||||
let redir = redirection::disable_redirection();
|
||||
|
||||
let result = (|| -> Result<(), clean_flash_common::InstallError> {
|
||||
uninstaller::uninstall(&callback)?;
|
||||
installer::install(&callback, &mut flags)?;
|
||||
Ok(())
|
||||
})();
|
||||
|
||||
redirection::enable_redirection(redir);
|
||||
|
||||
let mut state = progress.lock().unwrap();
|
||||
if let Err(e) = result {
|
||||
state.error = Some(e.to_string());
|
||||
}
|
||||
state.done = true;
|
||||
});
|
||||
}
|
||||
|
||||
fn poll_progress(&mut self) {
|
||||
let state = self.progress_state.lock().unwrap();
|
||||
self.progress_label.text = state.label.clone();
|
||||
self.progress_bar.value = state.value;
|
||||
|
||||
if state.done {
|
||||
if let Some(ref err) = state.error {
|
||||
self.failure_detail = err.clone();
|
||||
drop(state);
|
||||
self.open_failure();
|
||||
} else {
|
||||
drop(state);
|
||||
self.open_complete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn open_complete(&mut self) {
|
||||
self.panel = Panel::Complete;
|
||||
self.prev_button.text = "QUIT".into();
|
||||
self.prev_button.enabled = true;
|
||||
self.next_button.visible = false;
|
||||
|
||||
if self.native_host_box.checked {
|
||||
self.complete_label.text = COMPLETE_INSTALL_WITH_EXTENSION_TEXT.to_string();
|
||||
} else if self.pepper_box.checked || self.netscape_box.checked || self.activex_box.checked {
|
||||
self.complete_label.text = COMPLETE_INSTALL_TEXT.to_string();
|
||||
} else {
|
||||
self.complete_label.text = COMPLETE_UNINSTALL_TEXT.to_string();
|
||||
}
|
||||
}
|
||||
|
||||
fn open_failure(&mut self) {
|
||||
self.panel = Panel::Failure;
|
||||
self.prev_button.text = "QUIT".into();
|
||||
self.prev_button.enabled = true;
|
||||
self.next_button.text = "RETRY".into();
|
||||
self.next_button.visible = true;
|
||||
}
|
||||
|
||||
// ---- Drawing helpers ----
|
||||
|
||||
fn draw_disclaimer(&self, r: &mut Renderer) {
|
||||
self.disclaimer_box.draw(r);
|
||||
self.disclaimer_label.draw(r, &self.fonts);
|
||||
}
|
||||
|
||||
fn draw_choice(&self, r: &mut Renderer) {
|
||||
self.browser_ask_label.draw(r, &self.fonts);
|
||||
self.native_host_box.draw(r);
|
||||
self.native_host_label.draw(r, &self.fonts);
|
||||
self.pepper_box.draw(r);
|
||||
self.pepper_label.draw(r, &self.fonts);
|
||||
self.netscape_box.draw(r);
|
||||
self.netscape_label.draw(r, &self.fonts);
|
||||
self.activex_box.draw(r);
|
||||
self.activex_label.draw(r, &self.fonts);
|
||||
}
|
||||
|
||||
fn draw_player_choice(&self, r: &mut Renderer) {
|
||||
self.player_ask_label.draw(r, &self.fonts);
|
||||
self.player_box.draw(r);
|
||||
self.player_label.draw(r, &self.fonts);
|
||||
self.player_desktop_box.draw(r);
|
||||
self.player_desktop_label.draw(r, &self.fonts);
|
||||
self.player_start_menu_box.draw(r);
|
||||
self.player_start_menu_label.draw(r, &self.fonts);
|
||||
}
|
||||
|
||||
fn draw_debug_choice(&mut self, r: &mut Renderer) {
|
||||
self.debug_ask_label.draw(r, &self.fonts);
|
||||
self.debug_button.draw(r, &self.fonts);
|
||||
}
|
||||
|
||||
fn draw_before_install(&self, r: &mut Renderer) {
|
||||
self.before_install_label.draw(r, &self.fonts);
|
||||
}
|
||||
|
||||
fn draw_install(&self, r: &mut Renderer) {
|
||||
self.install_header_label.draw(r, &self.fonts);
|
||||
self.progress_label.draw(r, &self.fonts);
|
||||
self.progress_bar.draw(r);
|
||||
}
|
||||
|
||||
fn draw_complete(&self, r: &mut Renderer) {
|
||||
self.complete_label.draw(r, &self.fonts);
|
||||
}
|
||||
|
||||
fn draw_failure(&self, r: &mut Renderer) {
|
||||
self.failure_text_label.draw(r, &self.fonts);
|
||||
// Draw error detail as clipped text.
|
||||
let detail_text = if self.failure_detail.len() > 300 {
|
||||
&self.failure_detail[..300]
|
||||
} else {
|
||||
&self.failure_detail
|
||||
};
|
||||
self.fonts.draw_text_multiline(
|
||||
r,
|
||||
self.s(PANEL_X + 4),
|
||||
self.s(PANEL_Y + 44),
|
||||
detail_text,
|
||||
self.sf(11.0),
|
||||
FG_COLOR,
|
||||
self.sf(1.0),
|
||||
self.sf((WIDTH as i32 - PANEL_X - 14) as f32),
|
||||
);
|
||||
self.copy_error_button.draw(r, &self.fonts);
|
||||
}
|
||||
}
|
||||
|
||||
/// Progress callback that writes to the shared state from the background thread.
|
||||
struct ThreadProgressCallback {
|
||||
state: Arc<Mutex<ProgressState>>,
|
||||
}
|
||||
|
||||
impl ProgressCallback for ThreadProgressCallback {
|
||||
fn update_progress_label(&self, text: &str, tick: bool) {
|
||||
let mut state = self.state.lock().unwrap();
|
||||
state.label = text.to_string();
|
||||
if tick {
|
||||
state.value += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn tick_progress(&self) {
|
||||
let mut state = self.state.lock().unwrap();
|
||||
state.value += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn join_with_and(items: &[&str]) -> String {
|
||||
match items.len() {
|
||||
0 => String::new(),
|
||||
1 => items[0].to_string(),
|
||||
2 => format!("{} and {}", items[0], items[1]),
|
||||
_ => {
|
||||
let (last, rest) = items.split_last().unwrap();
|
||||
format!("{} and {}", rest.join(", "), last)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
use crate::install_flags::{self, InstallFlags};
|
||||
use clean_flash_common::{native_host, InstallError, ProgressCallback};
|
||||
use std::fs;
|
||||
use std::io::{self, Cursor};
|
||||
|
||||
/// Extract native-host and pp64 entries from the embedded 7z archive,
|
||||
/// placing them next to each other in the native host install directory.
|
||||
fn install_from_archive(
|
||||
archive_bytes: &[u8],
|
||||
form: &dyn ProgressCallback,
|
||||
) -> Result<(), InstallError> {
|
||||
let native_host_dir = native_host::get_native_host_install_dir();
|
||||
let _ = fs::create_dir_all(&native_host_dir);
|
||||
|
||||
form.update_progress_label("Extracting native messaging host files...", true);
|
||||
|
||||
sevenz_rust2::decompress_with_extract_fn(
|
||||
Cursor::new(archive_bytes),
|
||||
".",
|
||||
|entry, reader, _dest| {
|
||||
if entry.is_directory() {
|
||||
io::copy(reader, &mut io::sink()).map_err(sevenz_rust2::Error::from)?;
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
let entry_name = entry.name().to_string();
|
||||
let parts: Vec<&str> = entry_name.split('/').collect();
|
||||
if parts.is_empty() {
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
let dirname = parts[0];
|
||||
let install_key = dirname.split('-').next().unwrap_or(dirname);
|
||||
|
||||
// Only extract native-host-64, pp64, and uninstaller entries.
|
||||
let dominated = dirname == "native-host-64"
|
||||
|| install_key == "pp64"
|
||||
|| install_key == "uninstaller";
|
||||
if !dominated {
|
||||
io::copy(reader, &mut io::sink()).map_err(sevenz_rust2::Error::from)?;
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
// Skip debug variants of pp64.
|
||||
if install_key == "pp64" && dirname.contains("-debug") {
|
||||
io::copy(reader, &mut io::sink()).map_err(sevenz_rust2::Error::from)?;
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
if dirname == "native-host-64" {
|
||||
form.update_progress_label("Installing native messaging host...", true);
|
||||
} else if install_key == "pp64" {
|
||||
form.update_progress_label("Installing Pepper plugin files...", true);
|
||||
} else if install_key == "uninstaller" {
|
||||
form.update_progress_label("Extracting uninstaller...", true);
|
||||
}
|
||||
|
||||
let out_name = parts.last().unwrap_or(&dirname);
|
||||
let out_path = native_host_dir.join(out_name);
|
||||
|
||||
let mut buf = Vec::new();
|
||||
reader
|
||||
.read_to_end(&mut buf)
|
||||
.map_err(sevenz_rust2::Error::from)?;
|
||||
fs::write(&out_path, &buf).map_err(sevenz_rust2::Error::from)?;
|
||||
|
||||
// Make binaries executable.
|
||||
#[cfg(unix)]
|
||||
if dirname == "native-host-64" || install_key == "uninstaller" {
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
let _ = fs::set_permissions(&out_path, fs::Permissions::from_mode(0o755));
|
||||
}
|
||||
|
||||
Ok(true)
|
||||
},
|
||||
)
|
||||
.map_err(|e| InstallError::new(format!("Failed to extract archive: {}", e)))?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Main install entry point for Linux.
|
||||
pub fn install(
|
||||
form: &dyn ProgressCallback,
|
||||
flags: &mut InstallFlags,
|
||||
) -> Result<(), InstallError> {
|
||||
if flags.is_none_set() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
let archive_bytes: &[u8] = include_bytes!("../cleanflash-linux.7z");
|
||||
#[cfg(target_os = "macos")]
|
||||
let archive_bytes: &[u8] = include_bytes!("../cleanflash-macos.7z");
|
||||
|
||||
if archive_bytes.is_empty() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
if flags.is_set(install_flags::NATIVE_HOST) {
|
||||
install_from_archive(archive_bytes, form)?;
|
||||
native_host::install_native_host(form)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -1,427 +0,0 @@
|
||||
use crate::install_flags::{self, InstallFlags};
|
||||
use clean_flash_common::{
|
||||
native_host, process_utils, registry, resources, system_info, InstallError, ProgressCallback,
|
||||
};
|
||||
use std::env;
|
||||
use std::fs;
|
||||
use std::io::{self, Cursor};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
/// Metadata for a single installable component.
|
||||
struct InstallEntry {
|
||||
install_text: &'static str,
|
||||
required_flags: u32,
|
||||
target_directory: PathBuf,
|
||||
registry_instructions: Option<&'static str>,
|
||||
}
|
||||
|
||||
/// Register an ActiveX OCX via regsvr32 (unregister first, then register).
|
||||
pub fn register_activex(filename: &str) -> Result<(), InstallError> {
|
||||
let path = Path::new(filename);
|
||||
let dir = path.parent().unwrap_or(Path::new("."));
|
||||
let file_name = path
|
||||
.file_name()
|
||||
.unwrap_or_default()
|
||||
.to_string_lossy()
|
||||
.to_string();
|
||||
|
||||
let _ = env::set_current_dir(dir);
|
||||
|
||||
let process = process_utils::run_process("regsvr32.exe", &["/s", "/u", &file_name]);
|
||||
if !process.is_successful() {
|
||||
return Err(InstallError::new(format!(
|
||||
"Failed to unregister ActiveX plugin: error code {}\n\n{}",
|
||||
process.exit_code, process.output
|
||||
)));
|
||||
}
|
||||
|
||||
let process = process_utils::run_process("regsvr32.exe", &["/s", &file_name]);
|
||||
if !process.is_successful() {
|
||||
return Err(InstallError::new(format!(
|
||||
"Failed to register ActiveX plugin: error code {}\n\n{}",
|
||||
process.exit_code, process.output
|
||||
)));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Create a Windows shortcut (.lnk) using a PowerShell one-liner.
|
||||
fn create_shortcut(
|
||||
folder: &Path,
|
||||
executable: &Path,
|
||||
name: &str,
|
||||
description: &str,
|
||||
) -> Result<(), InstallError> {
|
||||
let lnk_path = folder.join(format!("{}.lnk", name));
|
||||
let exe_str = executable.to_string_lossy();
|
||||
let lnk_str = lnk_path.to_string_lossy();
|
||||
|
||||
// Use PowerShell to create the shortcut via WScript.Shell COM.
|
||||
let script = format!(
|
||||
"$ws = New-Object -ComObject WScript.Shell; \
|
||||
$s = $ws.CreateShortcut('{}'); \
|
||||
$s.TargetPath = '{}'; \
|
||||
$s.Description = '{}'; \
|
||||
$s.IconLocation = '{}'; \
|
||||
$s.Save()",
|
||||
lnk_str, exe_str, description, exe_str
|
||||
);
|
||||
|
||||
let result = process_utils::run_process("powershell.exe", &["-NoProfile", "-Command", &script]);
|
||||
if !result.is_successful() {
|
||||
return Err(InstallError::new(format!(
|
||||
"Failed to create shortcut: {}",
|
||||
result.output
|
||||
)));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Extract the embedded 7z archive and install files to the correct locations.
|
||||
fn install_from_archive(
|
||||
archive_bytes: &[u8],
|
||||
form: &dyn ProgressCallback,
|
||||
flags: &mut InstallFlags,
|
||||
) -> Result<(), InstallError> {
|
||||
let si = system_info::SystemInfo::new();
|
||||
let flash32_path = si.flash32_path.clone();
|
||||
let flash64_path = si.flash64_path.clone();
|
||||
let system32_path = si.system32_path.clone();
|
||||
let flash_program32_path = si.flash_program32_path.clone();
|
||||
let native_host_dir = native_host::get_native_host_install_dir();
|
||||
|
||||
let mut registry_to_apply: Vec<&str> = vec![resources::INSTALL_GENERAL];
|
||||
|
||||
if si.is_64bit {
|
||||
flags.set_flag(install_flags::X64);
|
||||
registry_to_apply.push(resources::INSTALL_GENERAL_64);
|
||||
}
|
||||
|
||||
let entries: Vec<(&str, InstallEntry)> = vec![
|
||||
(
|
||||
"controlpanel",
|
||||
InstallEntry {
|
||||
install_text: "Installing Flash Player utilities...",
|
||||
required_flags: install_flags::NONE,
|
||||
target_directory: system32_path.clone(),
|
||||
registry_instructions: None,
|
||||
},
|
||||
),
|
||||
(
|
||||
"uninstaller",
|
||||
InstallEntry {
|
||||
install_text: "Extracting uninstaller...",
|
||||
required_flags: install_flags::NONE,
|
||||
target_directory: flash_program32_path.clone(),
|
||||
registry_instructions: None,
|
||||
},
|
||||
),
|
||||
(
|
||||
"standalone",
|
||||
InstallEntry {
|
||||
install_text: "Installing 32-bit Standalone Flash Player...",
|
||||
required_flags: install_flags::PLAYER,
|
||||
target_directory: flash_program32_path.clone(),
|
||||
registry_instructions: None,
|
||||
},
|
||||
),
|
||||
(
|
||||
"ocx32",
|
||||
InstallEntry {
|
||||
install_text: "Installing 32-bit Flash Player for Internet Explorer...",
|
||||
required_flags: install_flags::ACTIVEX,
|
||||
target_directory: flash32_path.clone(),
|
||||
registry_instructions: None,
|
||||
},
|
||||
),
|
||||
(
|
||||
"np32",
|
||||
InstallEntry {
|
||||
install_text: "Installing 32-bit Flash Player for Firefox...",
|
||||
required_flags: install_flags::NETSCAPE,
|
||||
target_directory: flash32_path.clone(),
|
||||
registry_instructions: Some(resources::INSTALL_NP),
|
||||
},
|
||||
),
|
||||
(
|
||||
"pp32",
|
||||
InstallEntry {
|
||||
install_text: "Installing 32-bit Flash Player for Chrome...",
|
||||
required_flags: install_flags::PEPPER,
|
||||
target_directory: flash32_path.clone(),
|
||||
registry_instructions: Some(resources::INSTALL_PP),
|
||||
},
|
||||
),
|
||||
(
|
||||
"ocx64",
|
||||
InstallEntry {
|
||||
install_text: "Installing 64-bit Flash Player for Internet Explorer...",
|
||||
required_flags: install_flags::ACTIVEX | install_flags::X64,
|
||||
target_directory: flash64_path.clone(),
|
||||
registry_instructions: None,
|
||||
},
|
||||
),
|
||||
(
|
||||
"np64",
|
||||
InstallEntry {
|
||||
install_text: "Installing 64-bit Flash Player for Firefox...",
|
||||
required_flags: install_flags::NETSCAPE | install_flags::X64,
|
||||
target_directory: flash64_path.clone(),
|
||||
registry_instructions: Some(resources::INSTALL_NP_64),
|
||||
},
|
||||
),
|
||||
(
|
||||
"pp64",
|
||||
InstallEntry {
|
||||
install_text: "Installing 64-bit Flash Player for Chrome...",
|
||||
required_flags: install_flags::PEPPER | install_flags::X64,
|
||||
target_directory: flash64_path.clone(),
|
||||
registry_instructions: Some(resources::INSTALL_PP_64),
|
||||
},
|
||||
),
|
||||
(
|
||||
"native-host-64",
|
||||
InstallEntry {
|
||||
install_text: "Installing native messaging host (64-bit)...",
|
||||
required_flags: install_flags::NATIVE_HOST | install_flags::X64,
|
||||
target_directory: native_host_dir.clone(),
|
||||
registry_instructions: None,
|
||||
},
|
||||
),
|
||||
(
|
||||
"native-host-32",
|
||||
InstallEntry {
|
||||
install_text: "Installing native messaging host (32-bit)...",
|
||||
required_flags: install_flags::NATIVE_HOST,
|
||||
target_directory: native_host_dir.clone(),
|
||||
registry_instructions: None,
|
||||
},
|
||||
),
|
||||
];
|
||||
|
||||
let legacy = si.is_legacy_windows();
|
||||
|
||||
// Extract archive using sevenz-rust2.
|
||||
sevenz_rust2::decompress_with_extract_fn(
|
||||
Cursor::new(archive_bytes),
|
||||
".",
|
||||
|entry, reader, _dest| {
|
||||
// Skip directory entries — they have no file content.
|
||||
if entry.is_directory() {
|
||||
io::copy(reader, &mut io::sink()).map_err(sevenz_rust2::Error::from)?;
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
let entry_name = entry.name().to_string();
|
||||
let parts: Vec<&str> = entry_name.split('/').collect();
|
||||
if parts.is_empty() {
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
let filename = parts[0];
|
||||
let install_key = filename.split('-').next().unwrap_or(filename);
|
||||
let is_pp32 = install_key == "pp32";
|
||||
let is_pp64 = install_key == "pp64";
|
||||
let should_extract_pepper_for_native_host =
|
||||
flags.is_set(install_flags::NATIVE_HOST)
|
||||
&& ((si.is_64bit && is_pp64) || (!si.is_64bit && is_pp32));
|
||||
|
||||
// Find the matching entry: try exact match on full dirname first,
|
||||
// then fall back to first segment before '-'.
|
||||
let Some((_key, install_entry)) = entries
|
||||
.iter()
|
||||
.find(|(k, _)| *k == filename)
|
||||
.or_else(|| entries.iter().find(|(k, _)| *k == install_key))
|
||||
else {
|
||||
io::copy(reader, &mut io::sink()).map_err(sevenz_rust2::Error::from)?;
|
||||
return Ok(true);
|
||||
};
|
||||
|
||||
// Check required flags.
|
||||
let should_install_by_flags = install_entry.required_flags == install_flags::NONE
|
||||
|| flags.is_set(install_entry.required_flags);
|
||||
if install_entry.required_flags != install_flags::NONE
|
||||
&& !flags.is_set(install_entry.required_flags)
|
||||
&& !(should_extract_pepper_for_native_host && (is_pp32 || is_pp64))
|
||||
{
|
||||
io::copy(reader, &mut io::sink()).map_err(sevenz_rust2::Error::from)?;
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
// For native-host: on 64-bit use only native-host-64, on 32-bit use only native-host-32.
|
||||
if filename == "native-host-32" && si.is_64bit {
|
||||
io::copy(reader, &mut io::sink()).map_err(sevenz_rust2::Error::from)?;
|
||||
return Ok(true);
|
||||
}
|
||||
if filename == "native-host-64" && !si.is_64bit {
|
||||
io::copy(reader, &mut io::sink()).map_err(sevenz_rust2::Error::from)?;
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
// Check debug flag match (skip native-host entries from this check).
|
||||
if install_entry.required_flags != install_flags::NONE
|
||||
&& (install_entry.required_flags & install_flags::NATIVE_HOST) == 0
|
||||
{
|
||||
let is_debug_file = filename.contains("-debug");
|
||||
if flags.is_set(install_flags::DEBUG) != is_debug_file {
|
||||
io::copy(reader, &mut io::sink()).map_err(sevenz_rust2::Error::from)?;
|
||||
return Ok(true);
|
||||
}
|
||||
}
|
||||
|
||||
// Check legacy flag for ActiveX entries.
|
||||
if (install_entry.required_flags & install_flags::ACTIVEX) != 0 {
|
||||
let is_legacy_file = filename.contains("-legacy");
|
||||
if legacy != is_legacy_file {
|
||||
io::copy(reader, &mut io::sink()).map_err(sevenz_rust2::Error::from)?;
|
||||
return Ok(true);
|
||||
}
|
||||
}
|
||||
|
||||
let extract_for_native_host_only = !should_install_by_flags
|
||||
&& should_extract_pepper_for_native_host
|
||||
&& (is_pp32 || is_pp64);
|
||||
|
||||
if extract_for_native_host_only {
|
||||
form.update_progress_label(
|
||||
"Extracting Pepper files required by modern browser support...",
|
||||
true,
|
||||
);
|
||||
} else {
|
||||
form.update_progress_label(install_entry.install_text, true);
|
||||
}
|
||||
|
||||
let target_directory = if extract_for_native_host_only {
|
||||
native_host_dir.clone()
|
||||
} else {
|
||||
install_entry.target_directory.clone()
|
||||
};
|
||||
|
||||
// Ensure target directory exists.
|
||||
let _ = fs::create_dir_all(&target_directory);
|
||||
|
||||
// Extract file: use just the file name (strip any path prefix).
|
||||
let out_name = parts.last().unwrap_or(&filename);
|
||||
let out_path = target_directory.join(out_name);
|
||||
|
||||
let mut buf = Vec::new();
|
||||
reader.read_to_end(&mut buf).map_err(sevenz_rust2::Error::from)?;
|
||||
fs::write(&out_path, &buf).map_err(sevenz_rust2::Error::from)?;
|
||||
|
||||
Ok(true)
|
||||
},
|
||||
)
|
||||
.map_err(|e| InstallError::new(format!("Failed to extract archive: {}", e)))?;
|
||||
|
||||
// Create Player shortcuts.
|
||||
if flags.is_set(install_flags::PLAYER) {
|
||||
let is_debug = flags.is_set(install_flags::DEBUG);
|
||||
let name = if is_debug {
|
||||
"Flash Player (Debug)"
|
||||
} else {
|
||||
"Flash Player"
|
||||
};
|
||||
let description = format!(
|
||||
"Standalone Flash Player {}{}",
|
||||
clean_flash_common::update_checker::FLASH_VERSION,
|
||||
if is_debug { " (Debug)" } else { "" }
|
||||
);
|
||||
let exe_name = if is_debug {
|
||||
"flashplayer_sa_debug.exe"
|
||||
} else {
|
||||
"flashplayer_sa.exe"
|
||||
};
|
||||
let executable = flash_program32_path.join(exe_name);
|
||||
|
||||
if flags.is_set(install_flags::PLAYER_START_MENU) {
|
||||
if let Some(start_menu) = get_start_menu() {
|
||||
let _ = create_shortcut(&start_menu, &executable, name, &description);
|
||||
}
|
||||
}
|
||||
|
||||
if flags.is_set(install_flags::PLAYER_DESKTOP) {
|
||||
if let Some(desktop) = get_desktop() {
|
||||
let _ = create_shortcut(&desktop, &executable, name, &description);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Collect registry entries for enabled components.
|
||||
for (_key, entry) in &entries {
|
||||
if flags.is_set(entry.required_flags) {
|
||||
if let Some(reg) = entry.registry_instructions {
|
||||
registry_to_apply.push(reg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
form.update_progress_label("Applying registry changes...", true);
|
||||
let refs: Vec<&str> = registry_to_apply.iter().copied().collect();
|
||||
registry::apply_registry(&refs)?;
|
||||
|
||||
// Register ActiveX OCX files.
|
||||
if flags.is_set(install_flags::ACTIVEX) {
|
||||
form.update_progress_label(
|
||||
"Activating 32-bit Flash Player for Internet Explorer...",
|
||||
true,
|
||||
);
|
||||
let ocx32 = flash32_path.join(format!("Flash32_{}.ocx", si.version_path));
|
||||
register_activex(&ocx32.to_string_lossy())?;
|
||||
|
||||
if si.is_64bit {
|
||||
form.update_progress_label(
|
||||
"Activating 64-bit Flash Player for Internet Explorer...",
|
||||
true,
|
||||
);
|
||||
let ocx64 = flash64_path.join(format!("Flash64_{}.ocx", si.version_path));
|
||||
register_activex(&ocx64.to_string_lossy())?;
|
||||
}
|
||||
}
|
||||
|
||||
// Install native messaging host manifests for detected browsers.
|
||||
if flags.is_set(install_flags::NATIVE_HOST) {
|
||||
native_host::install_native_host(form)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Main install entry point.
|
||||
pub fn install(
|
||||
form: &dyn ProgressCallback,
|
||||
flags: &mut InstallFlags,
|
||||
) -> Result<(), InstallError> {
|
||||
if flags.is_none_set() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
// The 7z archive is embedded in the binary via include_bytes!.
|
||||
// For the port, we expect it at a known resource path; if not present,
|
||||
// this is a no-op placeholder.
|
||||
let archive_bytes: &[u8] = include_bytes!("../cleanflash-win.7z");
|
||||
|
||||
if archive_bytes.is_empty() {
|
||||
// Nothing to extract; still apply the rest of the steps.
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
install_from_archive(archive_bytes, form, flags)
|
||||
}
|
||||
|
||||
fn get_start_menu() -> Option<PathBuf> {
|
||||
env::var("APPDATA")
|
||||
.ok()
|
||||
.map(|p| {
|
||||
PathBuf::from(p)
|
||||
.join("Microsoft")
|
||||
.join("Windows")
|
||||
.join("Start Menu")
|
||||
})
|
||||
}
|
||||
|
||||
fn get_desktop() -> Option<PathBuf> {
|
||||
env::var("USERPROFILE")
|
||||
.ok()
|
||||
.map(|p| PathBuf::from(p).join("Desktop"))
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
#![windows_subsystem = "windows"]
|
||||
|
||||
mod install_flags;
|
||||
mod install_form;
|
||||
|
||||
#[cfg(windows)]
|
||||
#[path = "installer_windows.rs"]
|
||||
mod installer;
|
||||
|
||||
#[cfg(not(windows))]
|
||||
#[path = "installer_linux.rs"]
|
||||
mod installer;
|
||||
|
||||
use install_form::{InstallForm, HEIGHT, WIDTH};
|
||||
use clean_flash_ui::renderer::Renderer;
|
||||
use minifb::{Key, MouseButton, MouseMode, Window, WindowOptions};
|
||||
|
||||
fn main() {
|
||||
let title = format!(
|
||||
"Clean Flash Player {} Installer",
|
||||
clean_flash_common::update_checker::FLASH_VERSION
|
||||
);
|
||||
|
||||
// Query DPI before creating any window. The manifest already marks the process
|
||||
// as per-monitor v2 DPI aware, so GetDpiForSystem returns the real hardware DPI.
|
||||
let scale = clean_flash_ui::get_dpi_scale();
|
||||
let phys_w = (WIDTH as f32 * scale).round() as usize;
|
||||
let phys_h = (HEIGHT as f32 * scale).round() as usize;
|
||||
|
||||
let mut window = Window::new(
|
||||
&title,
|
||||
phys_w,
|
||||
phys_h,
|
||||
WindowOptions {
|
||||
resize: false,
|
||||
..WindowOptions::default()
|
||||
},
|
||||
)
|
||||
.expect("Failed to create window");
|
||||
|
||||
// Set window icon from the resource embedded by build.rs.
|
||||
clean_flash_ui::set_window_icon(&window);
|
||||
|
||||
// Cap at ~24 fps.
|
||||
window.set_target_fps(24);
|
||||
|
||||
// Renderer operates at physical resolution; the form layout is scaled accordingly.
|
||||
let mut renderer = Renderer::new(phys_w, phys_h);
|
||||
let mut form = InstallForm::new(scale);
|
||||
|
||||
while window.is_open() && !window.is_key_down(Key::Escape)
|
||||
&& !(window.is_key_down(Key::F4)
|
||||
&& (window.is_key_down(Key::LeftAlt) || window.is_key_down(Key::RightAlt)))
|
||||
{
|
||||
let (mx, my) = window
|
||||
.get_mouse_pos(MouseMode::Clamp)
|
||||
.unwrap_or((0.0, 0.0));
|
||||
let mouse_down = window.get_mouse_down(MouseButton::Left);
|
||||
|
||||
form.update_and_draw(&mut renderer, mx as i32, my as i32, mouse_down);
|
||||
|
||||
window
|
||||
.update_with_buffer(&renderer.buffer, phys_w, phys_h)
|
||||
.expect("Failed to update window buffer");
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
[package]
|
||||
name = "clean_flash_ui"
|
||||
version = "34.0.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
ab_glyph = { workspace = true }
|
||||
minifb = { workspace = true }
|
||||
windows-sys = { workspace = true }
|
||||
@@ -1,265 +0,0 @@
|
||||
use crate::renderer::Renderer;
|
||||
|
||||
/// Cached flash logo bitmap. Stores a pre-rendered pixel buffer so the
|
||||
/// expensive MSAA polygon fill only runs when the target size changes.
|
||||
pub struct FlashLogoCache {
|
||||
width: i32,
|
||||
height: i32,
|
||||
/// Pre-rendered pixels in 0x00RRGGBB format, row-major, size = width * height.
|
||||
pixels: Vec<u32>,
|
||||
/// Shadow offset derived from width.
|
||||
shadow_off: i32,
|
||||
}
|
||||
|
||||
impl FlashLogoCache {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
width: 0,
|
||||
height: 0,
|
||||
pixels: Vec::new(),
|
||||
shadow_off: 0,
|
||||
}
|
||||
}
|
||||
|
||||
/// Draw the flash logo at (x, y) with size (w, h).
|
||||
/// Re-renders into the cache only if the size changed.
|
||||
pub fn draw(&mut self, renderer: &mut Renderer, x: i32, y: i32, w: i32, h: i32) {
|
||||
if w <= 0 || h <= 0 {
|
||||
return;
|
||||
}
|
||||
|
||||
if self.width != w || self.height != h {
|
||||
self.rebuild(w, h);
|
||||
}
|
||||
|
||||
// Draw subtle drop shadow first.
|
||||
let shadow_color = Renderer::rgb(0, 0, 0);
|
||||
let shadow_alpha: u8 = 40;
|
||||
let so = self.shadow_off;
|
||||
for dy in 0..h {
|
||||
for dx in 0..w {
|
||||
renderer.blend_pixel(x + dx + so, y + dy + so, shadow_color, shadow_alpha);
|
||||
}
|
||||
}
|
||||
|
||||
// Blit cached pixels onto the renderer.
|
||||
for dy in 0..h {
|
||||
for dx in 0..w {
|
||||
let px = self.pixels[dy as usize * w as usize + dx as usize];
|
||||
renderer.set_pixel(x + dx, y + dy, px);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Render the logo into the internal cache at the given size.
|
||||
fn rebuild(&mut self, w: i32, h: i32) {
|
||||
self.width = w;
|
||||
self.height = h;
|
||||
self.shadow_off = ((w as f32 * 0.02).round() as i32).max(1);
|
||||
|
||||
// Render into a temporary offscreen renderer.
|
||||
let mut tmp = Renderer::new(w as usize, h as usize);
|
||||
|
||||
let vw = 500.0_f32;
|
||||
let vh = 487.0_f32;
|
||||
let sx = w as f32 / vw;
|
||||
let sy = h as f32 / vh;
|
||||
|
||||
let blue = Renderer::rgb(0x00, 0x3A, 0x74);
|
||||
tmp.fill_rect(0, 0, w, h, blue);
|
||||
|
||||
let white = Renderer::rgb(255, 255, 255);
|
||||
let points = build_f_polygon();
|
||||
fill_polygon(&mut tmp, &points, 0.0, 0.0, sx, sy, white);
|
||||
|
||||
self.pixels = tmp.buffer;
|
||||
}
|
||||
}
|
||||
|
||||
/// Evaluate a cubic bezier curve and return `segments` points (excluding the start point).
|
||||
fn cubic_bezier(
|
||||
p0: (f32, f32),
|
||||
p1: (f32, f32),
|
||||
p2: (f32, f32),
|
||||
p3: (f32, f32),
|
||||
segments: usize,
|
||||
) -> Vec<(f32, f32)> {
|
||||
let mut pts = Vec::with_capacity(segments);
|
||||
for i in 1..=segments {
|
||||
let t = i as f32 / segments as f32;
|
||||
let u = 1.0 - t;
|
||||
let x = u * u * u * p0.0
|
||||
+ 3.0 * u * u * t * p1.0
|
||||
+ 3.0 * u * t * t * p2.0
|
||||
+ t * t * t * p3.0;
|
||||
let y = u * u * u * p0.1
|
||||
+ 3.0 * u * u * t * p1.1
|
||||
+ 3.0 * u * t * t * p2.1
|
||||
+ t * t * t * p3.1;
|
||||
pts.push((x, y));
|
||||
}
|
||||
pts
|
||||
}
|
||||
|
||||
/// Build the "f" shape polygon by tracing the SVG path data, flattening beziers
|
||||
/// into line segments. Coordinates are in the SVG viewBox space (500×487).
|
||||
fn build_f_polygon() -> Vec<(f32, f32)> {
|
||||
let mut pts = Vec::with_capacity(128);
|
||||
const N: usize = 16; // segments per bezier curve
|
||||
|
||||
// M 269.2,138.7
|
||||
pts.push((269.2, 138.7));
|
||||
|
||||
// c -22.5,27.5 -35.8,61.8 -48.7,95
|
||||
pts.extend(cubic_bezier(
|
||||
(269.2, 138.7),
|
||||
(246.7, 166.2),
|
||||
(233.4, 200.5),
|
||||
(220.5, 233.7),
|
||||
N,
|
||||
));
|
||||
|
||||
// c -26.1,67.3 -43.6,105.8 -99.7,105.8
|
||||
pts.extend(cubic_bezier(
|
||||
(220.5, 233.7),
|
||||
(194.4, 301.0),
|
||||
(176.9, 339.5),
|
||||
(120.8, 339.5),
|
||||
N,
|
||||
));
|
||||
|
||||
// V 402
|
||||
pts.push((120.8, 402.0));
|
||||
|
||||
// c 46.4,0 84.1,-17.2 112,-51.2
|
||||
pts.extend(cubic_bezier(
|
||||
(120.8, 402.0),
|
||||
(167.2, 402.0),
|
||||
(204.9, 384.8),
|
||||
(232.8, 350.8),
|
||||
N,
|
||||
));
|
||||
|
||||
// c 17.9,-21.9 30.3,-49.3 40.9,-75.8
|
||||
pts.extend(cubic_bezier(
|
||||
(232.8, 350.8),
|
||||
(250.7, 328.9),
|
||||
(263.1, 301.5),
|
||||
(273.7, 275.0),
|
||||
N,
|
||||
));
|
||||
|
||||
// h 74.1
|
||||
pts.push((347.8, 275.0));
|
||||
|
||||
// v -62.5
|
||||
pts.push((347.8, 212.5));
|
||||
|
||||
// h -48.8
|
||||
pts.push((299.0, 212.5));
|
||||
|
||||
// c 18.9,-40.6 39.2,-62.5 82.1,-62.5
|
||||
pts.extend(cubic_bezier(
|
||||
(299.0, 212.5),
|
||||
(317.9, 171.9),
|
||||
(338.2, 150.0),
|
||||
(381.1, 150.0),
|
||||
N,
|
||||
));
|
||||
|
||||
// V 87.5
|
||||
pts.push((381.1, 87.5));
|
||||
|
||||
// C 334.8,87.5 297.1,104.7 269.2,138.7 (absolute cubic, closes the shape)
|
||||
pts.extend(cubic_bezier(
|
||||
(381.1, 87.5),
|
||||
(334.8, 87.5),
|
||||
(297.1, 104.7),
|
||||
(269.2, 138.7),
|
||||
N,
|
||||
));
|
||||
|
||||
pts
|
||||
}
|
||||
|
||||
/// Test whether a point is inside the polygon using the even-odd (parity) rule.
|
||||
fn point_in_polygon(transformed: &[(f32, f32)], px: f32, py: f32) -> bool {
|
||||
let n = transformed.len();
|
||||
let mut inside = false;
|
||||
let mut j = n - 1;
|
||||
for i in 0..n {
|
||||
let (xi, yi) = transformed[i];
|
||||
let (xj, yj) = transformed[j];
|
||||
if ((yi > py) != (yj > py)) && (px < (xj - xi) * (py - yi) / (yj - yi) + xi) {
|
||||
inside = !inside;
|
||||
}
|
||||
j = i;
|
||||
}
|
||||
inside
|
||||
}
|
||||
|
||||
/// Scanline-fill a polygon with 4×4 MSAA antialiasing after transforming from
|
||||
/// viewBox to screen coordinates: screen_x = ox + vx * sx, screen_y = oy + vy * sy.
|
||||
fn fill_polygon(
|
||||
renderer: &mut Renderer,
|
||||
points: &[(f32, f32)],
|
||||
ox: f32,
|
||||
oy: f32,
|
||||
sx: f32,
|
||||
sy: f32,
|
||||
color: u32,
|
||||
) {
|
||||
if points.len() < 3 {
|
||||
return;
|
||||
}
|
||||
|
||||
// Transform to screen space.
|
||||
let transformed: Vec<(f32, f32)> = points
|
||||
.iter()
|
||||
.map(|&(px, py)| (ox + px * sx, oy + py * sy))
|
||||
.collect();
|
||||
|
||||
// Bounding box.
|
||||
let mut min_x = f32::MAX;
|
||||
let mut max_x = f32::MIN;
|
||||
let mut min_y = f32::MAX;
|
||||
let mut max_y = f32::MIN;
|
||||
for &(x, y) in &transformed {
|
||||
if x < min_x { min_x = x; }
|
||||
if x > max_x { max_x = x; }
|
||||
if y < min_y { min_y = y; }
|
||||
if y > max_y { max_y = y; }
|
||||
}
|
||||
|
||||
let x_start = (min_x.floor() as i32).max(0);
|
||||
let x_end = (max_x.ceil() as i32).min(renderer.width as i32 - 1);
|
||||
let y_start = (min_y.floor() as i32).max(0);
|
||||
let y_end = (max_y.ceil() as i32).min(renderer.height as i32 - 1);
|
||||
|
||||
// 4×4 sub-pixel grid offsets (16 samples per pixel).
|
||||
const GRID: usize = 4;
|
||||
const SAMPLES: usize = GRID * GRID;
|
||||
let step = 1.0 / GRID as f32;
|
||||
let half_step = step / 2.0;
|
||||
|
||||
for y in y_start..=y_end {
|
||||
for x in x_start..=x_end {
|
||||
let mut hits = 0u32;
|
||||
for sy_i in 0..GRID {
|
||||
let sample_y = y as f32 + half_step + sy_i as f32 * step;
|
||||
for sx_i in 0..GRID {
|
||||
let sample_x = x as f32 + half_step + sx_i as f32 * step;
|
||||
if point_in_polygon(&transformed, sample_x, sample_y) {
|
||||
hits += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if hits == SAMPLES as u32 {
|
||||
renderer.set_pixel(x, y, color);
|
||||
} else if hits > 0 {
|
||||
let alpha = ((hits * 255 + SAMPLES as u32 / 2) / SAMPLES as u32) as u8;
|
||||
renderer.blend_pixel(x, y, color, alpha);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,179 +0,0 @@
|
||||
use ab_glyph::{point, Font, FontRef, ScaleFont};
|
||||
use crate::renderer::Renderer;
|
||||
|
||||
/// Manages loaded fonts and provides text measurement / rendering.
|
||||
pub struct FontManager {
|
||||
regular: FontRef<'static>,
|
||||
}
|
||||
|
||||
impl FontManager {
|
||||
/// Create a `FontManager` using the bundled Liberation Sans font.
|
||||
pub fn new() -> Self {
|
||||
let regular = FontRef::try_from_slice(include_bytes!(
|
||||
"../../../resources/liberation-sans.regular.ttf"
|
||||
))
|
||||
.expect("Failed to parse bundled Liberation Sans font");
|
||||
Self { regular }
|
||||
}
|
||||
|
||||
/// Measure the width (in pixels) of `text` at the given `size` (in px).
|
||||
pub fn measure_text(&self, text: &str, size: f32) -> (f32, f32) {
|
||||
let scaled = self.regular.as_scaled(size);
|
||||
let mut width: f32 = 0.0;
|
||||
let height = scaled.height();
|
||||
|
||||
let mut last_glyph_id = None;
|
||||
|
||||
for ch in text.chars() {
|
||||
let glyph_id = scaled.glyph_id(ch);
|
||||
if let Some(prev) = last_glyph_id {
|
||||
width += scaled.kern(prev, glyph_id);
|
||||
}
|
||||
width += scaled.h_advance(glyph_id);
|
||||
last_glyph_id = Some(glyph_id);
|
||||
}
|
||||
|
||||
(width, height)
|
||||
}
|
||||
|
||||
/// Draw `text` onto the renderer at (x, y) with the given pixel size and colour.
|
||||
pub fn draw_text(
|
||||
&self,
|
||||
renderer: &mut Renderer,
|
||||
x: i32,
|
||||
y: i32,
|
||||
text: &str,
|
||||
size: f32,
|
||||
color: u32,
|
||||
) {
|
||||
let scaled = self.regular.as_scaled(size);
|
||||
let ascent = scaled.ascent();
|
||||
let mut cursor_x: f32 = 0.0;
|
||||
let mut last_glyph_id = None;
|
||||
|
||||
for ch in text.chars() {
|
||||
let glyph_id = scaled.glyph_id(ch);
|
||||
if let Some(prev) = last_glyph_id {
|
||||
cursor_x += scaled.kern(prev, glyph_id);
|
||||
}
|
||||
|
||||
let glyph = glyph_id.with_scale_and_position(
|
||||
size,
|
||||
point(x as f32 + cursor_x, y as f32 + ascent),
|
||||
);
|
||||
|
||||
if let Some(outlined) = self.regular.outline_glyph(glyph) {
|
||||
let bounds = outlined.px_bounds();
|
||||
outlined.draw(|gx, gy, coverage| {
|
||||
let px = bounds.min.x as i32 + gx as i32;
|
||||
let py = bounds.min.y as i32 + gy as i32;
|
||||
let alpha = (coverage * 255.0) as u8;
|
||||
if alpha > 0 {
|
||||
renderer.blend_pixel(px, py, color, alpha);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
cursor_x += scaled.h_advance(glyph_id);
|
||||
last_glyph_id = Some(glyph_id);
|
||||
}
|
||||
}
|
||||
|
||||
/// Draw multiline text, splitting on '\n' and word-wrapping at `max_width`
|
||||
/// (if > 0). Returns total height drawn.
|
||||
pub fn draw_text_multiline(
|
||||
&self,
|
||||
renderer: &mut Renderer,
|
||||
x: i32,
|
||||
y: i32,
|
||||
text: &str,
|
||||
size: f32,
|
||||
color: u32,
|
||||
line_spacing: f32,
|
||||
max_width: f32,
|
||||
) -> f32 {
|
||||
let scaled = self.regular.as_scaled(size);
|
||||
let line_height = scaled.height() + line_spacing;
|
||||
let mut cy = y as f32;
|
||||
|
||||
for line in text.split('\n') {
|
||||
if max_width > 0.0 {
|
||||
let wrapped = self.word_wrap(line, size, max_width);
|
||||
for wl in &wrapped {
|
||||
self.draw_text(renderer, x, cy as i32, wl, size, color);
|
||||
cy += line_height;
|
||||
}
|
||||
} else {
|
||||
self.draw_text(renderer, x, cy as i32, line, size, color);
|
||||
cy += line_height;
|
||||
}
|
||||
}
|
||||
|
||||
cy - y as f32
|
||||
}
|
||||
|
||||
/// Measure the total height of multiline text with word-wrapping.
|
||||
pub fn measure_text_multiline(&self, text: &str, size: f32, line_spacing: f32, max_width: f32) -> (f32, f32) {
|
||||
let scaled = self.regular.as_scaled(size);
|
||||
let line_height = scaled.height() + line_spacing;
|
||||
let mut total_lines = 0usize;
|
||||
let mut overall_max_w: f32 = 0.0;
|
||||
|
||||
for line in text.split('\n') {
|
||||
if max_width > 0.0 {
|
||||
let wrapped = self.word_wrap(line, size, max_width);
|
||||
for wl in &wrapped {
|
||||
let (lw, _) = self.measure_text(wl, size);
|
||||
if lw > overall_max_w {
|
||||
overall_max_w = lw;
|
||||
}
|
||||
}
|
||||
total_lines += wrapped.len();
|
||||
} else {
|
||||
let (lw, _) = self.measure_text(line, size);
|
||||
if lw > overall_max_w {
|
||||
overall_max_w = lw;
|
||||
}
|
||||
total_lines += 1;
|
||||
}
|
||||
}
|
||||
|
||||
(overall_max_w, line_height * total_lines as f32)
|
||||
}
|
||||
|
||||
/// Word-wrap a single line to fit within `max_width` pixels.
|
||||
fn word_wrap(&self, line: &str, size: f32, max_width: f32) -> Vec<String> {
|
||||
if line.is_empty() {
|
||||
return vec![String::new()];
|
||||
}
|
||||
|
||||
let mut result = Vec::new();
|
||||
let mut current = String::new();
|
||||
let mut current_w: f32 = 0.0;
|
||||
let space_w = self.measure_text(" ", size).0;
|
||||
|
||||
for word in line.split_whitespace() {
|
||||
let (ww, _) = self.measure_text(word, size);
|
||||
|
||||
if current.is_empty() {
|
||||
// First word on this line — always add even if too wide.
|
||||
current = word.to_string();
|
||||
current_w = ww;
|
||||
} else if current_w + space_w + ww <= max_width {
|
||||
current.push(' ');
|
||||
current.push_str(word);
|
||||
current_w += space_w + ww;
|
||||
} else {
|
||||
// Wrap.
|
||||
result.push(current);
|
||||
current = word.to_string();
|
||||
current_w = ww;
|
||||
}
|
||||
}
|
||||
|
||||
result.push(current);
|
||||
result
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
pub mod flash_logo;
|
||||
pub mod font;
|
||||
pub mod renderer;
|
||||
pub mod widgets;
|
||||
|
||||
pub use font::FontManager;
|
||||
pub use renderer::Renderer;
|
||||
|
||||
/// Query the system DPI scale factor (1.0 = 100%, 1.5 = 150%, 2.0 = 200%).
|
||||
/// The process must already be DPI-aware (declared in the manifest) for this
|
||||
/// to return the true hardware DPI rather than the virtualised 96.
|
||||
pub fn get_dpi_scale() -> f32 {
|
||||
#[cfg(target_os = "windows")]
|
||||
unsafe {
|
||||
use windows_sys::Win32::UI::HiDpi::GetDpiForSystem;
|
||||
let dpi = GetDpiForSystem();
|
||||
if dpi == 0 { 1.0 } else { dpi as f32 / 96.0 }
|
||||
}
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
{ 1.0 }
|
||||
}
|
||||
|
||||
/// Set the window icon from the icon resource already embedded in the binary
|
||||
/// by `winresource` (resource ID 1). No-op on non-Windows platforms.
|
||||
pub fn set_window_icon(window: &minifb::Window) {
|
||||
#[cfg(target_os = "windows")]
|
||||
unsafe {
|
||||
use windows_sys::Win32::System::LibraryLoader::GetModuleHandleW;
|
||||
use windows_sys::Win32::UI::WindowsAndMessaging::{
|
||||
LoadImageW, SendMessageW, ICON_BIG, ICON_SMALL, IMAGE_ICON, LR_DEFAULTSIZE,
|
||||
WM_SETICON,
|
||||
};
|
||||
|
||||
let hwnd = window.get_window_handle(); // *mut c_void
|
||||
let hmodule = GetModuleHandleW(std::ptr::null());
|
||||
// MAKEINTRESOURCEW(1): load the icon embedded by winresource as resource ID 1.
|
||||
let icon = LoadImageW(hmodule, 1 as *const u16, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE);
|
||||
if !icon.is_null() {
|
||||
SendMessageW(hwnd, WM_SETICON, ICON_BIG as usize, icon as isize);
|
||||
SendMessageW(hwnd, WM_SETICON, ICON_SMALL as usize, icon as isize);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,135 +0,0 @@
|
||||
/// Software renderer operating on a `Vec<u32>` pixel buffer (0xAA_RR_GG_BB).
|
||||
/// All drawing is done in-memory; the buffer is presented via minifb.
|
||||
pub struct Renderer {
|
||||
pub width: usize,
|
||||
pub height: usize,
|
||||
pub buffer: Vec<u32>,
|
||||
}
|
||||
|
||||
impl Renderer {
|
||||
pub fn new(width: usize, height: usize) -> Self {
|
||||
Self {
|
||||
width,
|
||||
height,
|
||||
buffer: vec![0; width * height],
|
||||
}
|
||||
}
|
||||
|
||||
/// Pack r, g, b into the minifb pixel format (0x00RRGGBB).
|
||||
#[inline]
|
||||
pub const fn rgb(r: u8, g: u8, b: u8) -> u32 {
|
||||
((r as u32) << 16) | ((g as u32) << 8) | (b as u32)
|
||||
}
|
||||
|
||||
/// Clear the entire buffer to a single colour.
|
||||
pub fn clear(&mut self, color: u32) {
|
||||
self.buffer.fill(color);
|
||||
}
|
||||
|
||||
/// Set a single pixel (bounds-checked).
|
||||
#[inline]
|
||||
pub fn set_pixel(&mut self, x: i32, y: i32, color: u32) {
|
||||
if x >= 0 && y >= 0 && (x as usize) < self.width && (y as usize) < self.height {
|
||||
self.buffer[y as usize * self.width + x as usize] = color;
|
||||
}
|
||||
}
|
||||
|
||||
/// Alpha-blend a single pixel. `alpha` is 0..=255.
|
||||
#[inline]
|
||||
pub fn blend_pixel(&mut self, x: i32, y: i32, color: u32, alpha: u8) {
|
||||
if x < 0 || y < 0 || (x as usize) >= self.width || (y as usize) >= self.height {
|
||||
return;
|
||||
}
|
||||
let idx = y as usize * self.width + x as usize;
|
||||
let dst = self.buffer[idx];
|
||||
self.buffer[idx] = alpha_blend(dst, color, alpha);
|
||||
}
|
||||
|
||||
/// Fill a solid rectangle.
|
||||
pub fn fill_rect(&mut self, x: i32, y: i32, w: i32, h: i32, color: u32) {
|
||||
let x0 = x.max(0) as usize;
|
||||
let y0 = y.max(0) as usize;
|
||||
let x1 = ((x + w) as usize).min(self.width);
|
||||
let y1 = ((y + h) as usize).min(self.height);
|
||||
|
||||
for row in y0..y1 {
|
||||
let start = row * self.width + x0;
|
||||
let end = row * self.width + x1;
|
||||
self.buffer[start..end].fill(color);
|
||||
}
|
||||
}
|
||||
|
||||
/// Draw a 1px rectangle outline.
|
||||
pub fn draw_rect(&mut self, x: i32, y: i32, w: i32, h: i32, color: u32) {
|
||||
// Top / bottom
|
||||
for dx in 0..w {
|
||||
self.set_pixel(x + dx, y, color);
|
||||
self.set_pixel(x + dx, y + h - 1, color);
|
||||
}
|
||||
// Left / right
|
||||
for dy in 0..h {
|
||||
self.set_pixel(x, y + dy, color);
|
||||
self.set_pixel(x + w - 1, y + dy, color);
|
||||
}
|
||||
}
|
||||
|
||||
/// Fill a rectangle with a vertical linear gradient from `color1` (top) to `color2` (bottom).
|
||||
pub fn fill_gradient_v(&mut self, x: i32, y: i32, w: i32, h: i32, color1: u32, color2: u32) {
|
||||
if h <= 0 {
|
||||
return;
|
||||
}
|
||||
let (r1, g1, b1) = unpack(color1);
|
||||
let (r2, g2, b2) = unpack(color2);
|
||||
|
||||
for dy in 0..h {
|
||||
let t = dy as f32 / (h - 1).max(1) as f32;
|
||||
let r = lerp_u8(r1, r2, t);
|
||||
let g = lerp_u8(g1, g2, t);
|
||||
let b = lerp_u8(b1, b2, t);
|
||||
let c = Self::rgb(r, g, b);
|
||||
self.fill_rect(x, y + dy, w, 1, c);
|
||||
}
|
||||
}
|
||||
|
||||
/// Fill a rectangle with a horizontal linear gradient.
|
||||
pub fn fill_gradient_h(&mut self, x: i32, y: i32, w: i32, h: i32, color1: u32, color2: u32) {
|
||||
if w <= 0 {
|
||||
return;
|
||||
}
|
||||
let (r1, g1, b1) = unpack(color1);
|
||||
let (r2, g2, b2) = unpack(color2);
|
||||
|
||||
for dx in 0..w {
|
||||
let t = dx as f32 / (w - 1).max(1) as f32;
|
||||
let r = lerp_u8(r1, r2, t);
|
||||
let g = lerp_u8(g1, g2, t);
|
||||
let b = lerp_u8(b1, b2, t);
|
||||
let c = Self::rgb(r, g, b);
|
||||
self.fill_rect(x + dx, y, 1, h, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---- helpers ----
|
||||
|
||||
#[inline]
|
||||
fn unpack(c: u32) -> (u8, u8, u8) {
|
||||
(((c >> 16) & 0xFF) as u8, ((c >> 8) & 0xFF) as u8, (c & 0xFF) as u8)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn lerp_u8(a: u8, b: u8, t: f32) -> u8 {
|
||||
(a as f32 + (b as f32 - a as f32) * t).round() as u8
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn alpha_blend(dst: u32, src: u32, alpha: u8) -> u32 {
|
||||
let (sr, sg, sb) = unpack(src);
|
||||
let (dr, dg, db) = unpack(dst);
|
||||
let a = alpha as u16;
|
||||
let inv = 255 - a;
|
||||
let r = ((sr as u16 * a + dr as u16 * inv) / 255) as u8;
|
||||
let g = ((sg as u16 * a + dg as u16 * inv) / 255) as u8;
|
||||
let b = ((sb as u16 * a + db as u16 * inv) / 255) as u8;
|
||||
Renderer::rgb(r, g, b)
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
use super::Rect;
|
||||
use crate::font::FontManager;
|
||||
use crate::renderer::Renderer;
|
||||
|
||||
/// A gradient button matching the C# GradientButton control.
|
||||
pub struct GradientButton {
|
||||
pub rect: Rect,
|
||||
pub text: String,
|
||||
pub font_size: f32,
|
||||
pub color1: u32,
|
||||
pub color2: u32,
|
||||
pub back_color: u32,
|
||||
pub fore_color: u32,
|
||||
pub hover_alpha: f64,
|
||||
pub disable_alpha: f64,
|
||||
pub enabled: bool,
|
||||
pub visible: bool,
|
||||
pub hovered: bool,
|
||||
pub pressed: bool,
|
||||
}
|
||||
|
||||
impl GradientButton {
|
||||
pub fn new(x: i32, y: i32, w: i32, h: i32, text: &str) -> Self {
|
||||
Self {
|
||||
rect: Rect::new(x, y, w, h),
|
||||
text: text.to_string(),
|
||||
font_size: 13.0,
|
||||
color1: Renderer::rgb(118, 118, 118),
|
||||
color2: Renderer::rgb(81, 81, 81),
|
||||
back_color: Renderer::rgb(0, 0, 0),
|
||||
fore_color: Renderer::rgb(227, 227, 227),
|
||||
hover_alpha: 0.875,
|
||||
disable_alpha: 0.644,
|
||||
enabled: true,
|
||||
visible: true,
|
||||
hovered: false,
|
||||
pressed: false,
|
||||
}
|
||||
}
|
||||
|
||||
/// Update hover / pressed state from mouse position and button state.
|
||||
pub fn update(&mut self, mx: i32, my: i32, mouse_down: bool) {
|
||||
if !self.visible || !self.enabled {
|
||||
self.hovered = false;
|
||||
self.pressed = false;
|
||||
return;
|
||||
}
|
||||
self.hovered = self.rect.contains(mx, my);
|
||||
self.pressed = self.hovered && mouse_down;
|
||||
}
|
||||
|
||||
/// Returns true if mouse was just released inside this button.
|
||||
pub fn clicked(&self, mx: i32, my: i32, mouse_released: bool) -> bool {
|
||||
self.visible && self.enabled && self.rect.contains(mx, my) && mouse_released
|
||||
}
|
||||
|
||||
pub fn draw(&self, renderer: &mut Renderer, fonts: &FontManager) {
|
||||
if !self.visible {
|
||||
return;
|
||||
}
|
||||
|
||||
let (mut c1, mut c2, mut bg, mut fg) = (self.color1, self.color2, self.back_color, self.fore_color);
|
||||
|
||||
if !self.enabled {
|
||||
c1 = dim_color(c1, self.disable_alpha);
|
||||
c2 = dim_color(c2, self.disable_alpha);
|
||||
bg = dim_color(bg, self.disable_alpha);
|
||||
fg = dim_color(fg, self.disable_alpha);
|
||||
} else if self.pressed {
|
||||
c1 = dim_color(c1, self.hover_alpha);
|
||||
c2 = dim_color(c2, self.hover_alpha);
|
||||
} else if !self.hovered {
|
||||
c1 = dim_color(c1, self.hover_alpha);
|
||||
c2 = dim_color(c2, self.hover_alpha);
|
||||
}
|
||||
|
||||
let r = self.rect;
|
||||
renderer.fill_gradient_v(r.x, r.y, r.w, r.h, c1, c2);
|
||||
renderer.draw_rect(r.x, r.y, r.w, r.h, bg);
|
||||
|
||||
// Measure text to centre it.
|
||||
let font_size = self.font_size;
|
||||
let (tw, th) = fonts.measure_text(&self.text, font_size);
|
||||
let tx = r.x + ((r.w as f32 - tw) / 2.0) as i32;
|
||||
let ty = r.y + ((r.h as f32 - th) / 2.0) as i32;
|
||||
|
||||
// Shadow.
|
||||
fonts.draw_text(renderer, tx + 1, ty + 1, &self.text, font_size, bg);
|
||||
// Foreground.
|
||||
fonts.draw_text(renderer, tx, ty, &self.text, font_size, fg);
|
||||
}
|
||||
}
|
||||
|
||||
fn dim_color(c: u32, alpha: f64) -> u32 {
|
||||
let r = (((c >> 16) & 0xFF) as f64 * alpha) as u8;
|
||||
let g = (((c >> 8) & 0xFF) as f64 * alpha) as u8;
|
||||
let b = ((c & 0xFF) as f64 * alpha) as u8;
|
||||
Renderer::rgb(r, g, b)
|
||||
}
|
||||
@@ -1,138 +0,0 @@
|
||||
use super::Rect;
|
||||
use crate::renderer::Renderer;
|
||||
|
||||
/// A software-rendered checkbox with a gray gradient, black outline, and white checkmark.
|
||||
pub struct ImageCheckBox {
|
||||
pub rect: Rect,
|
||||
pub checked: bool,
|
||||
pub enabled: bool,
|
||||
pub visible: bool,
|
||||
}
|
||||
|
||||
impl ImageCheckBox {
|
||||
pub fn new(x: i32, y: i32) -> Self {
|
||||
Self::with_size(x, y, 21)
|
||||
}
|
||||
|
||||
pub fn with_size(x: i32, y: i32, size: i32) -> Self {
|
||||
Self {
|
||||
rect: Rect::new(x, y, size, size),
|
||||
checked: true,
|
||||
enabled: true,
|
||||
visible: true,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn toggle_if_clicked(&mut self, mx: i32, my: i32, mouse_released: bool) -> bool {
|
||||
if self.visible && self.enabled && self.rect.contains(mx, my) && mouse_released {
|
||||
self.checked = !self.checked;
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
pub fn draw(&self, renderer: &mut Renderer) {
|
||||
if !self.visible {
|
||||
return;
|
||||
}
|
||||
|
||||
let r = self.rect;
|
||||
|
||||
// Gray gradient background (matching button style).
|
||||
let color1 = Renderer::rgb(118, 118, 118);
|
||||
let color2 = Renderer::rgb(81, 81, 81);
|
||||
renderer.fill_gradient_v(r.x, r.y, r.w, r.h, color1, color2);
|
||||
|
||||
// Black 1px outline.
|
||||
renderer.draw_rect(r.x, r.y, r.w, r.h, Renderer::rgb(0, 0, 0));
|
||||
|
||||
// White checkmark when checked.
|
||||
if self.checked {
|
||||
let white = Renderer::rgb(255, 255, 255);
|
||||
Self::draw_checkmark(renderer, r.x, r.y, r.w, r.h, white);
|
||||
}
|
||||
|
||||
if !self.enabled {
|
||||
// Dim overlay.
|
||||
for dy in 0..r.h {
|
||||
for dx in 0..r.w {
|
||||
renderer.blend_pixel(
|
||||
r.x + dx,
|
||||
r.y + dy,
|
||||
Renderer::rgb(50, 51, 51),
|
||||
100,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Draw a checkmark scaled to fit within the given box.
|
||||
fn draw_checkmark(renderer: &mut Renderer, bx: i32, by: i32, bw: i32, bh: i32, color: u32) {
|
||||
// Checkmark geometry defined in a normalised coordinate space.
|
||||
// The check goes from bottom-left, down to a valley, then up to top-right.
|
||||
// Key points (in fractions of size):
|
||||
// start: (0.20, 0.50)
|
||||
// valley: (0.40, 0.72)
|
||||
// end: (0.80, 0.25)
|
||||
// We draw two thick line segments between these points.
|
||||
|
||||
let w = bw as f32;
|
||||
let h = bh as f32;
|
||||
|
||||
// Absolute coordinates of the three key points.
|
||||
let x0 = bx as f32 + w * 0.20;
|
||||
let y0 = by as f32 + h * 0.48;
|
||||
let x1 = bx as f32 + w * 0.40;
|
||||
let y1 = by as f32 + h * 0.72;
|
||||
let x2 = bx as f32 + w * 0.80;
|
||||
let y2 = by as f32 + h * 0.25;
|
||||
|
||||
// Line thickness scales with checkbox size.
|
||||
let thickness = (w * 0.14).max(1.5);
|
||||
|
||||
draw_thick_line(renderer, x0, y0, x1, y1, thickness, color);
|
||||
draw_thick_line(renderer, x1, y1, x2, y2, thickness, color);
|
||||
}
|
||||
}
|
||||
|
||||
/// Draw a thick line between two points using filled circles along the path (round caps).
|
||||
fn draw_thick_line(
|
||||
renderer: &mut Renderer,
|
||||
x0: f32,
|
||||
y0: f32,
|
||||
x1: f32,
|
||||
y1: f32,
|
||||
thickness: f32,
|
||||
color: u32,
|
||||
) {
|
||||
let dx = x1 - x0;
|
||||
let dy = y1 - y0;
|
||||
let dist = (dx * dx + dy * dy).sqrt();
|
||||
let steps = (dist * 2.0).ceil() as i32;
|
||||
let half = thickness / 2.0;
|
||||
|
||||
for i in 0..=steps {
|
||||
let t = i as f32 / steps.max(1) as f32;
|
||||
let cx = x0 + dx * t;
|
||||
let cy = y0 + dy * t;
|
||||
|
||||
// Fill a small circle at (cx, cy).
|
||||
let min_x = (cx - half).floor() as i32;
|
||||
let max_x = (cx + half).ceil() as i32;
|
||||
let min_y = (cy - half).floor() as i32;
|
||||
let max_y = (cy + half).ceil() as i32;
|
||||
let r_sq = half * half;
|
||||
|
||||
for py in min_y..=max_y {
|
||||
for px in min_x..=max_x {
|
||||
let fdx = px as f32 + 0.5 - cx;
|
||||
let fdy = py as f32 + 0.5 - cy;
|
||||
if fdx * fdx + fdy * fdy <= r_sq {
|
||||
renderer.set_pixel(px, py, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
use super::Rect;
|
||||
use crate::font::FontManager;
|
||||
use crate::renderer::Renderer;
|
||||
|
||||
/// Simple static label for drawing text with optional word-wrapping.
|
||||
pub struct Label {
|
||||
pub rect: Rect,
|
||||
pub text: String,
|
||||
pub color: u32,
|
||||
pub font_size: f32,
|
||||
pub line_spacing: f32,
|
||||
pub visible: bool,
|
||||
/// If > 0, text is word-wrapped to this pixel width.
|
||||
pub max_width: f32,
|
||||
}
|
||||
|
||||
impl Label {
|
||||
pub fn new(x: i32, y: i32, text: &str, font_size: f32) -> Self {
|
||||
Self {
|
||||
rect: Rect::new(x, y, 0, 0),
|
||||
text: text.to_string(),
|
||||
color: Renderer::rgb(245, 245, 245),
|
||||
font_size,
|
||||
line_spacing: 2.0,
|
||||
visible: true,
|
||||
max_width: 0.0,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn draw(&self, renderer: &mut Renderer, fonts: &FontManager) {
|
||||
if !self.visible || self.text.is_empty() {
|
||||
return;
|
||||
}
|
||||
fonts.draw_text_multiline(
|
||||
renderer,
|
||||
self.rect.x,
|
||||
self.rect.y,
|
||||
&self.text,
|
||||
self.font_size,
|
||||
self.color,
|
||||
self.line_spacing,
|
||||
self.max_width,
|
||||
);
|
||||
}
|
||||
|
||||
/// Check if a click at (mx, my) is within a rough bounding box of the label text.
|
||||
pub fn clicked(&self, mx: i32, my: i32, mouse_released: bool, fonts: &FontManager) -> bool {
|
||||
if !self.visible || !mouse_released {
|
||||
return false;
|
||||
}
|
||||
let (tw, th) = fonts.measure_text_multiline(
|
||||
&self.text,
|
||||
self.font_size,
|
||||
self.line_spacing,
|
||||
self.max_width,
|
||||
);
|
||||
let r = Rect::new(self.rect.x, self.rect.y, tw as i32 + 5, th as i32);
|
||||
r.contains(mx, my)
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
pub mod button;
|
||||
pub mod checkbox;
|
||||
pub mod label;
|
||||
pub mod progress_bar;
|
||||
|
||||
/// A rectangle region on screen.
|
||||
#[derive(Clone, Copy, Debug, Default)]
|
||||
pub struct Rect {
|
||||
pub x: i32,
|
||||
pub y: i32,
|
||||
pub w: i32,
|
||||
pub h: i32,
|
||||
}
|
||||
|
||||
impl Rect {
|
||||
pub const fn new(x: i32, y: i32, w: i32, h: i32) -> Self {
|
||||
Self { x, y, w, h }
|
||||
}
|
||||
|
||||
pub fn contains(&self, px: i32, py: i32) -> bool {
|
||||
px >= self.x && px < self.x + self.w && py >= self.y && py < self.y + self.h
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
use super::Rect;
|
||||
use crate::renderer::Renderer;
|
||||
|
||||
/// A smooth gradient progress bar matching the C# SmoothProgressBar control.
|
||||
pub struct ProgressBar {
|
||||
pub rect: Rect,
|
||||
pub minimum: i32,
|
||||
pub maximum: i32,
|
||||
pub value: i32,
|
||||
pub color1: u32,
|
||||
pub color2: u32,
|
||||
pub visible: bool,
|
||||
}
|
||||
|
||||
impl ProgressBar {
|
||||
pub fn new(x: i32, y: i32, w: i32, h: i32) -> Self {
|
||||
Self {
|
||||
rect: Rect::new(x, y, w, h),
|
||||
minimum: 0,
|
||||
maximum: 100,
|
||||
value: 0,
|
||||
color1: Renderer::rgb(97, 147, 232),
|
||||
color2: Renderer::rgb(28, 99, 232),
|
||||
visible: true,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn draw(&self, renderer: &mut Renderer) {
|
||||
if !self.visible {
|
||||
return;
|
||||
}
|
||||
let range = (self.maximum - self.minimum).max(1) as f32;
|
||||
let percent = (self.value - self.minimum) as f32 / range;
|
||||
let fill_w = (self.rect.w as f32 * percent) as i32;
|
||||
|
||||
if fill_w > 0 {
|
||||
renderer.fill_gradient_h(
|
||||
self.rect.x,
|
||||
self.rect.y,
|
||||
fill_w,
|
||||
self.rect.h,
|
||||
self.color1,
|
||||
self.color2,
|
||||
);
|
||||
}
|
||||
|
||||
// 3-D border.
|
||||
let r = self.rect;
|
||||
let dark = Renderer::rgb(105, 105, 105);
|
||||
let light = Renderer::rgb(255, 255, 255);
|
||||
// Top
|
||||
for dx in 0..r.w {
|
||||
renderer.set_pixel(r.x + dx, r.y, dark);
|
||||
}
|
||||
// Left
|
||||
for dy in 0..r.h {
|
||||
renderer.set_pixel(r.x, r.y + dy, dark);
|
||||
}
|
||||
// Bottom
|
||||
for dx in 0..r.w {
|
||||
renderer.set_pixel(r.x + dx, r.y + r.h - 1, light);
|
||||
}
|
||||
// Right
|
||||
for dy in 0..r.h {
|
||||
renderer.set_pixel(r.x + r.w - 1, r.y + dy, light);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
[package]
|
||||
name = "clean_flash_uninstaller"
|
||||
version = "34.0.0"
|
||||
edition = "2021"
|
||||
authors = ["FlashPatch Team"]
|
||||
|
||||
[dependencies]
|
||||
clean_flash_common = { path = "../clean_flash_common" }
|
||||
clean_flash_ui = { path = "../clean_flash_ui" }
|
||||
minifb = { workspace = true }
|
||||
windows-sys = { workspace = true }
|
||||
|
||||
[build-dependencies]
|
||||
winresource = "0.1"
|
||||
@@ -1,41 +0,0 @@
|
||||
fn main() {
|
||||
if cfg!(target_os = "windows") {
|
||||
let mut res = winresource::WindowsResource::new();
|
||||
if std::path::Path::new("../../resources/icon.ico").exists() {
|
||||
res.set_icon("../../resources/icon.ico");
|
||||
}
|
||||
res.set("ProductName", "Clean Flash Player Uninstaller");
|
||||
res.set("FileDescription", "Clean Flash Player Uninstaller");
|
||||
res.set("ProductVersion", "34.0.0.330");
|
||||
res.set("CompanyName", "FlashPatch Team");
|
||||
res.set("LegalCopyright", "FlashPatch Team");
|
||||
res.set_manifest(r#"<?xml version="1.0" encoding="utf-8"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<assemblyIdentity version="1.0.0.0" name="CleanFlashUninstaller.app"/>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
|
||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
|
||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
|
||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
|
||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
|
||||
</application>
|
||||
</compatibility>
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
|
||||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
</assembly>
|
||||
"#);
|
||||
let _ = res.compile();
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
#![windows_subsystem = "windows"]
|
||||
|
||||
mod uninstall_form;
|
||||
|
||||
use clean_flash_ui::renderer::Renderer;
|
||||
use minifb::{Key, MouseButton, MouseMode, Window, WindowOptions};
|
||||
use uninstall_form::{UninstallForm, HEIGHT, WIDTH};
|
||||
|
||||
fn main() {
|
||||
let title = format!(
|
||||
"Clean Flash Player {} Uninstaller",
|
||||
clean_flash_common::update_checker::FLASH_VERSION
|
||||
);
|
||||
|
||||
let scale = clean_flash_ui::get_dpi_scale();
|
||||
let phys_w = (WIDTH as f32 * scale).round() as usize;
|
||||
let phys_h = (HEIGHT as f32 * scale).round() as usize;
|
||||
|
||||
let mut window = Window::new(
|
||||
&title,
|
||||
phys_w,
|
||||
phys_h,
|
||||
WindowOptions {
|
||||
resize: false,
|
||||
..WindowOptions::default()
|
||||
},
|
||||
)
|
||||
.expect("Failed to create window");
|
||||
|
||||
// Set window icon from the resource embedded by build.rs.
|
||||
clean_flash_ui::set_window_icon(&window);
|
||||
|
||||
window.set_target_fps(60);
|
||||
|
||||
let mut renderer = Renderer::new(phys_w, phys_h);
|
||||
let mut form = UninstallForm::new(scale);
|
||||
|
||||
while window.is_open() && !window.is_key_down(Key::Escape)
|
||||
&& !(window.is_key_down(Key::F4)
|
||||
&& (window.is_key_down(Key::LeftAlt) || window.is_key_down(Key::RightAlt)))
|
||||
{
|
||||
let (mx, my) = window
|
||||
.get_mouse_pos(MouseMode::Clamp)
|
||||
.unwrap_or((0.0, 0.0));
|
||||
let mouse_down = window.get_mouse_down(MouseButton::Left);
|
||||
|
||||
form.update_and_draw(&mut renderer, mx as i32, my as i32, mouse_down);
|
||||
|
||||
window
|
||||
.update_with_buffer(&renderer.buffer, phys_w, phys_h)
|
||||
.expect("Failed to update window buffer");
|
||||
}
|
||||
}
|
||||
@@ -1,292 +0,0 @@
|
||||
use clean_flash_common::{redirection, uninstaller, update_checker, ProgressCallback};
|
||||
use clean_flash_ui::font::FontManager;
|
||||
use clean_flash_ui::renderer::Renderer;
|
||||
use clean_flash_ui::widgets::button::GradientButton;
|
||||
use clean_flash_ui::widgets::label::Label;
|
||||
use clean_flash_ui::widgets::progress_bar::ProgressBar;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
pub const WIDTH: usize = 712;
|
||||
pub const HEIGHT: usize = 329;
|
||||
const BG_COLOR: u32 = 0x00323333; // RGB(50, 51, 51)
|
||||
const FG_COLOR: u32 = 0x00F5F5F5;
|
||||
const PANEL_X: i32 = 90;
|
||||
const PANEL_Y: i32 = 162;
|
||||
|
||||
const BEFORE_TEXT: &str = "You are about to uninstall Clean Flash Player.\n\
|
||||
Please close all browsers, including Google Chrome, Mozilla Firefox and Internet Explorer.\n\n\
|
||||
The installer will completely remove all versions of Flash Player from this computer,\n\
|
||||
including Clean Flash Player and older versions of Adobe Flash Player.";
|
||||
|
||||
const COMPLETE_TEXT: &str = "\nAll versions of Flash Player have been successfully uninstalled.\n\n\
|
||||
If you ever change your mind, check out Clean Flash Player's website!";
|
||||
|
||||
const UNINSTALL_TICKS: i32 = 10;
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||
enum Panel {
|
||||
BeforeInstall,
|
||||
Install,
|
||||
Complete,
|
||||
Failure,
|
||||
}
|
||||
|
||||
struct ProgressState {
|
||||
label: String,
|
||||
value: i32,
|
||||
done: bool,
|
||||
error: Option<String>,
|
||||
}
|
||||
|
||||
pub struct UninstallForm {
|
||||
scale: f32,
|
||||
panel: Panel,
|
||||
title_text: String,
|
||||
subtitle_text: String,
|
||||
flash_logo_cache: clean_flash_ui::flash_logo::FlashLogoCache,
|
||||
prev_button: GradientButton,
|
||||
next_button: GradientButton,
|
||||
// Before uninstall
|
||||
before_label: Label,
|
||||
// Install (progress)
|
||||
progress_header: Label,
|
||||
progress_label: Label,
|
||||
progress_bar: ProgressBar,
|
||||
// Complete
|
||||
complete_label: Label,
|
||||
// Failure
|
||||
failure_text_label: Label,
|
||||
failure_detail: String,
|
||||
copy_error_button: GradientButton,
|
||||
// State
|
||||
progress_state: Arc<Mutex<ProgressState>>,
|
||||
fonts: FontManager,
|
||||
prev_mouse_down: bool,
|
||||
}
|
||||
|
||||
impl UninstallForm {
|
||||
pub fn new(scale: f32) -> Self {
|
||||
let s = |v: i32| (v as f32 * scale).round() as i32;
|
||||
let sf = |v: f32| v * scale;
|
||||
let lbl = |x: i32, y: i32, text: &str, size: f32| {
|
||||
let mut l = Label::new(s(x), s(y), text, sf(size));
|
||||
l.line_spacing = sf(2.0);
|
||||
l.max_width = sf((WIDTH as i32 - x - 10) as f32);
|
||||
l
|
||||
};
|
||||
let btn = |x: i32, y: i32, w: i32, h: i32, text: &str| GradientButton {
|
||||
font_size: sf(13.0),
|
||||
..GradientButton::new(s(x), s(y), s(w), s(h), text)
|
||||
};
|
||||
|
||||
let version = update_checker::FLASH_VERSION;
|
||||
|
||||
let fonts = FontManager::new();
|
||||
|
||||
Self {
|
||||
scale,
|
||||
panel: Panel::BeforeInstall,
|
||||
title_text: "Clean Flash Player".into(),
|
||||
subtitle_text: format!("built from version {} (China)", version),
|
||||
flash_logo_cache: clean_flash_ui::flash_logo::FlashLogoCache::new(),
|
||||
prev_button: btn(90, 286, 138, 31, "QUIT"),
|
||||
next_button: btn(497, 286, 138, 31, "UNINSTALL"),
|
||||
before_label: lbl(PANEL_X + 3, PANEL_Y + 2, BEFORE_TEXT, 15.0),
|
||||
progress_header: lbl(PANEL_X + 3, PANEL_Y, "Uninstallation in progress...", 15.0),
|
||||
progress_label: lbl(PANEL_X + 46, PANEL_Y + 30, "Preparing...", 15.0),
|
||||
progress_bar: ProgressBar::new(s(PANEL_X + 49), s(PANEL_Y + 58), s(451), s(23)),
|
||||
complete_label: lbl(PANEL_X, PANEL_Y, COMPLETE_TEXT, 15.0),
|
||||
failure_text_label: lbl(
|
||||
PANEL_X + 3,
|
||||
PANEL_Y + 2,
|
||||
"Oops! The installation process has encountered an unexpected problem.\n\
|
||||
The following details could be useful. Press the Retry button to try again.",
|
||||
15.0,
|
||||
),
|
||||
failure_detail: String::new(),
|
||||
copy_error_button: btn(PANEL_X + 441, PANEL_Y + 58, 104, 31, "COPY"),
|
||||
progress_state: Arc::new(Mutex::new(ProgressState {
|
||||
label: "Preparing...".into(),
|
||||
value: 0,
|
||||
done: false,
|
||||
error: None,
|
||||
})),
|
||||
fonts,
|
||||
prev_mouse_down: false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn update_and_draw(
|
||||
&mut self,
|
||||
renderer: &mut Renderer,
|
||||
mx: i32,
|
||||
my: i32,
|
||||
mouse_down: bool,
|
||||
) {
|
||||
let mouse_released = self.prev_mouse_down && !mouse_down;
|
||||
self.prev_mouse_down = mouse_down;
|
||||
|
||||
self.prev_button.update(mx, my, mouse_down);
|
||||
self.next_button.update(mx, my, mouse_down);
|
||||
|
||||
// Handle clicks.
|
||||
if self.prev_button.clicked(mx, my, mouse_released) {
|
||||
std::process::exit(0);
|
||||
}
|
||||
if self.next_button.clicked(mx, my, mouse_released) {
|
||||
match self.panel {
|
||||
Panel::BeforeInstall | Panel::Failure => self.start_uninstall(),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
// Panel-specific input.
|
||||
if self.panel == Panel::Failure {
|
||||
self.copy_error_button.update(mx, my, mouse_down);
|
||||
if self.copy_error_button.clicked(mx, my, mouse_released) {
|
||||
let _ = std::process::Command::new("cmd")
|
||||
.args(["/C", &format!("echo {} | clip", self.failure_detail)])
|
||||
.output();
|
||||
}
|
||||
}
|
||||
|
||||
// Poll progress.
|
||||
if self.panel == Panel::Install {
|
||||
self.poll_progress();
|
||||
}
|
||||
|
||||
// Draw.
|
||||
renderer.clear(BG_COLOR);
|
||||
self.flash_logo_cache.draw(
|
||||
renderer, self.s(90), self.s(36), self.s(109), self.s(107),
|
||||
);
|
||||
|
||||
self.fonts
|
||||
.draw_text(renderer, self.s(233), self.s(54), &self.title_text, self.sf(32.0), FG_COLOR);
|
||||
self.fonts
|
||||
.draw_text(renderer, self.s(280), self.s(99), &self.subtitle_text, self.sf(17.0), FG_COLOR);
|
||||
|
||||
// Separator.
|
||||
renderer.fill_rect(0, self.s(270), renderer.width as i32, self.s(1).max(1), 0x00696969);
|
||||
|
||||
match self.panel {
|
||||
Panel::BeforeInstall => self.before_label.draw(renderer, &self.fonts),
|
||||
Panel::Install => {
|
||||
self.progress_header.draw(renderer, &self.fonts);
|
||||
self.progress_label.draw(renderer, &self.fonts);
|
||||
self.progress_bar.draw(renderer);
|
||||
}
|
||||
Panel::Complete => self.complete_label.draw(renderer, &self.fonts),
|
||||
Panel::Failure => {
|
||||
self.failure_text_label.draw(renderer, &self.fonts);
|
||||
let detail = if self.failure_detail.len() > 300 {
|
||||
&self.failure_detail[..300]
|
||||
} else {
|
||||
&self.failure_detail
|
||||
};
|
||||
self.fonts.draw_text_multiline(
|
||||
renderer,
|
||||
self.s(PANEL_X + 4),
|
||||
self.s(PANEL_Y + 44),
|
||||
detail,
|
||||
self.sf(11.0),
|
||||
FG_COLOR,
|
||||
self.sf(1.0),
|
||||
self.sf((WIDTH as i32 - PANEL_X - 14) as f32),
|
||||
);
|
||||
self.copy_error_button.draw(renderer, &self.fonts);
|
||||
}
|
||||
}
|
||||
|
||||
self.prev_button.draw(renderer, &self.fonts);
|
||||
self.next_button.draw(renderer, &self.fonts);
|
||||
}
|
||||
|
||||
fn s(&self, v: i32) -> i32 { (v as f32 * self.scale).round() as i32 }
|
||||
fn sf(&self, v: f32) -> f32 { v * self.scale }
|
||||
|
||||
fn start_uninstall(&mut self) {
|
||||
self.panel = Panel::Install;
|
||||
self.prev_button.enabled = false;
|
||||
self.next_button.visible = false;
|
||||
self.progress_bar.maximum = UNINSTALL_TICKS;
|
||||
self.progress_bar.value = 0;
|
||||
|
||||
{
|
||||
let mut state = self.progress_state.lock().unwrap();
|
||||
state.label = "Preparing...".into();
|
||||
state.value = 0;
|
||||
state.done = false;
|
||||
state.error = None;
|
||||
}
|
||||
|
||||
let progress = Arc::clone(&self.progress_state);
|
||||
std::thread::spawn(move || {
|
||||
let callback = ThreadProgressCallback {
|
||||
state: Arc::clone(&progress),
|
||||
};
|
||||
|
||||
let redir = redirection::disable_redirection();
|
||||
let result = uninstaller::uninstall(&callback);
|
||||
redirection::enable_redirection(redir);
|
||||
|
||||
let mut state = progress.lock().unwrap();
|
||||
if let Err(e) = result {
|
||||
state.error = Some(e.to_string());
|
||||
}
|
||||
state.done = true;
|
||||
});
|
||||
}
|
||||
|
||||
fn poll_progress(&mut self) {
|
||||
let state = self.progress_state.lock().unwrap();
|
||||
self.progress_label.text = state.label.clone();
|
||||
self.progress_bar.value = state.value;
|
||||
|
||||
if state.done {
|
||||
if let Some(ref err) = state.error {
|
||||
self.failure_detail = err.clone();
|
||||
drop(state);
|
||||
self.open_failure();
|
||||
} else {
|
||||
drop(state);
|
||||
self.open_complete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn open_complete(&mut self) {
|
||||
self.panel = Panel::Complete;
|
||||
self.prev_button.text = "QUIT".into();
|
||||
self.prev_button.enabled = true;
|
||||
self.next_button.visible = false;
|
||||
}
|
||||
|
||||
fn open_failure(&mut self) {
|
||||
self.panel = Panel::Failure;
|
||||
self.prev_button.text = "QUIT".into();
|
||||
self.prev_button.enabled = true;
|
||||
self.next_button.text = "RETRY".into();
|
||||
self.next_button.visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
struct ThreadProgressCallback {
|
||||
state: Arc<Mutex<ProgressState>>,
|
||||
}
|
||||
|
||||
impl ProgressCallback for ThreadProgressCallback {
|
||||
fn update_progress_label(&self, text: &str, tick: bool) {
|
||||
let mut state = self.state.lock().unwrap();
|
||||
state.label = text.to_string();
|
||||
if tick {
|
||||
state.value += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn tick_progress(&self) {
|
||||
let mut state = self.state.lock().unwrap();
|
||||
state.value += 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 115 KiB |