innosetup: rename exe app name

innosetup: rename exe app name

Fixes https://github.com/iterative/dvc/issues/3687

#define MyAppName "DVC (Data Version Control)"
#define MyAppVersion ReadIni(".\scripts\innosetup\config.ini", "Version", "version", "unknown")
#define MyAppPublisher "Dmitry Petrov"
#define MyAppURL "https://dataversioncontrol.com/"
#define MyAppDir "..\..\dist\dvc"

[Setup]
AppId={{8258CE8A-110E-4E0D-AE60-FEE00B15F041}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={code:GetDefaultDirName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=..\..\LICENSE
OutputBaseFilename=dvc-{#MyAppVersion}
Compression=lzma2/max
SolidCompression=yes
OutputDir=..\..\
ChangesEnvironment=yes
SetupIconFile=dvc.ico
WizardSmallImageFile=dvc_up.bmp
WizardImageFile=dvc_left.bmp
DisableWelcomePage=no

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

[Files]
Source: "{#MyAppDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

[Tasks]
Name: modifypath; Description: Adds dvc's application directory to environmental path; Flags: checkablealone;
Name: modifypath\system; Description: Adds dvc's application directory to enviromental path for all users;
Name: addsymlinkpermissions; Description: Add permission for creating symbolic links; Flags: checkablealone;
Name: addsymlinkpermissions\system; Description: Add permissions for creating symbolic links for all users;

[Code]
const
	ModPathName = 'modifypath';
	ModPathPath = '{app}';
	SymLinkName = 'addsymlinkpermissions';

var
	ModPathType: String;
	SymLinkType: String;

function GetDefaultDirName(Dummy: string): string;
begin
	if IsAdminLoggedOn then begin
		Result := ExpandConstant('{pf}\{#MyAppName}');
	end else begin
		Result := ExpandConstant('{userpf}\{#MyAppName}');
	end;
end;

#include "modpath.iss"
#include "addsymlink.iss"

procedure CurStepChanged(CurStep: TSetupStep);
begin
	if CurStep = ssPostInstall then begin
		if IsTaskSelected(ModPathName + '\system') then begin
			ModPathType := 'system';
		end else begin
			ModPathType := 'user';
		end;

		if IsTaskSelected(SymLinkName + '\system') then begin
			SymLinkType := 'system';
		end else begin
			SymLinkType := 'user';
		end;

		if IsTaskSelected(ModPathName) then
			ModPath();
		if IsTaskSelected(SymLinkName) then
			AddSymLink();
	end;
end;

#define MyAppName "Data Version Control"
#define MyAppVersion ReadIni(".\scripts\innosetup\config.ini", "Version", "version", "unknown")
#define MyAppPublisher "Dmitry Petrov"
#define MyAppURL "https://dataversioncontrol.com/"
#define MyAppDir "..\..\dist\dvc"

[Setup]
AppId={{8258CE8A-110E-4E0D-AE60-FEE00B15F041}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={code:GetDefaultDirName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=..\..\LICENSE
OutputBaseFilename=dvc-{#MyAppVersion}
Compression=lzma2/max
SolidCompression=yes
OutputDir=..\..\
ChangesEnvironment=yes
SetupIconFile=dvc.ico
WizardSmallImageFile=dvc_up.bmp
WizardImageFile=dvc_left.bmp
DisableWelcomePage=no

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

[Files]
Source: "{#MyAppDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

[Tasks]
Name: modifypath; Description: Adds dvc's application directory to environmental path; Flags: checkablealone;
Name: modifypath\system; Description: Adds dvc's application directory to enviromental path for all users;
Name: addsymlinkpermissions; Description: Add permission for creating symbolic links; Flags: checkablealone;
Name: addsymlinkpermissions\system; Description: Add permissions for creating symbolic links for all users;

[Code]
const
	ModPathName = 'modifypath';
	ModPathPath = '{app}';
	SymLinkName = 'addsymlinkpermissions';

var
	ModPathType: String;
	SymLinkType: String;

function GetDefaultDirName(Dummy: string): string;
begin
	if IsAdminLoggedOn then begin
		Result := ExpandConstant('{pf}\{#MyAppName}');
	end else begin
		Result := ExpandConstant('{userpf}\{#MyAppName}');
	end;
end;

#include "modpath.iss"
#include "addsymlink.iss"

procedure CurStepChanged(CurStep: TSetupStep);
begin
	if CurStep = ssPostInstall then begin
		if IsTaskSelected(ModPathName + '\system') then begin
			ModPathType := 'system';
		end else begin
			ModPathType := 'user';
		end;

		if IsTaskSelected(SymLinkName + '\system') then begin
			SymLinkType := 'system';
		end else begin
			SymLinkType := 'user';
		end;

		if IsTaskSelected(ModPathName) then
			ModPath();
		if IsTaskSelected(SymLinkName) then
			AddSymLink();
	end;
end;


update inno setup script

update inno setup script

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

#define MyAppName "AnnwvynSDK64"
#define MyAppVersion "0.2.4"
#define MyAppPublisher "Arthur (Ybalrid) Brainville"
#define MyAppURL "http://annwvyn.org/"

[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.)
CompressionThreads=8
AppId={{B94D9F2F-7B8F-4B38-933A-16F6220B656B}}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName=C:\Oculus\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=C:\Oculus\AnnwvynSDK64\Annwvyn\LICENSE
InfoAfterFile=C:\Oculus\AnnwvynSDK64\README.TXT
OutputDir=C:\Oculus\AnnwvynSetup64
OutputBaseFilename=setupAnnwvynSDKx64
Compression=lzma
SolidCompression=yes

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

[Files]
Source: "C:\Oculus\AnnwvynSDK64\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs ; Excludes: "*.sdf,*.ipch,*.pch, VS2015_Dependencies_AnnwvynSDK_64-OVR1.7.zip, Annvyn.0.2.4-experimental_dependencies.zip"
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"

[Run]
Filename: "{app}\RUNME-64.BAT"

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

#define MyAppName "AnnwvynSDK64"
#define MyAppVersion "0.2.3"
#define MyAppPublisher "Arthur (Ybalrid) Brainville"
#define MyAppURL "http://annwvyn.org/"

[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.)
CompressionThreads=8
AppId={{B94D9F2F-7B8F-4B38-933A-16F6220B656B}}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName=C:\Oculus\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=C:\Oculus\AnnwvynSDK64\Annwvyn\LICENSE
InfoAfterFile=C:\Oculus\AnnwvynSDK64\README.TXT
OutputDir=C:\Oculus\AnnwvynSetup64
OutputBaseFilename=setupAnnwvynSDKx64
Compression=lzma
SolidCompression=yes

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

[Files]
Source: "C:\Oculus\AnnwvynSDK64\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs ; Excludes: "*.sdf,*.ipch,*.pch, VS2015_Dependencies_AnnwvynSDK_64-OVR1.7.zip"
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"

[Run]
Filename: "{app}\RUNME-64.BAT"


CY-3674 Windows improve shortcut powershell+prompt (#698)

Co-authored-by: Madda <365ec17a675f3273bc16c74761ad83f2cf07c59a@nowhere.local>
Co-authored-by: Lukasz Maksymczuk <ef2a5083329fa7fb047dca2ff39f2cb14ee21c66@users.noreply.github.com>

#define AppName "Cloudify Windows Agent"
#define AppVersion GetEnv('VERSION')
#define AppMilestone GetEnv('PRERELEASE')
#define AppBuild GetEnv('BUILD')
#define AppPublisher "Cloudify Platform Ltd."
#define AppURL "https://cloudify.co/"

[Setup]
AppName={#AppName}
AppVersion={#AppVersion}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={commonpf}\Cloudify {#AppVersion}-{#AppMilestone} Agents
DisableProgramGroupPage=yes
DisableDirPage=yes
OutputBaseFilename=cloudify-windows-agent_{#AppVersion}-{#AppMilestone}
Compression=lzma
SolidCompression=yes
ArchitecturesInstallIn64BitMode=x64 arm64 ia64
ArchitecturesAllowed=x64 arm64 ia64
LicenseFile=source\license.txt
MinVersion=6.0
SetupIconFile=source\icons\Cloudify.ico
UninstallDisplayIcon={app}\Cloudify.ico
OutputDir=output\

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

[Files]
Source: "C:\Program Files\Cloudify {#AppVersion}-{#AppMilestone} Agents\*"; DestDir: "{app}"; Excludes: "\__pycache__\*"; Flags: createallsubdirs recursesubdirs
Source: "source\icons\Cloudify.ico"; DestDir: "{app}"

[Tasks]
Name: "desktopicon"; Description: "Create a desktop icon";

[Icons]
Name: "{commondesktop}\Cloudify {#AppVersion}-{#AppMilestone} Agents"; Filename: "%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe";  Parameters: "-NoExit -Command $env:Path=\""{app}\Scripts\;$env:Path\""; function prompt {{\""[Cloudify {#AppVersion}-{#AppMilestone} Agents] $($executionContext.SessionState.Path.CurrentLocation)>\""}"; WorkingDir: "{app}"; IconFilename: "{app}\Cloudify.ico"; Tasks: "desktopicon";

#define AppName "Cloudify Windows Agent"
#define AppVersion GetEnv('VERSION')
#define AppMilestone GetEnv('PRERELEASE')
#define AppBuild GetEnv('BUILD')
#define AppPublisher "Cloudify Platform Ltd."
#define AppURL "https://cloudify.co/"

[Setup]
AppName={#AppName}
AppVersion={#AppVersion}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={commonpf}\Cloudify {#AppVersion}-{#AppMilestone} Agents
DisableProgramGroupPage=yes
DisableDirPage=yes
OutputBaseFilename=cloudify-windows-agent_{#AppVersion}-{#AppMilestone}
Compression=lzma
SolidCompression=yes
ArchitecturesInstallIn64BitMode=x64 arm64 ia64
ArchitecturesAllowed=x64 arm64 ia64
LicenseFile=source\license.txt
MinVersion=6.0
SetupIconFile=source\icons\Cloudify.ico
UninstallDisplayIcon={app}\Cloudify.ico
OutputDir=output\

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

[Files]
Source: "C:\Program Files\Cloudify {#AppVersion}-{#AppMilestone} Agents\*"; DestDir: "{app}"; Excludes: "\__pycache__\*"; Flags: createallsubdirs recursesubdirs
Source: "source\icons\Cloudify.ico"; DestDir: "{app}"

[Tasks]
Name: "desktopicon"; Description: "Create a desktop icon";

[Icons]
Name: "{commondesktop}\Cloudify {#AppVersion}-{#AppMilestone} Agents"; Filename: "{cmd}"; Parameters: "/k ""{app}\Scripts\activate.bat"""; WorkingDir: "{app}"; IconFilename: "{app}\Cloudify.ico"; Tasks: "desktopicon";


Workaround for "Warning: [Hint] Variable 'Result' never used".

[Setup]
AppName = Seobiseu
AppVerName = Seobiseu 1.10
DefaultDirName = {pf}\Josip Medved\Seobiseu
OutputBaseFilename = seobiseu110
OutputDir = ..\Releases
SourceDir = ..\Binaries
AppId = JosipMedved_Seobiseu
AppMutex = Global\JosipMedved_Seobiseu
AppPublisher = Josip Medved
AppPublisherURL = http://www.jmedved.com/seobiseu/
UninstallDisplayIcon = {app}\Seobiseu.exe
AlwaysShowComponentsList = no
ArchitecturesInstallIn64BitMode = x64
DisableProgramGroupPage = yes
MergeDuplicateFiles = yes
MinVersion = 0, 5.1.2600
PrivilegesRequired = admin
ShowLanguageDialog = no
SolidCompression = yes
ChangesAssociations = yes
DisableWelcomePage = yes

[Files]
Source: "Seobiseu.exe";         DestDir: "{app}";  Flags: ignoreversion;
Source: "SeobiseuService.exe";  DestDir: "{app}";  Flags: ignoreversion;
Source: "ReadMe.txt";           DestDir: "{app}";  Flags: overwritereadonly uninsremovereadonly;  Attribs: readonly;

[Icons]
Name: "{userstartmenu}\Seobiseu";  Filename: "{app}\Seobiseu.exe"

[Registry]
Root: HKCU;  Subkey: "Software\Josip Medved\Seobiseu";                 ValueName: "Installed";  ValueType: none;                                                Flags: deletevalue uninsdeletevalue
Root: HKLM;  Subkey: "Software\Josip Medved\Seobiseu";                 ValueName: "Installed";  ValueType: dword;   ValueData: "1";                             Flags: uninsdeletekey
Root: HKCU;  Subkey: "Software\Josip Medved";                                                                                Flags: uninsdeletekeyifempty
Root: HKCU;  Subkey: "Software\Microsoft\Windows\CurrentVersion\Run";  ValueName: "Seobiseu";   ValueType: string;  ValueData: """{app}\Seobiseu.exe"" /tray";  Flags: uninsdeletevalue;

[Run]
Filename: "{app}\SeobiseuService.exe";  Parameters: "/Install";                                          Flags: runascurrentuser waituntilterminated
Filename: "{app}\Seobiseu.exe";                                  Description: "Launch application now";  Flags: postinstall nowait skipifsilent runasoriginaluser
Filename: "{app}\ReadMe.txt";                                    Description: "View ReadMe.txt";         Flags: postinstall runasoriginaluser shellexec nowait skipifsilent unchecked

[UninstallRun]
Filename: "{app}\SeobiseuService.exe";  Parameters: "/Uninstall";  Flags: runascurrentuser waituntilterminated

[Code]

function PrepareToInstall(var NeedsRestart: Boolean): String;
var
    ResultCode: Integer;
begin
    Exec(ExpandConstant('{app}\SeobiseuService.exe'), '/Uninstall', '', SW_SHOW, ewWaitUntilTerminated, ResultCode)
    Result := Result;
end;

[Setup]
AppName = Seobiseu
AppVerName = Seobiseu 1.10
DefaultDirName = {pf}\Josip Medved\Seobiseu
OutputBaseFilename = seobiseu110
OutputDir = ..\Releases
SourceDir = ..\Binaries
AppId = JosipMedved_Seobiseu
AppMutex = Global\JosipMedved_Seobiseu
AppPublisher = Josip Medved
AppPublisherURL = http://www.jmedved.com/seobiseu/
UninstallDisplayIcon = {app}\Seobiseu.exe
AlwaysShowComponentsList = no
ArchitecturesInstallIn64BitMode = x64
DisableProgramGroupPage = yes
MergeDuplicateFiles = yes
MinVersion = 0, 5.1.2600
PrivilegesRequired = admin
ShowLanguageDialog = no
SolidCompression = yes
ChangesAssociations = yes
DisableWelcomePage = yes

[Files]
Source: "Seobiseu.exe";         DestDir: "{app}";  Flags: ignoreversion;
Source: "SeobiseuService.exe";  DestDir: "{app}";  Flags: ignoreversion;
Source: "ReadMe.txt";           DestDir: "{app}";  Flags: overwritereadonly uninsremovereadonly;  Attribs: readonly;

[Icons]
Name: "{userstartmenu}\Seobiseu";  Filename: "{app}\Seobiseu.exe"

[Registry]
Root: HKCU;  Subkey: "Software\Josip Medved\Seobiseu";                 ValueName: "Installed";  ValueType: none;                                                Flags: deletevalue uninsdeletevalue
Root: HKLM;  Subkey: "Software\Josip Medved\Seobiseu";                 ValueName: "Installed";  ValueType: dword;   ValueData: "1";                             Flags: uninsdeletekey
Root: HKCU;  Subkey: "Software\Josip Medved";                                                                                Flags: uninsdeletekeyifempty
Root: HKCU;  Subkey: "Software\Microsoft\Windows\CurrentVersion\Run";  ValueName: "Seobiseu";   ValueType: string;  ValueData: """{app}\Seobiseu.exe"" /tray";  Flags: uninsdeletevalue;

[Run]
Filename: "{app}\SeobiseuService.exe";  Parameters: "/Install";                                          Flags: runascurrentuser waituntilterminated
Filename: "{app}\Seobiseu.exe";                                  Description: "Launch application now";  Flags: postinstall nowait skipifsilent runasoriginaluser
Filename: "{app}\ReadMe.txt";                                    Description: "View ReadMe.txt";         Flags: postinstall runasoriginaluser shellexec nowait skipifsilent unchecked

[UninstallRun]
Filename: "{app}\SeobiseuService.exe";  Parameters: "/Uninstall";  Flags: runascurrentuser waituntilterminated

[Code]

function PrepareToInstall(var NeedsRestart: Boolean): String;
var
    ResultCode: Integer;
begin
    Exec(ExpandConstant('{app}\SeobiseuService.exe'), '/Uninstall', '', SW_SHOW, ewWaitUntilTerminated, ResultCode)
end;