logo
down
shadow

Password protected uninstallation using Inno Setup


Password protected uninstallation using Inno Setup

By : user3851966
Date : October 15 2020, 11:12 AM
hope this fix your issue Some Inno Setup users require that the user who wants to uninstall the software is asked for a password before this is possible. Anti virus software might be a candidate for this requirement, for instance. The code below shows how to create a form, ask for a password, and uninstall the software only if the password is correct. This method is very weak, it's easy to find out the password. So, someone who wants to use this strategy to protect his software from uninstallation needs to code something safer. If the user wants to uninstall and doesn't know the password files could be deleted anyway from the application's folder. In this sample the uninstall password is removeme.
code :


Share : facebook icon twitter icon
How can I set the exit code of uninstallation in Inno-Setup?

How can I set the exit code of uninstallation in Inno-Setup?


By : Hugh
Date : March 29 2020, 07:55 AM
like below fixes the issue One possibility is to Implement your own Pascal Script. Probably in DeinitializeUninstall() event, (check the manual to know exactly in which step you want it), you can add these code:
code :
[Code]
var error: Boolean;

procedure ExitProcess(exitCode:integer);
  external 'ExitProcess@kernel32.dll stdcall';

procedure TheEventYouFeelIsBetterHere():
begin
 if error then begin
   MsgBox('Installation Failed!', mbError, MB_OK);
   ExitProcess(1);
 end;
end;
Problems in deleting a Folder during the uninstallation with Inno Setup

Problems in deleting a Folder during the uninstallation with Inno Setup


By : user2639934
Date : March 29 2020, 07:55 AM
With these it helps When you use a constant in code, you need to use the ExpandConstant function. So your Deltree command should be:
How to extract password protected files from FreeArc archive using Inno Setup?

How to extract password protected files from FreeArc archive using Inno Setup?


By : dexter182
Date : March 29 2020, 07:55 AM
around this issue See the (Russian) FreeArc command-line documentation.
It seems the argument to use is -p password.
Inno Setup: Reading a file from installer during uninstallation

Inno Setup: Reading a file from installer during uninstallation


By : celery w
Date : March 29 2020, 07:55 AM
With these it helps Correct, the ExtractTemporaryFile extracts files from the installer. Therefore it cannot work in the uninstaller as the installer is not available anymore.
Also note that you cannot extract the file referenced to by the WizardSmallImageFile directive from the installer anyway. You have to add your own copy.
code :
[Files]
Source: "WizardSmallImageFile.bmp"; DestDir: "{app}";

[Code]

function InitializeUninstall(): Boolean;
begin
  ...
  BitmapImage := TBitmapImage.Create(...);
  ...
  BitmapImage.Bitmap.LoadFromFile(ExpandConstant('{app}\WizardSmallImageFile.bmp'));
  ...
end;
function CryptStringToBinary(
  sz: string; cch: LongWord; flags: LongWord; binary: string; var size: LongWord;
  skip: LongWord; flagsused: LongWord): Integer;
  external 'CryptStringToBinaryW@crypt32.dll stdcall';

const
  CRYPT_STRING_HEX = $04;

procedure WriteBinaryStringToStream(S: string; Stream: TStream);
var
  Buffer: string;
  Size: LongWord;
begin
  SetLength(Buffer, (Length(S) div 4) + 1);
  Size := Length(S) div 2;
  if (CryptStringToBinary(S, Length(S), CRYPT_STRING_HEX, Buffer, Size, 0, 0) = 0) or
     (Size <> Length(S) div 2) then
  begin
    RaiseException('Error decoding binary string');
  end;

  Stream.WriteBuffer(Buffer, Size);
end;  

function StreamFromBinaryString(S: string): TStream;
begin
  Result := TStringStream.Create('');
  WriteBinaryStringToStream(S, Result);
  Result.Position := 0;
end;

procedure LoadBitmapFromBinaryString(Bitmap: TBitmap; S: string);
var
  Stream: TStream;
begin
  Stream := StreamFromBinaryString(S);
  try
    Bitmap.LoadFromStream(Stream);
  finally
    Stream.Free;
  end;
end;

procedure SaveBinaryStringToFile(FileName: string; S: string);
var
  Stream: TStream;
begin
  Stream := TFileStream.Create(FileName, fmCreate);
  try
    WriteBinaryStringToStream(S, Stream);
  finally
    Stream.Free;
  end;
end;

