@@ -242,6 +242,7 @@ pub enum Entry {
242
242
ini_file : I32 ,
243
243
} = 49u32 . to_le ( ) ,
244
244
DeleteReg {
245
+ reserved : I32 ,
245
246
root : RegRoot ,
246
247
key_name : I32 ,
247
248
value_name : I32 ,
@@ -323,28 +324,28 @@ pub enum Entry {
323
324
324
325
impl Entry {
325
326
#[ expect( clippy:: cast_possible_truncation, clippy:: cast_possible_wrap) ]
326
- pub fn update_vars ( & self , state : & mut NsisState ) {
327
+ pub fn execute ( & self , state : & mut NsisState ) {
327
328
match self {
328
329
Self :: GetFullPathname { output, input } => {
329
- state. user_variables . insert (
330
+ state. variables . insert (
330
331
output. get ( ) . unsigned_abs ( ) as usize ,
331
332
state. get_string ( input. get ( ) ) ,
332
333
) ;
333
334
}
334
335
Self :: SearchPath { output, filename } => {
335
- state. user_variables . insert (
336
+ state. variables . insert (
336
337
output. get ( ) . unsigned_abs ( ) as usize ,
337
338
state. get_string ( filename. get ( ) ) ,
338
339
) ;
339
340
}
340
341
Self :: GetTempFilename { output, base_dir } => {
341
- state. user_variables . insert (
342
+ state. variables . insert (
342
343
output. get ( ) . unsigned_abs ( ) as usize ,
343
344
state. get_string ( base_dir. get ( ) ) ,
344
345
) ;
345
346
}
346
347
Self :: StrLen { output, input } => {
347
- state. user_variables . insert (
348
+ state. variables . insert (
348
349
output. get ( ) . unsigned_abs ( ) as usize ,
349
350
Cow :: Owned ( state. get_string ( input. get ( ) ) . len ( ) . to_string ( ) ) ,
350
351
) ;
@@ -370,7 +371,7 @@ impl Entry {
370
371
371
372
let start = u32:: try_from ( start) . unwrap_or_default ( ) ;
372
373
if start < result. len ( ) as u32 {
373
- state. user_variables . insert (
374
+ state. variables . insert (
374
375
variable. get ( ) . unsigned_abs ( ) as usize ,
375
376
match result {
376
377
Cow :: Borrowed ( borrowed) => {
@@ -385,7 +386,7 @@ impl Entry {
385
386
}
386
387
} else {
387
388
state
388
- . user_variables
389
+ . variables
389
390
. remove ( & ( variable. get ( ) . unsigned_abs ( ) as usize ) ) ;
390
391
}
391
392
}
@@ -394,7 +395,7 @@ impl Entry {
394
395
string_with_env_variables,
395
396
..
396
397
} => {
397
- state. user_variables . insert (
398
+ state. variables . insert (
398
399
output. get ( ) . unsigned_abs ( ) as usize ,
399
400
state. get_string ( string_with_env_variables. get ( ) ) ,
400
401
) ;
@@ -422,7 +423,7 @@ impl Entry {
422
423
13 => ( ( input1. get ( ) as u32 ) . wrapping_shr ( input2. get ( ) as u32 ) ) as i32 ,
423
424
_ => input1. get ( ) ,
424
425
} ;
425
- state. user_variables . insert (
426
+ state. variables . insert (
426
427
output. get ( ) . unsigned_abs ( ) as usize ,
427
428
Cow :: Owned ( result. to_string ( ) ) ,
428
429
) ;
@@ -440,13 +441,27 @@ impl Entry {
440
441
} else if * push_pop == PushPop :: Pop {
441
442
if let Some ( variable) = state. stack . pop ( ) {
442
443
state
443
- . user_variables
444
+ . variables
444
445
. insert ( variable_or_string. get ( ) . unsigned_abs ( ) as usize , variable) ;
445
446
}
446
447
} else if * push_pop == PushPop :: Push {
447
448
state. stack . push ( state. get_string ( variable_or_string. get ( ) ) ) ;
448
449
}
449
450
}
451
+ Self :: WriteReg {
452
+ root,
453
+ key_name,
454
+ value_name,
455
+ value,
456
+ ..
457
+ } => {
458
+ state. registry . set_value (
459
+ * root,
460
+ state. get_string ( key_name. get ( ) ) ,
461
+ state. get_string ( value_name. get ( ) ) ,
462
+ state. get_string ( value. get ( ) ) ,
463
+ ) ;
464
+ }
450
465
_ => { }
451
466
}
452
467
}
0 commit comments