NewsArchive
04-13-2011, 12:47 AM
SetupBuilder is the best, hands down!
OK -- so I had to update my style sheet in my new release. There were two bugs in our style sheet (I forgot three characters twice) and then I wanted to add a whole new section to the bottom for our new availability calendar.
You are more than welcome to see it going here:
https://remote.roommaster.net/iqreservations/asp/home.asp (Click on new reservation and then next to see our new availability calendar)
But anyway ... back to SetupBuilder.
I couldn't wipe out my style.css (style sheet) with the new one because we have 1,000+ clients and they all have their own styles created by their web developers.
I could write a program to fix it - but why write programs when you have SetupBuilder!
So, during our upgrade ... I had two tasks.
1. Fix two lines in the CSS (style sheet)
2. Append the new portion of the style sheet at the bottom
I did try TYPE changes.tmp >> style.css but the RUN command didn't work in SetupBuilder.
But .... no need!
Did the whole thing in SetupBuilder!
Check it out.
If %IQUPDATESTYLESHEET% Equals "1" Then
Display Message Box "Press OK to update the Default style sheet (style...." -- "Updating Style Sheet"
Progress Dialog: Set Status Text #1 to "Updating Style Sheet ..."
/* find the two lines where the mistake is */
Set Variable %IQLINE1% to FUNCTION:Find Line ".rteT td, tr { /* rate breakdown table */" from "%_SB_INSTALLDIR%\IQReservations\stylesheets\style. css"
Set Variable %IQLINE2% to FUNCTION:Find Line ".rteH td, tr{ /* rate breakdown headers - day of week */" from "%_SB_INSTALLDIR%\IQReservations\stylesheets\style. css"
/* fix the mistakes! */
If %IQLINE1% Greater Than "0" Then
Text File: Replace Line "%IQLINE1%" from "%_SB_INSTALLDIR%\IQReservations\stylesheets\style. css" -- .rteT td, ..rteT tr { /* rate breakdown table */
End
If %IQLINE1% Greater Than "0" Then
Text File: Replace Line "%IQLINE2%" from "%_SB_INSTALLDIR%\IQReservations\stylesheets\style. css" -- .rteH td, rteH tr { /* rate breakdown headers - day of week */
End
/* read the temporary file that needs to be appended and add it to the users style sheet */
Loop (68 Times)
Set Variable %IQLINECOUNTER% to (Increment by 1)
Set Variable %IQNEWLINE% to FUNCTION:Get Line "%IQLINECOUNTER%" from "%_SB_INSTALLDIR%\IQReservations\stylesheets\availt able.tmp"
Text File: Insert Line "0" to "%_SB_INSTALLDIR%\IQReservations\stylesheets\style. css" -- %IQNEWLINE%
End
End
/* delete the installed work file */
Delete Files "%_SB_INSTALLDIR%\IQReservations\stylesheets\availt able.tmp"
Now, tell me that Fredrich didn’t think of EVERYTHING!
Robert Paresi
OK -- so I had to update my style sheet in my new release. There were two bugs in our style sheet (I forgot three characters twice) and then I wanted to add a whole new section to the bottom for our new availability calendar.
You are more than welcome to see it going here:
https://remote.roommaster.net/iqreservations/asp/home.asp (Click on new reservation and then next to see our new availability calendar)
But anyway ... back to SetupBuilder.
I couldn't wipe out my style.css (style sheet) with the new one because we have 1,000+ clients and they all have their own styles created by their web developers.
I could write a program to fix it - but why write programs when you have SetupBuilder!
So, during our upgrade ... I had two tasks.
1. Fix two lines in the CSS (style sheet)
2. Append the new portion of the style sheet at the bottom
I did try TYPE changes.tmp >> style.css but the RUN command didn't work in SetupBuilder.
But .... no need!
Did the whole thing in SetupBuilder!
Check it out.
If %IQUPDATESTYLESHEET% Equals "1" Then
Display Message Box "Press OK to update the Default style sheet (style...." -- "Updating Style Sheet"
Progress Dialog: Set Status Text #1 to "Updating Style Sheet ..."
/* find the two lines where the mistake is */
Set Variable %IQLINE1% to FUNCTION:Find Line ".rteT td, tr { /* rate breakdown table */" from "%_SB_INSTALLDIR%\IQReservations\stylesheets\style. css"
Set Variable %IQLINE2% to FUNCTION:Find Line ".rteH td, tr{ /* rate breakdown headers - day of week */" from "%_SB_INSTALLDIR%\IQReservations\stylesheets\style. css"
/* fix the mistakes! */
If %IQLINE1% Greater Than "0" Then
Text File: Replace Line "%IQLINE1%" from "%_SB_INSTALLDIR%\IQReservations\stylesheets\style. css" -- .rteT td, ..rteT tr { /* rate breakdown table */
End
If %IQLINE1% Greater Than "0" Then
Text File: Replace Line "%IQLINE2%" from "%_SB_INSTALLDIR%\IQReservations\stylesheets\style. css" -- .rteH td, rteH tr { /* rate breakdown headers - day of week */
End
/* read the temporary file that needs to be appended and add it to the users style sheet */
Loop (68 Times)
Set Variable %IQLINECOUNTER% to (Increment by 1)
Set Variable %IQNEWLINE% to FUNCTION:Get Line "%IQLINECOUNTER%" from "%_SB_INSTALLDIR%\IQReservations\stylesheets\availt able.tmp"
Text File: Insert Line "0" to "%_SB_INSTALLDIR%\IQReservations\stylesheets\style. css" -- %IQNEWLINE%
End
End
/* delete the installed work file */
Delete Files "%_SB_INSTALLDIR%\IQReservations\stylesheets\availt able.tmp"
Now, tell me that Fredrich didn’t think of EVERYTHING!
Robert Paresi