I have added a text file to the project as a support file, and intend to use it to configure the set of registry values that will be written on install (by storing values in this file as a comma separated list Type, Key, Name, Value.
I am currently using the following script to do this:
Set Variable REGISTRY_ENTRY to
Set Variable REGISTRY_ENTRY_EOF to
Set Variable REGISTRY_TYPE to
Set Variable REGISTRY_VALUE to
Set Variable REGISTRY_KEY to
Set Variable REGISTRY_DATA to
label: READ_REG_FILE
if Variable Remove not Equals TRUE
Read from Text File $SUPPORTDIR$\\RegistrySettings.txt into Variable REGISTRY_ENTRY (get EOF into REGISTRY_ENTRY_EOF)
Parse String $REGISTRY_ENTRY$ into Variables REGISTRY_TYPE and REGISTRY_ENTRY (Split at first occurrence of pattern)
Parse String $REGISTRY_ENTRY$ into Variables REGISTRY_KEY and REGISTRY_VALUE (Split at first occurrence of pattern)
Parse String $REGISTRY_VALUE$ into Variables REGISTRY_VALUE and REGISTRY_DATA (Split at first occurrence of pattern)
if Variable REGISTRY_TYPE Equals String
Write Registry Key HKCU\\$REGISTRY_KEY$\\$REGISTRY_VALUE$, $REGISTRY_DATA$
end
if Variable REGISTRY_TYPE Equals Int
Write Registry Key HKCU\\$REGISTRY_KEY$\\$REGISTRY_VALUE$, $REGISTRY_DATA$
end
if Variable REGISTRY_TYPE Equals Binary
Write Registry Key HKCU\\$REGISTRY_KEY$\\$REGISTRY_VALUE$, $REGISTRY_DATA$
end
if Variable REGISTRY_ENTRY_EOF Equals FALSE
GoTo Label: READ_REG_FILE
end
end
This looks to me like it should work, but when I run it, only the last line of the file is actually written to the registry. Does anyone know why this is?
Writing values from a text file to the registry
-
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
This is because you cannot loop Windows Installer commands in the setup script - please read this whitepaper for information:
http://www.installaware.com/msicode_scr ... nology.pdf
http://www.installaware.com/msicode_scr ... nology.pdf
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
-
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
You can just merge a .reg file silently at install time.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
-
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
Use Run Program with regedit to silently merge the .reg file with your registry. The silent parameter might be /s or /y - a quick Google search should reveal this information for you.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
Who is online
Users browsing this forum: No registered users and 218 guests