Incroyable HULK Posted March 29, 2005 Share Posted March 29, 2005 I'm currently working with the InstallShield installer of various Adobe programs and I a facing a problem with the %programfiles% variable which I cannot use in the setup.iss answer file:szDir=D:\Program Files\Adobe\Photoshop CSI decided that the best way to get around this issue is to have 2 answer file. One for the case of %ProgramFiles% being located on the D:\ drive and another one for the C:\ drive...This is my current working RunOnceEx.cmd:FOR %%i IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%i:\CD.bin SET CDROM=%%i:SET ANSWERFILE=setupd.issSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY% /V TITLE /D "Stupid InstallShield Installer" /fREG ADD %KEY%\001 /VE /D "Adobe© Photoshop© CS" /fREG ADD %KEY%\001 /V 1 /D "\"%CDROM%\Adobe Photoshop CS\setup.exe\" -s -f1\"%CDROM%\Adobe Photoshop CS\%ANSWERFILE%\" -f2\"%systemdrive%\test.log\"" /fBUT I would like to put a condition to check IF %ProgramFiles%="D:\Program Files"SET ANSWERFILE=setupd.issELSESET ANSWERFILE=setupc.isswell, ahem, something like that... Can someone help me with this condition in my RunOnceEx.cmdHere is the original topic: http://www.msfn.org/board/index.php?showtopic=42541 Link to comment Share on other sites More sharing options...
gunsmokingman Posted March 29, 2005 Share Posted March 29, 2005 That Should Pass Back The First True Location.EG If It On C:\ Then C Will Be Passed If It On D:\ Then D Will Be Passed etcFOR %%i IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST "%%i:\Program Files\Adobe\Photoshop CS" SET Loc1=%%i:SET ANSWERFILE=%Loc1% Link to comment Share on other sites More sharing options...
totoymola Posted March 29, 2005 Share Posted March 29, 2005 REG ADD %KEY% /V TITLE /D "Stupid InstallShield Installer" /fHahahahaha!!! Link to comment Share on other sites More sharing options...
bufoncosmico Posted March 29, 2005 Share Posted March 29, 2005 i found on a old post a way to use %systemdrive% on a setup.iss answer file it uses a batch like this:parse.bat@echo offecho Starting...echo .echo Wait...echo .echo Waittype %systemdrive%\Photoshop\setup.txt|%windir%\sed.exe 's/\%%systemdrive\%%/%systemdrive%/g'>%systemdrive%\Photoshop\setup.isswhat you have to do is put szDir=%systemdrive%\Archivos de programa\Adobe\Photoshop CSin your setup.ss, and then rename it to setup.txtalso, you need to put the sed.exe file in the windows directorysed.exeit works perfect for me with photoshop, dreamweaver, and flash i use it like this in my RunOnceEx.cmd :REG ADD %KEY%\032 /VE /D "Adobe Photoshop CS" /fREG ADD %KEY%\032 /V 1 /D "%CDROM%\software\Photoshop\Photoshop.exe" /fREG ADD %KEY%\032 /V 2 /D "%CDROM%\software\Photoshop\parse.bat" /fREG ADD %KEY%\032 /V 3 /D "%systemdrive%\Photoshop\setup.exe -s" /fi made a sfx for the photoshop folder, it decompress to the HD, run the .bat, then run setup.exe -s, and at the end with my cleanup.cmd erase the photoshop folderits better explained here, but its in french Laboratoire des Technologies Microsoft - Supinfo Parismaybe this is what your looking for? Link to comment Share on other sites More sharing options...
Incroyable HULK Posted March 29, 2005 Author Share Posted March 29, 2005 is there a way to check with the variable %ProgramFiles% because I know that even if it is located on the D:\ drive, on a system with a lot of software there will also be a C:\Program Files because older software aren't checking for the registry value and always point to C:\Program files.So in those case your script would return the C:\ drive even if there is only 1 program at that location... Also, it should be a condition statement like I described in my first post...That Should Pass Back The First True Location.EG If It On C:\ Then C Will Be Passed If It On D:\ Then D Will Be Passed etcFOR %%i IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST "%%i:\Program Files" SET Loc1=%%i:SET ANSWERFILE=%Loc1%<{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
Dahi Posted March 29, 2005 Share Posted March 29, 2005 I'd recommend a batch file!REG ADD %KEY%\001 /V 1 /D "\"%CDROM%\Adobe Photoshop CS\SETUP.BAT\"" /fBut if you really want to to it the hard way, try this:REG ADD %KEY%\001 /V 1 /D "cmd /c if \"%ProgramFiles%\"=\"D:\Program Files\" ( \"%CDROM%\Adobe Photoshop CS\setup.exe\" -s -f1\"%CDROM%\Adobe Photoshop CS\setupd.iss\" -f2\"%systemdrive%\test.log\" ) else ( \"%CDROM%\Adobe Photoshop CS\setup.exe\" -s -f1\"%CDROM%\Adobe Photoshop CS\setupc.iss\" -f2\"%systemdrive%\test.log\" )" /f Link to comment Share on other sites More sharing options...
durex Posted March 29, 2005 Share Posted March 29, 2005 2 things Incroyable...1st off, Id check out this thread 1st... it allows you to still use variables with setup.iss.2nd, if for whatever reason you still want to use your if then statement, this is what youll want... like Dahi said, toss this in a batch file and simply call your batch file from your runonceex, instead of trying to incorporate it all in there.@echo offIF %ProgramFiles%=="D:\Program Files" ( SET ANSWERFILE=setupd.iss) ELSE (SET ANSWERFILE=setupc.iss)[<setup path>]\setup.exe" -s -f1 "%CDROM%\Adobe Photoshop CS\%ANSWERFILE%" -f2"%systemdrive%\test.log" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now