Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added Inno Setup installer/uninstaller to simplify use - removed option to start with Windows as it's the default behaviour - inverted checkboxes, so selected means blocked (thanks ljford7!)
- Loading branch information
Showing
6 changed files
with
155 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ | |
ipch/ | ||
[Dd]ebug/ | ||
[Rr]elease/ | ||
/DashFixSetup_*.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,7 @@ | ||
Copyright (c) 2017 Simon Owen | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
; Inno Setup script for DashFix installer | ||
|
||
#define MyAppName "DashFix" | ||
#define MyAppVersion "1.1" | ||
#define MyAppPublisher "Simon Owen" | ||
#define MyAppURL "https://github.com/simonowen/dashfix" | ||
#define MyAppExeName "DashFix.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={{E693D1E7-CF41-48CE-8E10-8A7FB6D6AE03} | ||
AppName={#MyAppName} | ||
AppVersion={#MyAppVersion} | ||
AppPublisher={#MyAppPublisher} | ||
AppPublisherURL={#MyAppURL} | ||
AppSupportURL={#MyAppURL} | ||
AppUpdatesURL={#MyAppURL} | ||
DefaultDirName={pf}\{#MyAppName} | ||
DefaultGroupName={#MyAppName} | ||
UninstallDisplayName={#MyAppName} | ||
DisableProgramGroupPage=auto | ||
InfoBeforeFile=License.txt | ||
OutputDir=. | ||
OutputBaseFilename=DashFixSetup_{#StringChange(MyAppVersion, '.', '')} | ||
Compression=lzma | ||
SolidCompression=yes | ||
SignTool=signtool $f | ||
SignedUninstaller=yes | ||
|
||
[Languages] | ||
Name: "english"; MessagesFile: "compiler:Default.isl" | ||
|
||
[Messages] | ||
SetupAppTitle=Setup {#MyAppName} | ||
SetupWindowTitle=Setup - {#MyAppName} v{#MyAppVersion} | ||
|
||
[Files] | ||
Source: "Release\DashFix.exe"; DestDir: "{app}"; Flags: ignoreversion | ||
Source: "Release\inject.dll"; DestDir: "{app}"; Flags: ignoreversion | ||
Source: "ReadMe.md"; DestDir: "{app}"; Flags: ignoreversion | ||
Source: "License.txt"; DestDir: "{app}"; Flags: ignoreversion | ||
|
||
[Icons] | ||
Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" | ||
Name: "{commonprograms}\{#MyAppName} Website"; Filename: "https://github.com/simonowen/dashfix" | ||
|
||
[Registry] | ||
Root: HKCU; Subkey: "Software\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "{#MyAppName}"; ValueData: """{app}\{#MyAppExeName}"" --startup"; Flags: uninsdeletevalue | ||
Root: HKCU; Subkey: "Software\SimonOwen"; Flags: uninsdeletekeyifempty | ||
Root: HKCU; Subkey: "Software\SimonOwen\DashFix"; Flags: uninsdeletekey | ||
|
||
[UninstallRun] | ||
Filename: "taskkill.exe"; Parameters: "/f /im ""{#MyAppExeName}"""; Flags: runhidden | ||
|
||
[Code] | ||
function GetAppPid(const ExeName : string): Integer; | ||
var | ||
WbemLocator: Variant; | ||
WbemServices: Variant; | ||
WbemObjectSet: Variant; | ||
begin | ||
WbemLocator := CreateOleObject('WBEMScripting.SWBEMLocator'); | ||
WbemServices := WbemLocator.ConnectServer('.', 'root\CIMV2'); | ||
WbemObjectSet := WbemServices.ExecQuery(Format('SELECT ProcessId FROM Win32_Process Where Name="%s"',[ExeName])); | ||
if WbemObjectSet.Count > 0 then | ||
Result := WbemObjectSet.ItemIndex(0).ProcessId | ||
else | ||
Result := 0; | ||
end; | ||
function CloseSteamApps(const Operation: String): Boolean; | ||
var | ||
Response: Integer; | ||
begin | ||
Result := True | ||
while Result and ((GetAppPid('Steam.exe') <> 0) or (GetAppPid('vrdashboard.exe') <> 0)) do | ||
begin | ||
Response := MsgBox('Please close Steam and SteamVR to ' + Operation + ' {#MyAppName}.', mbInformation, MB_OKCANCEL); | ||
if Response = IDCANCEL then | ||
Result := False | ||
end; | ||
end; | ||
procedure CloseApplication(const ExeName: String); | ||
var | ||
ResultCode: Integer; | ||
begin | ||
Exec(ExpandConstant('taskkill.exe'), '/f /im ' + '"' + ExeName + '"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode); | ||
end; | ||
function PrepareToInstall(var NeedsRestart: Boolean): String; | ||
begin | ||
Result := '' | ||
if GetAppPid('DashFix.exe') <> 0 then | ||
begin | ||
if not CloseSteamApps('upgrade') then | ||
Result := 'Steam or SteamVR are still running.' | ||
else | ||
CloseApplication('{#MyAppExeName}') | ||
end; | ||
end; | ||
function NextButtonClick(CurPageID: Integer): Boolean; | ||
var | ||
ResultCode: Integer; | ||
begin | ||
Result := True; | ||
if (CurPageID = wpFinished) and ((not WizardForm.YesRadio.Visible) or | ||
(not WizardForm.YesRadio.Checked)) | ||
then | ||
ExecAsOriginalUser(ExpandConstant('{app}\{#MyAppExeName}'), '', '', | ||
SW_SHOWNORMAL, ewNoWait, ResultCode); | ||
end; | ||
function InitializeUninstall(): Boolean; | ||
begin | ||
Result := CloseSteamApps('uninstall') | ||
end; |