PDA

View Full Version : multiple releases



tenalra
07-19-2005, 08:46 AM
Hi,

I can't find a common solution for managing multiple releases... I have 1 main release. If I want to build a patch for it I have to create a new setup of the newly compiled (patched) application. My question is: I used to have one main bin dir from where I created the setups. For the patch version I overwrite the files in the bin directory to create a new setup of. Problem is that I can't build my main setup anymore now, because the original files where replaced by the new files. If I put the patched compiled app in another dir I have to change the paths in Installshield in order to maintain the original files... What's common use in this situation? I want to build old releases again from the original binairies if I want. But I have to build patches as well with new setups from different files (the patched ones). Should I copy the patched files over the original files to create a new setup (and make a patch) or must I use another directory (and thus change my directory pointers to another dir) for the new setup in order to maintain my original files....?? Thanks in advance...
tenalra

SGorman
07-19-2005, 08:49 AM
I use different paths and use the WI automation interface to change the path variable values programmatically as part of my build.

tenalra
07-19-2005, 08:59 AM
Where can I find the WI automation interface?? Never heard of...

Thank you!

SGorman
07-19-2005, 09:07 AM
InstallShield has an automation interface that allows you to modify the install project or to build it.
The Windows Installer itself also has an automation interface.
Because an InstallShield project (.ISM) is merely a renamed windows installer database (.MSI) you can use the Windows Installer automation interface on an install shield project.

Any scripting method (vbScript, etc.) that supports interacting with COM objects can be used to access these automation interfaces.

Try this link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/automation_interface_reference.asp

Here is some sample code for the Windows Installer interface for changing a path variable. Note that I had to fiddle around with the use of quotes in the SELECT statement to finally get the syntax right:
dim WshShell
set WshShell = WScript.CreateObject("WScript.Shell")

'the .ISM is assumed to be in the same dir as this .vbs
STRPath = WshShell.CurrentDirectory
ISMPath = STRPath & "\MyProject.ism"

'open the .ISM as a Windows Installer object
dim database, installer, view, record
set installer = CreateObject("WindowsInstaller.Installer")
set database = installer.OpenDatabase(ISMPath,1)

sqlQuery = "SELECT * FROM `ISPathVariable` WHERE `ISPathVariable`.`ISPathVariable`='MY_PATH_VARIABLE'"
set view = database.OpenView(sqlQuery)
view.Execute
set record = view.Fetch
'make the change
record.StringData(2)="C:\MyNewpath"
'save the changes
view.Modify 2,record
view.Close
database.Commit

'close up
set installer = Nothing

tenalra
07-19-2005, 09:16 AM
So you created your own script to change path variables.... hmm sounds like pretty much work for such a common problem...

SGorman
07-19-2005, 09:19 AM
I find it odd that the InstallShield automation interface doesn't allow you to change path variables. So yes, I agree that it seems like a common problem (needing to change path variables) that should have a much simpler solution, but doesn't.

tenalra
07-20-2005, 05:18 AM
Anybody else with a common solution? I don't feel much for changing the dir pointers everytime, and don't want to overwrite the previous binairies in order to build a new setup......