P
P
passstrada2020-07-21 22:01:08
Pascal
passstrada, 2020-07-21 22:01:08

InnoSetup | How to: Create shortcut, Delete folder after installation, Download file to folder?

1. Create a shortcut to the Metro application on the desktop (from the Applications folder (Win + R -> shell:appsfolder))
2. After installation, delete the folder with all the files "C:\APPX_WoTBlitz_v71"
3. Download the file to the folder "C:\APPX_WoTBlitz_v71 \Files", not in {tmp} (it takes a very long time to copy the file from the "Temp" folder to the "C:\APPX_WoTBlitz_v71\Files" folder)

Inno Setup code
#define AppName "World of Tanks Blitz"
#define AppVer "7.1"
#define OutName "APPX_WoTBlitz_v71"
#define URLdown "http://tlu.dl.delivery.mp.microsoft.com/filestreamingservice/files/972dce9f-4246-4cb0-9bec-6ff12ec1f40a?P1=1595376450&P2=402&P3=2&P4=h4EGRvbwl3pZMzQZwmQxMaIsjMVrbepVRcC%2fgdpIcE9sBaoneVecUu%2bliqZ25qPOAgQaxhFCb2E%2b0gPLNm%2fxRg%3d%3d"

#include "C:\Program Files (x86)\Inno Download Plugin\idp.iss"

[Setup]
AppName={#AppName}
AppVerName=APPX WoTBlitz Client {#AppVer} by @vladi1603
AppVersion={#AppVer}
DefaultDirName=C:\{#OutName}
MinVersion=10.0

OutputDir=C:\
OutputBaseFilename={#OutName}
DisableDirPage=yes
InfoBeforeFile=readme.rtf
SetupIconFile=windows10.ico
WizardSmallImageFile=install.bmp

DisableProgramGroupPage=yes
DisableReadyPage=yes
Uninstallable=no

[Languages]
;Язык по умолчанию интерфейса установщика
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"

[Files]
;Файлы приложения, установочный файл и вся его директория
Source: "C:\DATA\appstore_WoTB\_Install_Appx_AppxBundle.bat"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\DATA\appstore_WoTB\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

;Файлы, Оформление окон
Source: "VclStylesinno.dll"; DestDir: {app}; Flags: ignoreversion dontcopy nocompression
Source: "SmokeyQuartzKamri.vsf"; DestDir: {app}; Flags: ignoreversion dontcopy nocompression

;Файлы, Splash
Source: "isgsg.dll"; DestDir: "{tmp}"; Flags: ignoreversion dontcopy nocompression
Source: "Splash.png"; DestDir: "{tmp}"; Flags: ignoreversion dontcopy nocompression

;Файлы, Скачивание с сайта
Source: "{tmp}\WindowsStore_WoTBlitz.AppxBundle"; DestDir: "{app}\Files"; Flags: external; ExternalSize: 5196792821

[Icons]
;Создание ярлыка на рабочем столе после успешной установки приложения
Name: "{commondesktop}\WoTB Реплеи"; Filename: "{localappdata}\Packages\7458BE2C.WorldofTanksBlitz_x4tje2y229k00\LocalState\DAVAProject\replays"

[Run]
FileName: "{app}\_Install_Appx_AppxBundle.bat"; StatusMsg: "Установка приложений..."; Flags: skipifsilent

[Dirs]
;Создание пустых папок, для отправления на рабочий стол папки replays в секции [Icons]
Name: {localappdata}\Packages\7458BE2C.WorldofTanksBlitz_x4tje2y229k00\LocalState\DAVAProject
Name: {localappdata}\Packages\7458BE2C.WorldofTanksBlitz_x4tje2y229k00\LocalState\DAVAProject\replays

[Code]
//Оформление окон
procedure LoadVCLStyle(VClStyleFile: String); external '[email protected]:VclStylesInno.dll stdcall';
procedure UnLoadVCLStyles; external '[email protected]:VclStylesInno.dll stdcall';

function InitializeSetup(): Boolean;
begin
  ExtractTemporaryFile('SmokeyQuartzKamri.vsf');
  LoadVCLStyle(ExpandConstant('{tmp}\SmokeyQuartzKamri.vsf'));
  Result := True;
end;
procedure DeinitializeSetup();
begin
  UnLoadVCLStyles;
end;

//Splash, Скачивание файлов 
procedure ShowSplashScreen(p1:HWND;p2:AnsiString;p3,p4,p5,p6,p7:integer;p8:boolean;p9:Cardinal;p10:integer);
external '[email protected]:isgsg.dll stdcall delayload';

procedure InitializeWizard();
begin
  ExtractTemporaryFile('Splash.png');
  ShowSplashScreen(WizardForm.Handle,ExpandConstant('{tmp}\Splash.png'),1000,3000,1000,0,255,True,$FFFFFF,10);
begin
   idpAddFileSize('{#URLdown}', ExpandConstant('{tmp}\WindowsStore_WoTBlitz.AppxBundle'), 5196792821);
   idpDownloadAfter(wpReady);
end;
end;

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question