Skip to content

Commit

Permalink
installer updates
Browse files Browse the repository at this point in the history
  • Loading branch information
acalcutt committed Jun 29, 2019
1 parent b95bb61 commit 8c9c159
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 54 deletions.
3 changes: 2 additions & 1 deletion Installer/Uninstall/Uninstall.au3
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\..\VistumblerMDB\Icons\icon.ico
#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator
#AutoIt3Wrapper_Run_Tidy=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

$TempUninstallEXE = @TempDir & '\vi_uninstall.exe'
FileInstall ( "vi_uninstall.exe", $TempUninstallEXE, 1)
FileInstall("vi_uninstall.exe", $TempUninstallEXE, 1)
Run($TempUninstallEXE)
Exit

Binary file modified Installer/Uninstall/Uninstall.exe
Binary file not shown.
13 changes: 7 additions & 6 deletions Installer/Uninstall/vi_uninstall.au3
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\icon.ico
#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator
#AutoIt3Wrapper_Run_Tidy=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

Dim $InstallLocation = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler", "InstallLocation")
Expand All @@ -11,11 +12,11 @@ Dim $Desktop_AllUsers = @DesktopCommonDir & '\Vistumbler.lnk'
Dim $Desktop_CurrentUser = @DesktopDir & '\Vistumbler.lnk'

;Delete Vistumbler files and folders
If FileExists($InstallLocation) Then DirRemove($InstallLocation , 1)
If FileExists($StartMenu_AllUsers) Then DirRemove($StartMenu_AllUsers , 1)
If FileExists($StartMenu_CurrentUser) Then DirRemove($StartMenu_CurrentUser , 1)
If FileExists($Desktop_AllUsers) Then FileDelete ($Desktop_AllUsers)
If FileExists($Desktop_CurrentUser) Then FileDelete ($Desktop_CurrentUser)
If FileExists($InstallLocation) Then DirRemove($InstallLocation, 1)
If FileExists($StartMenu_AllUsers) Then DirRemove($StartMenu_AllUsers, 1)
If FileExists($StartMenu_CurrentUser) Then DirRemove($StartMenu_CurrentUser, 1)
If FileExists($Desktop_AllUsers) Then FileDelete($Desktop_AllUsers)
If FileExists($Desktop_CurrentUser) Then FileDelete($Desktop_CurrentUser)

;Delete File Associations
RegDelete("HKCR\.vsz")
Expand All @@ -25,7 +26,7 @@ RegDelete("HKCR\Vistumbler")
;Delete Uninstall Information
RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler")

_SelfDelete();delete current exe
_SelfDelete() ;delete current exe
Exit

Func _SelfDelete($iDelay = 0)
Expand Down
Binary file modified Installer/Uninstall/vi_uninstall.exe
Binary file not shown.
95 changes: 48 additions & 47 deletions Installer/VistumblerInstaller.au3
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=icon.ico
#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator
#AutoIt3Wrapper_Run_Tidy=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
;License Information------------------------------------
;Copyright (C) 2019 Andrew Calcutt
;This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; Version 2 of the License.
;This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
;You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
;--------------------------------------------------------
;AutoIt Version: v3.3.15.1
;AutoIt Version: v3.3.14.5
$Script_Author = 'Andrew Calcutt'
$Script_Name = 'Vistumbler Installer'
$Script_Website = 'http://www.vistumbler.net'
Expand All @@ -36,9 +37,9 @@ Dim $Desktop_AllUsers = @DesktopCommonDir & '\'
Dim $Desktop_CurrentUser = @DesktopDir & '\'

;Install needed files into exe
FileInstall ( "vi_files.zip", $TempSourceFiles, 1)
FileInstall ( "vi_license.txt", $TempLicense, 1)
FileInstall ( "vi_settings.ini", $TempSettings, 1)
FileInstall("vi_files.zip", $TempSourceFiles, 1)
FileInstall("vi_license.txt", $TempLicense, 1)
FileInstall("vi_settings.ini", $TempSettings, 1)

;Get settings
Dim $ProgramName = IniRead($TempSettings, 'Settings', 'ProgramName', 'Vistumbler')
Expand All @@ -60,7 +61,7 @@ _Exit()

Func _LicenseAgreementGui()
$LA_GUI = GUICreate($title & ' - License Agreement', 625, 443)
$Edit1 = GUICtrlCreateEdit('', 8, 16, 609, 369, BitOr($GUI_SS_DEFAULT_EDIT,$ES_READONLY,$ES_CENTER))
$Edit1 = GUICtrlCreateEdit('', 8, 16, 609, 369, BitOR($GUI_SS_DEFAULT_EDIT, $ES_READONLY, $ES_CENTER))
GUICtrlSetData(-1, $licensetxt)
$LA_Agree = GUICtrlCreateButton("Agree", 184, 400, 105, 25, $WS_GROUP)
$LA_Exit = GUICtrlCreateButton("Exit", 304, 400, 105, 25, $WS_GROUP)
Expand All @@ -81,29 +82,29 @@ Func _LicenseAgreementGui()
ExitLoop
EndSwitch
WEnd
EndFunc
EndFunc ;==>_LicenseAgreementGui

