Usages

0. Prepartory step

Copy the file UninsHs.exe to your application setup directory.

1. [Languages] section

Add this line:

Name: en; MessagesFile: compiler:Default.isl

If you want to support other languages - French, for example, add this line too:

Name: fr; MessagesFile: compiler:French.isl

Here are the supported languages(Add your language):

English(en), Simplified Chinese(chs), Traditional Chinese(cht), Deutsch(de), Swedish(se), Indonesian(in), Portuguese - Brasil(br), Polish(pl), Dutch(nl), Italian(it), Spanish(es), Greek(gr), Portuguese - Portugal(pt), Japanese(jp), French(fr), Russian(ru), Ukrainian(uk), Hungarian(hu), Romania(ro), Danish(da), Turkish(tr), Czech(cz), Finnish(fi), Norwegian(no), Persian - Farsi(fa)

2. [Files] section

Add this line (If the DestDir of UninsHs is not {app}, please change the {app} to your directory):

Source: "UninsHs.exe"; DestDir: "{app}"; Flags: restartreplace

3. [Setup] section

For Inno Setup 4.2.4 or later, add this line (If the DestDir of UninsHs is not {app} in [Files] section, please change the {app} to your directory):

AppModifyPath="{app}\UninsHs.exe" /m0=AppId

Note: Customize this line with your AppId (If you don't use AppId, customize the AppId with your AppName), and customize the parameters, see also the "Command line options" in FAQs.

4. [Icons] section

Delete this old line that creates an uninstall icon in the start menu:

Name: "{group}\Uninstall AppName"; Filename: "{uninstallexe}"

Add this line if you want an uninstall icon in the start menu (If the DestDir of UninsHs is not {app} in [Files] section, please change the {app} to your directory ):

Name: "{group}\Uninstall AppName"; Filename: "{app}\UninsHs.exe"; \
  Parameters: /u0=AppId

Note: Customize this line with your AppName and AppId (If you don't use AppId, customize the AppId with your AppName), and customize the parameters, see also the "Command line options" in FAQs.

5. [Run] section

Add this line (If the DestDir of UninsHs is not {app} in [Files] section, please change the {app} to your directory):

Filename: {app}\UninsHs.exe; \
  Parameters: /r0=AppId,{language},{srcexe}; Flags: runminimized

Note: Customize this line with your AppId (If you don't use AppId, customize the AppId with your AppName), and customize the parameters, see also the "Command line options" in FAQs.

Or if you want to copy your installation package to a specified directory for repair or modify, please use this line ( If the DestDir of UninsHs is not {app} in [Files] section, please change the {app} to your directory ):

Filename: {app}\UninsHs.exe; \
  Parameters: /r0=AppId,{language},{srcexe},YourDirFile; \
  Flags: runminimized runhidden nowait

Note: Customize this line with your AppId ( If you don't use AppId, customize the AppId with your AppName ), and customize the YourDirFile with your specified directory and filename, also you can customize the parameters, see also the "Command line options" in FAQs.

Note: You need to create the directory by yourself, Example:

[Dir]
  Name: "{userappdata}\$Hs$"; Attribs: hidden; Flags: uninsalwaysuninstall
[Run]
  Filename: "{app}\UninsHs.exe"; \
    Parameters: /r0=MyAppId,{language},{srcexe},{userappdata}\$Hs$\i.exe; \
    WorkingDir: "{app}"; \
    Flags: nowait runhidden runminimized skipifdoesntexist
[UninstallDelete]
  Type: filesandordirs; Name: "{userappdata}\$Hs$"

6. [InstallDelete] section

Add lines to delete the files which do not have a "Fixed" flag in the [Components] section, Example:

Type: Files; Name "{app}\Help.hlp"

Note: Do not delete the UninsHs.exe

7. [Components] section

Add "DisableNoUninstallWarning" flag to your component which does not have a "Fixed" flag, Example:

Name: "help"; \
  Description: "Help Files"; Types: full; Flags: DisableNoUninstallWarning

8. [Code] section

Add the appropriate functions for your version of Inno Setup:

 - For Inno Setup 4.x:

function SkipCurPage(CurPage: Integer): Boolean;
begin
  if Pos('/SP-', UpperCase(GetCmdTail)) > 0 then
    case CurPage of
      wpLicense, wpPassword, wpInfoBefore, wpUserInfo, wpSelectDir,
      wpSelectProgramGroup, wpInfoAfter:
        Result := True;
    end;
end;

 - For Inno Setup 5.x:

function ShouldSkipPage(CurPage: Integer): Boolean;
begin
  if Pos('/SP-', UpperCase(GetCmdTail)) > 0 then
    case CurPage of
      wpLicense, wpPassword, wpInfoBefore, wpUserInfo, wpSelectDir,
      wpSelectProgramGroup, wpInfoAfter:
        Result := True;
    end;
end;

If you want to skip the welcome wizard page when modify, add these const and procedures:

 - For Inno Setup 4.x and 5.x:

const
  WM_LBUTTONDOWN = 513;
  WM_LBUTTONUP = 514;

procedure InitializeWizard();
begin
  if (Pos('/SP-', UpperCase(GetCmdTail)) > 0) then
  begin
    PostMessage(WizardForm.NextButton.Handle,WM_LBUTTONDOWN,0,0);
    PostMessage(WizardForm.NextButton.Handle,WM_LBUTTONUP,0,0);
  end;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  if (Pos('/SP-', UpperCase(GetCmdTail)) > 0) and
     (CurPageID = wpSelectComponents) then
    WizardForm.BackButton.Visible := False;
end;

9. Congratulations!

Compile your setup script and watch the new uninstall at work!

If it doesn't work, pleanse email webmaster@uninshs.com.

You can download the example script.


Copyright © 2001-2009 by Han-soft, all rights reserved. Contact us