tfair
04-04-2007, 11:11 AM
I'm sure this must be very basic and with many solutions, but I am struggling with SF 5 and need to know if SF version 7 can do it more easily:
I am installing only some files from a CD onto the user's computer, and want my program to run from the CD.
In order to do this, I have tried using SF to do a preinstallation check that looks into the registry to see if the key exists and if not, proceeds with the install and if found, simply launches the main executable. I could have used an ini file or some other approach I suppose but this seemed the most direct.
In SF 5, I created a presetup.exe file, doing the following:
1. Removed all screens from the screen manager, and did not add any files to the setup.
2. Created a variable called PrevLoaded. The default is FALSE and is set to TRUE if the registry subkey exists. The main key is HKEY_CURRENT_USER.
3. Added 2 shell operations conditional on the value of PrevLoaded. Not equal to TRUE executes the setup.exe to install the files. If equal to TRUE, the main executable is simply launched from the CD.
What happens is that the setup.exe is properly launched the first time around and files are installed. I check the registry subkey using regedit and it is indeed there at the correct location. However, on any following insertions of the CD, the presetup simply launches the setup.exe again, as if the PrevLoaded variable has not been set to TRUE. I've looked at the Shell Operations window's Advanced tab and played with "When do you want he operation to perform?" but am no wiser after fiddling with the sequence.
Any advice greatly appreciated.
I am installing only some files from a CD onto the user's computer, and want my program to run from the CD.
In order to do this, I have tried using SF to do a preinstallation check that looks into the registry to see if the key exists and if not, proceeds with the install and if found, simply launches the main executable. I could have used an ini file or some other approach I suppose but this seemed the most direct.
In SF 5, I created a presetup.exe file, doing the following:
1. Removed all screens from the screen manager, and did not add any files to the setup.
2. Created a variable called PrevLoaded. The default is FALSE and is set to TRUE if the registry subkey exists. The main key is HKEY_CURRENT_USER.
3. Added 2 shell operations conditional on the value of PrevLoaded. Not equal to TRUE executes the setup.exe to install the files. If equal to TRUE, the main executable is simply launched from the CD.
What happens is that the setup.exe is properly launched the first time around and files are installed. I check the registry subkey using regedit and it is indeed there at the correct location. However, on any following insertions of the CD, the presetup simply launches the setup.exe again, as if the PrevLoaded variable has not been set to TRUE. I've looked at the Shell Operations window's Advanced tab and played with "When do you want he operation to perform?" but am no wiser after fiddling with the sequence.
Any advice greatly appreciated.