Skip to content
This repository was archived by the owner on Aug 19, 2020. It is now read-only.

Commit d8f4f8a

Browse files
authored
Merge pull request #1 from AmRo045/develop
Create setup creator
2 parents e6a6075 + 874a694 commit d8f4f8a

File tree

6 files changed

+110
-4
lines changed

6 files changed

+110
-4
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Custom
2+
Setup/Files/*
3+
Setup/Output/*
4+
15
## Ignore Visual Studio temporary files, build results, and
26
## files generated by popular Visual Studio add-ons.
37
##

Setup/SetupConfig.iss

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
; Script generated by the Inno Setup Script Wizard.
2+
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
3+
4+
#define MyAppName "ShecanDesktop"
5+
#define MyAppSetupName "ShecanDesktop_Setup"
6+
#define MyAppVersion "1.0.0"
7+
#define MyAppPublisher "AmRo"
8+
#define MyAppURL "https://github.com/AmRo045/ShecanDesktop"
9+
#define MyAppExeName "ShecanDesktop.exe"
10+
11+
[Setup]
12+
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
13+
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
14+
AppId={{18916FA3-7954-4F1D-970E-F35C812719F0}
15+
AppName={#MyAppName}
16+
AppVersion={#MyAppVersion}
17+
;AppVerName={#MyAppName} {#MyAppVersion}
18+
AppPublisher={#MyAppPublisher}
19+
AppPublisherURL={#MyAppURL}
20+
AppSupportURL={#MyAppURL}
21+
AppUpdatesURL={#MyAppURL}
22+
DefaultDirName={autopf}\{#MyAppName}
23+
DisableProgramGroupPage=yes
24+
; The [Icons] "quicklaunchicon" entry uses {userappdata} but its [Tasks] entry has a proper IsAdminInstallMode Check.
25+
UsedUserAreasWarning=no
26+
; Uncomment the following line to run in non administrative install mode (install for current user only.)
27+
;PrivilegesRequired=lowest
28+
OutputDir={#SourcePath}Output
29+
OutputBaseFilename={#MyAppSetupName}_{#MyAppVersion}
30+
SetupIconFile="{#SourcePath}..\Source\ShecanDesktop\Resources\Images\Icon.ico"
31+
Compression=lzma
32+
SolidCompression=yes
33+
WizardStyle=modern
34+
35+
[Languages]
36+
Name: "english"; MessagesFile: "compiler:Default.isl"
37+
38+
[Tasks]
39+
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
40+
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 6.1; Check: not IsAdminInstallMode
41+
42+
[Files]
43+
Source: "{#SourcePath}Files\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
44+
Source: "{#SourcePath}Files\*"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs createallsubdirs
45+
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
46+
47+
[Icons]
48+
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
49+
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
50+
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon

Setup/SetupShell.ps1

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# The setup script that used to copy release directory content to Setup\Files\ directory
2+
# and change app version in setup creator config (.iss) file
3+
4+
# App name
5+
$appName = "ShecanDesktop"
6+
# Script base directory
7+
$baseDirectory = $PSScriptRoot
8+
# App release directoy
9+
$releaseDirectory = Join-Path $baseDirectory "..\Source\ShecanDesktop\bin\Release\*"
10+
# Setup files container directory
11+
$setupFilesDirectory = Join-Path $baseDirectory "Files\"
12+
# Output setup file directory
13+
$setupOutputDirectory = Join-Path $baseDirectory "Output\"
14+
# Main exe file full path
15+
$mainFileFullPath = Join-Path $releaseDirectory.Replace("*", "") "$appName.exe"
16+
# Get the main exe file version info
17+
$mainFileVersionInfo = (Get-Item -Path $mainFileFullPath).VersionInfo;
18+
# Set main file version
19+
$mainFileVersion = "$($mainFileVersionInfo.FileMajorPart).$($mainFileVersionInfo.FileMinorPart).$($mainFileVersionInfo.FileBuildPart)"
20+
# My app version
21+
$myAppVersion = 'MyAppVersion "' + "$mainFileVersion" + '"'
22+
# vshost file full path in setup container directory
23+
$vshostFileName = Join-Path $setupFilesDirectory "$appName.vshost.exe"
24+
# Setup config file path
25+
$setupConfigFile = Join-Path $baseDirectory "SetupConfig.iss"
26+
27+
# Set script base directory as current directory
28+
Set-Location $baseDirectory
29+
30+
# Delete old items
31+
Remove-Item -Path $setupFilesDirectory -Recurse
32+
33+
# Create new directories
34+
New-Item -Path $setupFilesDirectory -ItemType Directory
35+
36+
if (![System.IO.Directory]::Exists($setupOutputDirectory)) {
37+
New-Item -Path $setupOutputDirectory -ItemType Directory
38+
}
39+
40+
# Copy dll files
41+
copy-item -path $releaseDirectory -Filter *.dll -destination $setupFilesDirectory -recurse -Force -Verbose
42+
43+
# Copy exe files
44+
copy-item -path $releaseDirectory -Filter *.exe -destination $setupFilesDirectory -recurse -Force -Verbose
45+
46+
# Delete .vshost file
47+
if ([System.IO.File]::Exists($vshostFileName)) {
48+
Remove-Item -Path $vshostFileName
49+
}
50+
51+
# Set main file version in setup creator config file
52+
(Get-Content -Path $setupConfigFile) -Replace('MyAppVersion "(\d+\.)?(\d+\.)?(\d+\.)?(\*|\d+)"$', $myAppVersion) | Set-Content -Path $setupConfigFile

Source/ShecanDesktop/Resources/UI/Resources.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@
3939
<system:String x:Key="MyGitHubPage">https://github.com/AmRo045</system:String>
4040
<system:String x:Key="MyInstagramPage">https://www.instagram.com/AmRo045</system:String>
4141
<system:String x:Key="ProjectSourceCodePage">https://github.com/AmRo045/ShecanDesktop</system:String>
42-
<system:String x:Key="ProjectIssuesPage">https://github.com/AmRo045/ShecanDesktop/Issues</system:String>
42+
<system:String x:Key="ProjectIssuesPage">https://github.com/AmRo045/ShecanDesktop/issues</system:String>
4343

4444
</ResourceDictionary>

Source/ShecanDesktop/ShecanDesktop.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<WarningLevel>4</WarningLevel>
3030
</PropertyGroup>
3131
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
32-
<PlatformTarget>AnyCPU</PlatformTarget>
32+
<PlatformTarget>x86</PlatformTarget>
3333
<DebugType>pdbonly</DebugType>
3434
<Optimize>true</Optimize>
3535
<OutputPath>bin\Release\</OutputPath>

Source/ShecanDesktop/Views/Boxes/AboutPage.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@
4848

4949
<Run>This is the Windows application for</Run>
5050
<Button Tag="{StaticResource ShecanDesktopHomePage}"
51-
Content="ShecanDesktop"
51+
Content="Shecan"
5252
Click="LinkButtonOnClick"
5353
Style="{DynamicResource LinkButton}"/>
5454
<Run>service.</Run>
5555

5656
<LineBreak/>
5757
<LineBreak/>
5858

59-
<Run>The ShecanDesktop service used to bypass some sanctions on the internet.</Run>
59+
<Run>The Shecan service used to bypass some sanctions on the internet.</Run>
6060

6161
<LineBreak/>
6262
<LineBreak/>

0 commit comments

Comments
 (0)