-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #275 from desktop/support-expand-sz
Add support for REG_EXPAND_SZ type
- Loading branch information
Showing
5 changed files
with
34 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,7 +75,7 @@ if (process.platform === 'win32') { | |
HKEY.HKEY_CURRENT_USER, | ||
'SOFTWARE\\Microsoft\\Windows\\CurrentVersion', | ||
'ValueTest', | ||
RegistryValueType.REG_EXPAND_SZ, | ||
RegistryValueType.REG_MULTI_SZ, | ||
'Value' | ||
) | ||
expect(result).toBeFalsy() | ||
|
@@ -130,6 +130,33 @@ if (process.platform === 'win32') { | |
expect(programFilesDir!.type).toBe('REG_SZ') | ||
expect(programFilesDir!.data).toBe('Value 123 ! [email protected] (456)') | ||
}) | ||
|
||
it('can set REG_EXPAND_SZ value for a registry key', () => { | ||
let result = false | ||
try { | ||
result = setValue( | ||
HKEY.HKEY_CURRENT_USER, | ||
'SOFTWARE\\Microsoft\\Windows\\CurrentVersion', | ||
'ValueTestExpandSz', | ||
RegistryValueType.REG_EXPAND_SZ, | ||
'Value 123 ! [email protected] (456);%NVM_HOME%;%NVM_SYMLINK%' | ||
) | ||
} catch (e) { | ||
console.log(e) | ||
} | ||
expect(result).toBeTruthy() | ||
|
||
const values = enumerateValues( | ||
HKEY.HKEY_CURRENT_USER, | ||
'SOFTWARE\\Microsoft\\Windows\\CurrentVersion' | ||
) | ||
|
||
const value = values.find(v => v.name == 'ValueTestExpandSz') | ||
expect(value!.type).toBe('REG_EXPAND_SZ') | ||
expect(value!.data).toBe( | ||
'Value 123 ! [email protected] (456);%NVM_HOME%;%NVM_SYMLINK%' | ||
) | ||
}) | ||
}) | ||
|
||
describe('createKey', () => { | ||
|