View Single Post
  #1370  
Old 13-11-2019, 09:00
artexjay artexjay is offline
Registered User
 
Join Date: Nov 2019
Location: Canada
Posts: 4
Thanks: 1
Thanked 2 Times in 2 Posts
artexjay is on a distinguished road
Inno Uninshs issue

Hello all,

I'm quite new to inno setup and new here as well. I have been having trouble with one of inno's addons mainly the uninshs. It's supposed to modify the uninstaller so that it prompts the user if they want to modify, repair or remove the program.

So the issue I'm having is that when i try to uninstall it doesn't do anything it simply closes the uninstaller but no files are removed. I did my best to follow the readme for properly adding it to the inno setup.

My setup simply installs the default inno myprog.exe. Im trying to understand the addons better first. I haven't done any compression tests yet.

This is what i have so far in my code:

Code:
; Script generated by the Inno Script Studio Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "My Program"
#define MyAppVersion "1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "MyProg.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{413F3F57-3FFB-4B22-B47C-1D9DE9772114}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={commonpf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=mysetup
Compression=lzma
SolidCompression=yes
DisableWelcomePage=False
ShowTasksTreeLines=True
WizardResizable = Yes

#define Use_UninsHs_Default_CustomMessages
#include "uninshs.iss"

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Components]
Name: main; Description: "Main"; Types: full compact custom; Flags: fixed

[Files]

Source: "C:\Users\artex\AppData\Local\Programs\Inno Setup 6\Examples\MyProg.exe"; DestDir: "{app}";
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: shellexec skipifdoesntexist nowait skipifsilent postinstall;           \
Check: UninsHs_IsInstallation();

[Codes] //change to [Code (in inno)]
{ RedesignWizardFormBegin } // Don't remove this line!
// Don't modify this section. It is generated automatically.
procedure RedesignWizardForm;
begin
  with WizardForm do
  begin
    AutoScroll := False;
    ClientHeight := ScaleY(366);
    ClientWidth := ScaleX(500);
  end;

  with WizardForm.NextButton do
  begin
    Left := ScaleX(388);
    Top := ScaleY(330);
  end;

  with WizardForm.ProgressGauge do
  begin
    Height := ScaleY(13);
  end;

  with WizardForm.CancelButton do
  begin
    Left := ScaleX(32);
    Top := ScaleY(330);
  end;

  with WizardForm.BackButton do
  begin
    Left := ScaleX(300);
    Top := ScaleY(330);
  end;

{ ReservationBegin }
  // This part is for you. Add your specialized code here.

{ ReservationEnd }
end;
// Don't modify this section. It is generated automatically.
{ RedesignWizardFormEnd } // Don't remove this line!

procedure InitializeWizard();
begin
  UninsHs_InitializeWizard();
  RedesignWizardForm;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  UninsHs_CurPageChanged(CurPageID);
end;

function ShouldSkipPage(CurPageId: Integer): Boolean;
begin
  Result := False;
  UninsHs_ShouldSkipPage(CurPageId, Result);
end;

function NextButtonClick(CurPageID: Integer): Boolean;
begin
  Result := True;
  UninsHs_NextButtonClick(CurPageID, Result);
end;

procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
  UninsHs_CancelButtonClick(CurPageID, Cancel, Confirm);
end;

function InitializeUninstall(): Boolean;
begin
  Result := True;
  UninsHs_InitializeUninstall(Result);
end;
Any help would be appreciated. Thank you

Last edited by artexjay; 13-11-2019 at 09:08.
Reply With Quote