Skip to content

Commit 8040fad

Browse files
authored
v6.0 final - GUI options, key as password, BAT91
- fixed Choices dialog 1st run warning - more descriptive password usage info
1 parent 577dc34 commit 8040fad

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Compressed 2 TXT.bat

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ $Main = {
3939
Add-Type -As 'Microsoft.VisualBasic'
4040
$key = [Microsoft.VisualBasic.Interaction]::InputBox("Press enter to accept $randomized key:", 'BAT'+$chars, $key)
4141
if (!$key -or $key.Trim().Length -ne $chars -or (($key.Trim().ToCharArray()|sort -unique) -join '') -ne $dict) {
42-
write-host "`nERROR! Key must be $chars chars long containing only non-repeating:" -fore Yellow; echo "$dict`n"; exit
42+
write-host "`nERROR! Key must be $chars chars long with only non-repeating, shuffled:" -fore Yellow; echo "$dict`n"
43+
exit
4344
}
4445
}
4546

@@ -223,7 +224,7 @@ public class BAT91 {
223224
# Choices dialog snippet - parameters: 1=allchoices, 2=default; [optional] 3=title, 4=textsize, 5=backcolor, 6=textcolor
224225
function Choices($all, $def, $n='Choices', [byte]$sz=12, $bc='MidnightBlue', $fc='Snow', $saved='HKCU:\Environment'){
225226
[void][Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms'); $f=new-object Windows.Forms.Form
226-
$a=$all.split(','); $s=$def.split(','); $reg=gp $saved -ea 0; if($reg){ $s=$reg.$n.split(',') };
227+
$a=$all.split(','); $s=$def.split(','); $reg=(gp $saved -ea 0).$n; if($reg.length) {$s=$reg.$n.split(',')}
227228
function rst(){ $cb | %{ $_.Checked=0; if($s -contains $_.Name){ $_.Checked=1 } } }; $f.Add_Shown({rst; $f.Activate()})
228229
$cb=@(); $i=1; $a | %{ $c=new-object Windows.Forms.CheckBox; $cb+=$c; $c.Text=$_; $c.AutoSize=1;
229230
$c.Margin='8,4,8,4'; $c.Location='64,'+($sz*3*$i-$sz); $c.Font='Tahoma,'+$sz; $c.Name=$i; $f.Controls.Add($c); $i++}

0 commit comments

Comments
 (0)