Great!. .VBS Custom action work fine. Thank for your help, Eusebiu.
So now back to my first issue, here my way to add an registry value by batch file.
If using batch file to add reg value
Code: Select all
@echo off
for /f "tokens=3" %%a in ('bcdedit /create /d "Grub4DOS" /application BOOTSECTOR') do set guid=%%a
echo %guid% > %homedrive%\ID.txt
reg add "HKLM\SOFTWARE\MY COMPANY\MY PRODUCT" /v ID /t REG_SZ /d %guid% /f
If using AI
Code: Select all
@echo off
for /f "tokens=3" %%a in ('bcdedit /create /d "Grub4DOS" /application BOOTSECTOR') do set guid=%%a
echo %guid% >%homedrive%\ID.txt
After txt file was created, a "read .txt" custom action will be launched to read text from .txt file then create a PROPERTY to add registry. And I found somethings that I must do here
http://www.advancedinstaller.com/forums ... 150#p61806.
Add a custom action which read .txt file:
Code: Select all
readFile= "path to ID.txt"
Const ForReading = 1
Set fso = CreateObject("Scripting.FileSystemObject")
Set srcFile = fso.OpenTextFile(readFile, ForReading, False)
Session.Property("ADDREG") = srcFile.ReadLine
then add launch attach batch file. Move "read .txt custom action" under "launch attach batch file" for sure that txt file was created before "read .txt custom action" launches.
Goto Registry Page, add reg with [ADDREG] at data field
Build and run the installer but it not working properly.
Please give me some suggestion if u know, thanks
FOLLOW US
Get the latest news in Application Packaging