save file path to registry

Got a problem you cannot solve? Try here.
ruebenramirez
Posts: 2
Joined: Wed Sep 26, 2007 2:18 pm

save file path to registry

Postby ruebenramirez » Wed Sep 26, 2007 2:37 pm

I am testing IA to see if it is worth switching away from NSIS. I would like to know how to save the folder path the files of a "feature" were saved to. In using the gui to drag and drop the files, the following code was output:

Get Component Direct Route Selection State into Variable SELECTED
if Variable SELECTED Equals TRUE
Install Files C:\\Program Files\\DirectRt\\Data\\DirectRt.ini to $WINDIR$
Install Files C:\\Program Files\\DirectRt\\Zip9Data\\*.* to $PROGRAMFILES$\\DirectRt\\Zip9Data, include subfolders
Install Files C:\\Program Files\\DirectRt\\MAPS\\*.* to $PROGRAMFILES$\\DirectRt\\MAPS, include subfolders
Install Files C:\\Program Files\\DirectRt\\Data\\*.* to $PROGRAMFILES$\\DirectRt\\Data, include subfolders
Install Files C:\\Program Files\\DirectRt\\BASEMAPS\\*.* to $PROGRAMFILES$\\DirectRt\\BASEMAPS, include subfolders
Install Files C:\\Program Files\\DirectRt\\Address Cleanup\\*.* to $PROGRAMFILES$\\DirectRt\\Address Cleanup, include subfolders
Install Files C:\\Program Files\\DirectRt\\APPLYBND.exe to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\Direct Route Reference Manual.pdf to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\Direct Route with MapInfo Training Guide.pdf to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\DR32.exe to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\F8.DRP to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\F8.HRP to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\F8.SRP to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\F9.DRP to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\F9.HRP to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\F9.SRP to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\F10.DRP to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\F10.HRP to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\F10.SRP to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\FIXROUTE.exe to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\GWRTPLUS.HLP to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\id.dat to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\install.log to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\mapinfoversiondirectroute.txt to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\mfc42.dll to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\ORDERSIZESELECTION.exe to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\PICKDIST.exe to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\Proph2.DLL to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\SETEQCODE.exe to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\unstall.exe to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\UNZDLL32.DLL to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\UTILSCFG.INI to $PROGRAMFILES$\\DirectRt
Install Files C:\\Program Files\\DirectRt\\XLSPLIT.exe to $PROGRAMFILES$\\DirectRt
Set Variable directrtPath to targetdir
end



I'm not familiar enough with IA to know what will happen but this is what I'm thinking will happen:
If the feature is installed to a non-standard directory, the $PROGRAMFILES$ variable will be obsolete and I will be writing my dynamically generated file to a wrong directory. So it will do me no good to save a reference to $PROGRAMFILES$\\DirectRt.

Again, I used the gui to do this so this is all generated code. In my NSIS code I am setting a variable with the correct folder path, copying the files to this path, and then writing the file with the correct paths. (based from this variable..)

Will I have to manually change each line of the generated code in order to make this happen or is there an alternative? My installer will include a significantly large amount of files, so opening up each line by double clicking through the msi code interface will not be an option. (I might just be better off with NSIS in this case.)

Thanks in advance,
Rueben

Alex_Ronquillo
Site Admin
Posts: 364
Joined: Mon Jul 30, 2007 11:51 am
Location: USA
Contact:

Postby Alex_Ronquillo » Wed Sep 26, 2007 4:40 pm

That's why the $TARGETDIR$ variable is there. This variable is set by you by default, and may be changed by the user. This means that even if the user installs your application to a non-standard folder, you still have a reference to it.

BTW, If you install files to $PROGRAMFILES$\\DirectRt as you are doing it in your code, it doesn't matter where the user specifies he/she wants the files to install, they will always install to $PROGRAMFILES$\\DirectRt
Alejandro Ronquillo
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 104 guests