Func _InstallOptionsGui()
$IO_GUI = GUICreate($title & ' - Install Options', 513, 259)
$IO_Dest = GUICtrlCreateInput($Destination, 16, 32, 385, 21)
$Browse = GUICtrlCreateButton("Browse", 408, 30, 89, 25, $WS_GROUP)
GUICtrlCreateLabel("Vistumbler Install Location", 16, 12, 126, 15)
GUICtrlCreateGroup("Options", 8, 64, 497, 145)
GUICtrlCreateGroup("Create start menu shortcuts", 16, 88, 230, 89)
$SMS_AllUsers = GUICtrlCreateRadio("All Users", 32, 144, 100, 17)
$SMS_CurrentUser = GUICtrlCreateRadio("Current User", 32, 128, 100, 17)
$SMS_None = GUICtrlCreateRadio("None", 32, 112, 100, 17)
GUICtrlSetState($SMS_AllUsers, $GUI_CHECKED)
GUICtrlCreateGroup("Create desktop shortcuts", 266, 88, 230, 89)
$DS_AllUsers = GUICtrlCreateRadio("All Users", 282, 144, 100, 17)
$DS_CurrentUser = GUICtrlCreateRadio("Current User", 282, 128, 100, 17)
$DS_None = GUICtrlCreateRadio("None", 282, 112, 100, 17)
GUICtrlSetState($DS_AllUsers, $GUI_CHECKED)
$RVD_Check = GUICtrlCreateCheckbox("Remove old vistumbler directories (make sure you have a backup of your scans)", 16, 184, 481, 17)
GUICtrlSetState($RVD_Check, $GUI_CHECKED)
$IO_Install = GUICtrlCreateButton("Install", 104, 220, 130, 25, $WS_GROUP)
$IO_Exit = GUICtrlCreateButton("Exit", 272, 220, 130, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
$IO_GUI = GUICreate($title & ' - Install Options', 513, 259)
$IO_Dest = GUICtrlCreateInput($Destination, 16, 32, 385, 21)
$Browse = GUICtrlCreateButton("Browse", 408, 30, 89, 25, $WS_GROUP)
GUICtrlCreateLabel("Vistumbler Install Location", 16, 12, 126, 15)
GUICtrlCreateGroup("Options", 8, 64, 497, 145)
GUICtrlCreateGroup("Create start menu shortcuts", 16, 88, 230, 89)
$SMS_AllUsers = GUICtrlCreateRadio("All Users", 32, 144, 100, 17)
$SMS_CurrentUser = GUICtrlCreateRadio("Current User", 32, 128, 100, 17)
$SMS_None = GUICtrlCreateRadio("None", 32, 112, 100, 17)
GUICtrlSetState($SMS_AllUsers, $GUI_CHECKED)
GUICtrlCreateGroup("Create desktop shortcuts", 266, 88, 230, 89)
$DS_AllUsers = GUICtrlCreateRadio("All Users", 282, 144, 100, 17)
$DS_CurrentUser = GUICtrlCreateRadio("Current User", 282, 128, 100, 17)
$DS_None = GUICtrlCreateRadio("None", 282, 112, 100, 17)
GUICtrlSetState($DS_AllUsers, $GUI_CHECKED)
$RVD_Check = GUICtrlCreateCheckbox("Remove old vistumbler directories (make sure you have a backup of your scans)", 16, 184, 481, 17)
GUICtrlSetState($RVD_Check, $GUI_CHECKED)
$IO_Install = GUICtrlCreateButton("Install", 104, 220, 130, 25, $WS_GROUP)
$IO_Exit = GUICtrlCreateButton("Exit", 272, 220, 130, 25, $WS_GROUP)
GUISetState(@SW_SHOW)

While 1
$nMsg = GUIGetMsg()
Expand All @@ -118,7 +119,7 @@ GUISetState(@SW_SHOW)
$instaldir = FileSelectFolder("Choose a folder.", "", 1, GUICtrlRead($IO_Dest))
If Not @error Then GUICtrlSetData($IO_Dest, $instaldir)
Case $IO_Install
Dim $SMS=0, $DS=0, $RVD=0
Dim $SMS = 0, $DS = 0, $RVD = 0
;get install folder
$Destination = GUICtrlRead($IO_Dest)
;Get start menu shortcut type
Expand All @@ -134,17 +135,17 @@ GUISetState(@SW_SHOW)
$DS = 1
EndIf
;Set remove directories flag
If GUICtrlRead($RVD_Check) = 1 Then $RVD=1
If GUICtrlRead($RVD_Check) = 1 Then $RVD = 1
;Close Install Options Window
GUIDelete($IO_GUI)
;Install files from zip to selected dir
_Install($TempSourceFiles, $Destination, $RVD, $SMS, $DS)
ExitLoop
EndSwitch
WEnd
EndFunc
EndFunc ;==>_InstallOptionsGui

Func _Install($source_zip, $dest_dir, $RemOldDir=1, $StartShortcuts=1, $DesktopShortcuts=1)
Func _Install($source_zip, $dest_dir, $RemOldDir = 1, $StartShortcuts = 1, $DesktopShortcuts = 1)
ConsoleWrite('$StartShortcuts:' & $StartShortcuts & ' - ' & '$DesktopShortcuts:' & $DesktopShortcuts & @CRLF)
If $RemOldDir = 1 Then _RemoveOldFiles()
$Unzip = _Zip_UnzipAll($source_zip, $dest_dir, 272)
Expand All @@ -166,23 +167,23 @@ Func _Install($source_zip, $dest_dir, $RemOldDir=1, $StartShortcuts=1, $DesktopS
Else
$err = "Unknown Error"
EndIf
Msgbox(0, "Error", $err & " Make sure vistumbler is not running and try again")
MsgBox(0, "Error", $err & " Make sure vistumbler is not running and try again")
Else
;Create Start Menu Shortcuts
If $StartShortcuts = 2 Then
DirCreate($StartMenu_AllUsers)
FileCreateShortcut ($dest_dir & 'Vistumbler.exe', $StartMenu_AllUsers & 'Vistumbler.lnk')
FileCreateShortcut($dest_dir & 'Vistumbler.exe', $StartMenu_AllUsers & 'Vistumbler.lnk')
ElseIf $StartShortcuts = 1 Then
DirCreate($StartMenu_CurrentUser)
FileCreateShortcut ($dest_dir & 'Vistumbler.exe', $StartMenu_CurrentUser & 'Vistumbler.lnk')
FileCreateShortcut($dest_dir & 'Vistumbler.exe', $StartMenu_CurrentUser & 'Vistumbler.lnk')
EndIf
;Create Desktop Shortcuts
If $DesktopShortcuts = 2 Then
FileDelete ($Desktop_AllUsers & 'Vistumbler.lnk')
FileCreateShortcut ($dest_dir & 'Vistumbler.exe', $Desktop_AllUsers & 'Vistumbler.lnk')
FileDelete($Desktop_AllUsers & 'Vistumbler.lnk')
FileCreateShortcut($dest_dir & 'Vistumbler.exe', $Desktop_AllUsers & 'Vistumbler.lnk')
ElseIf $DesktopShortcuts = 1 Then
FileDelete ($Desktop_CurrentUser & 'Vistumbler.lnk')
FileCreateShortcut ($dest_dir & 'Vistumbler.exe', $Desktop_CurrentUser & 'Vistumbler.lnk')
FileDelete($Desktop_CurrentUser & 'Vistumbler.lnk')
FileCreateShortcut($dest_dir & 'Vistumbler.exe', $Desktop_CurrentUser & 'Vistumbler.lnk')
EndIf
;Write uninstall information into the registry
RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler")
Expand All @@ -192,22 +193,22 @@ Func _Install($source_zip, $dest_dir, $RemOldDir=1, $StartShortcuts=1, $DesktopS
RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler", "DisplayName", "REG_SZ", $ProgramName)
RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler", "DisplayVersion", "REG_SZ", $ProgramVersion)
RegWrite("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vistumbler", "Publisher", "REG_SZ", "Vistumbler.net")
Msgbox(0, "Done", "Install completed succesfully")
MsgBox(0, "Done", "Install completed succesfully")
EndIf
EndFunc
EndFunc ;==>_Install

Func _RemoveOldFiles()
DirRemove ($TmpDir, 1)
DirRemove ($Destination, 1)
DirRemove ($StartMenu_AllUsers, 1)
DirRemove ($StartMenu_CurrentUser, 1)
FileDelete ($Desktop_CurrentUser & 'Vistumbler.lnk')
FileDelete ($Desktop_AllUsers & 'Vistumbler.lnk')
EndFunc
DirRemove($TmpDir, 1)
DirRemove($Destination, 1)
DirRemove($StartMenu_AllUsers, 1)
DirRemove($StartMenu_CurrentUser, 1)
FileDelete($Desktop_CurrentUser & 'Vistumbler.lnk')
FileDelete($Desktop_AllUsers & 'Vistumbler.lnk')
EndFunc ;==>_RemoveOldFiles

Func _Exit()
FileDelete($TempSourceFiles)
FileDelete($TempLicense)
FileDelete($TempSettings)
Exit
EndFunc
EndFunc ;==>_Exit
Binary file modified Installer/VistumblerInstaller.exe
Binary file not shown.
Binary file modified Installer/vi_files.zip
Binary file not shown.

0 comments on commit 8c9c159

Please sign in to comment.