#define FileToBinaryString(str FileName) \
  Local[4] = ExtractFileName(FileName), \
  Local[0] = AddBackslash(GetEnv("TEMP")) + Local[4] + ".pas", \
  Local[1] = \
    "-ExecutionPolicy Bypass -Command """ + \
    "Write-Host 'Generating code for " + Local[4] + "'; " + \
    "$bytes = [System.IO.File]::ReadAllBytes('" + FileName + "'); " + \
    "$s = '''' + (($bytes | foreach { $_.ToString('X2') }) -join '') + ''''; " + \
    "Set-Content -Path '" + Local[0] + "' -Value $s;" + \
    """", \
  Exec("powershell.exe", Local[1], SourcePath, , SW_HIDE), \
  Local[2] = FileOpen(Local[0]), \
  Local[3] = FileRead(Local[2]), \
  FileClose(Local[2]), \
  DeleteFileNow(Local[0]), \
  Local[3]
'4D5A50000200000004000F00FFFF0000B800000....'
LoadBitmapFromBinaryString(
  BitmapImage.Bitmap, {#FileToBinaryString("C:\path\WizModernSmallImage.bmp")});
LoadBitmapFromBinaryString(
  BitmapImage.Bitmap, '4D5A50000200000004000F00FFFF0000B800000....');
Running code only after successful uninstallation in Inno Setup

Running code only after successful uninstallation in Inno Setup


By : user7383601
Date : March 29 2020, 07:55 AM
it should still fix some issue I believe your logic is wrong. It looks like XY problem.
I do not think, that you want to detect "No". I believe, you want to run the code during or after uninstallation.
code :
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep = usDone then
  begin
    { ... }
  end;
end;
Related Posts Related Posts :
  • weight update of one random layer in multilayer neural network using backpagation?
  • Find most recent date in a list of objects on LocalDate property using Java 8 stream
  • deflateSetDictionary usage
  • Getting Me using Azure OAuth 2 Token
  • How do I get an Aspara Video playauth?
  • Avoiding memory leaks with Commanded in an aggregate that doesn't produce an event
  • Terraform: How to get a boolean from interpolation?
  • How can I disable shift (or any modifier) for some keys but not for others?
  • How to access component model from outside
  • Formatting decimal output when multiplying all numerical values in a string?
  • How to solve the numerical instability to a solution of a system of ordinary differential equations
  • How can I determine if a row has changed?
  • Inherited software that's built on Visual FoxPro, How can I access the source files and edit the program as needed?
  • Problem accessing orion-psb-image-R5.4 on FIWARE Lab using ssh
  • Check if List of Matrix Indexes are adjacent
  • View availability message on summary page Cart
  • Spring AMQP RabbitMQ RPC - Queue with with some messages that do not expect a response
  • App Pool Login Failed Message in New Acumatica Version
  • New-AzureRmSqlDatabaseImport does not accept a DatabaseMaxSizeBytes greater than 5GB
  • How to get the list of queues from a server?
  • Maxima plot discrete data with 3 columns
  • Referencing field from input in a Logstash filter
  • Chapel : Understanding lifetime of managed classes with zip and user-defined iterators
  • Compile With Static Library Using GNAT
  • Is there a way to receive most messages out of the standard SQS Queue? [NOT FIFO]
  • Remove shadow from XFCE panel
  • How do I serialize TransactionBuilder
  • How to disable Rule: one-line in TSLint
  • Automatically Ignore @OneToMany, @ManyToOne
  • Accidently renamed libc.so.6 and cannot chroot within rescue mode
  • A proper way to serialize/deserialize Xodus-dnq entity
  • How to hide the overlays in A frame?
  • PRelue is not supperted with mmdnn?
  • JasperReports: How to pass parameter to subReport
  • Is there built-in web analytics tool in Liferay?
  • 'if' scenario in an equation. How do I implement it?
  • Uncaught [CKEDITOR.editor] The instance "html" already exists
  • Trimming variable in CLLE
  • Slot not being passed from action to layout in Symfony 1.4
  • Are there any disadvantages of using C# 3.0 features?
  • How to download paypal transactions using some API
  • Microsoft CRM could not log you on to the system. Make sure your user record
  • Good acceleration structure for ray sphere tests with spheres that move
  • Draw formatted rich text
  • How can I sum values in column based on the value in another column?
  • JBoss eventually stops responding to request, but no OOME
  • Prevent inline-block from wrapping on white-space: pre?
  • Neural Network Recommendation Engine
  • Getting the return value of an exec process
  • Dynamics CRM: Create users with specific GUIDs
  • Languages used to write programs for satellite-missions?
  • is it possible to use only two semaphores to synchronise three or more threads?
  • Opengl ES - drawing a plane of multiple vertices
  • Make Aptana never use Windows line endings
  • Stub property and save other behaviour
  • What would you call "callback" or "closure" in general?
  • Drag a bezier curve to edit it
  • Archive/Compress Command FTP Through Terminal?
  • how can I use curly braces in a mysql query?
  • or operator in vbscript
  • shadow
    Privacy Policy - Terms - Contact Us © bighow.org