Skip to content

Commit

Permalink
Add file size check for config.ini
Browse files Browse the repository at this point in the history
  • Loading branch information
SaifAqqad committed Aug 6, 2020
1 parent 78f8fc2 commit dbf3649
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion resources.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ global device_name:="", global hotkey_mute:="", global hotkey_unmute:=""
global sound_feedback:="", global OSD_feedback:=""
global exclude_fullscreen:="", global sys_update:=""
global mute_ico:="", global default_ico:=""
if (!FileExist("config.ini")) {
if (!FileExist("config.ini") || isFileEmpty("config.ini")) {
IniWrite, Microphone=""`nMuteHotkey=""`nUnmuteHotkey=""`nSoundFeedback=`nOnscreenFeedback=`nExcludeFullscreen=`nUpdateWithSystem=`n, config.ini, settings
edit_config()
}
Expand All @@ -29,4 +29,8 @@ load_config(){
edit_config(){
RunWait, config.ini
Reload
}
isFileEmpty(file){
FileGetSize, size , %file%
return !size
}

0 comments on commit dbf3649

Please sign in to comment.