@@ -119,6 +119,178 @@ Apps Included and updated as of 3/7/2027:
119119 - Can only be ran from USB!
120120 - OSDXMB can only be ran from USB!
121121
122+ ## APPINFO.PBT SAS (SAVE APPLICATION SUPPORT) Example
123+
124+ ??? note "APPINFO.PBT SAS Example
125+ ```
126+ # SAS (Save Application Support) compliant BM Script:
127+ # Due to wildcard bug on memory card, APPINFO.PBT can not be in root folders where elf exists, so APPINFO.PBT will be in mc?:/BM/APPS/
128+ # Memory Card structure mc?:/BM/APPS/$SAS$/APPINFO.PBT and elf in mc?:/$SAS$/APPINFO.PBT
129+ # Non-Memory Card Structure: device:/$SAS$/APPINFO.PBT or device:/APPS/$SAS$/APPINFO.PBT NOTE: $PWD$ should work for both.
130+
131+ # Change this information to describe the application and where it should be ran from for memcard (SAS) or other devices (SAS_NON_MC)
132+ # SAS is the App folder name. SAS_NON_MC defines if app is in root of non-memcard device (non_mc:/$SAS$) or APP folder (non_mc:/APPS/$SAS$)
133+ # This is so that you do not have to edit any info below line 20.
134+ #
135+ # Some devices are case sensitive! Make sure you case matches!
136+ #
137+ SET "TITLE" "PS2Temps"
138+ SET "VERSION" "1.0"
139+ SET "AUTHOR" "jolek and akuhak"
140+ SET "DESC" "Monitor your PS2 CPU and Mechacon Temps (if applicable)"
141+ SET "MEDIAS" ""
142+ SET "ELF" "PS2Temps.elf"
143+ SET "SAS" "DST_PS2TEMPS"
144+ # Comment out 1 of the 2 lines below. If app is in non-mc:/$SAS$ comment out line 19. If app is in non-mc:/APPS/$SAS$ comment out line 18
145+ # SET "SAS_NON_MC" "$SAS$"
146+ SET "SAS_NON_MC" "APPS/$SAS$"
147+ #
148+
149+
150+ # Do not change these 2 lines!
151+ GOTO "$ARG1$"
152+ RETURN -1
153+
154+ # :LABEL_NAME
155+ # ADDWIDGET "LABEL" "$ARG2$$TITLE$ v$VERSION$"
156+ # EXIT 0
157+
158+ :QUERY
159+ ADDWIDGET "CALL" "$TITLE$" "$BM.TXT_VERSION$: $VERSION$ $BM.TXT_AUTHOR$: $AUTHOR$ $BM.TXT_DESC$: $DESC$" $ARG2$ "$ARG0$" "$ARG3$" "$ARG4$" "$ARG5$"
160+ EXIT 0
161+
162+ :INSTALL
163+ PARSEPATH "$PWD$" "SRC_DEV" "SRC_PATH" "SRC_FILE"
164+
165+
166+ IF MATCHES "mc?" "$SRC_DEV$"
167+ IF MATCHES "mc?" "$ARG2$"
168+ GOTO "INSTALL_MC_TO_MC"
169+ ELSEIF NOT MATCHES "mc?" "$ARG2$"
170+ GOTO "INSTALL_MC_TO_NONMC"
171+ ENDIF
172+ ELSEIF NOT MATCHES "mc?" "$SRC_DEV$"
173+ IF MATCHES "mc?" "$ARG2$"
174+ GOTO "INSTALL_NONMC_TO_MC"
175+ ELSEIF NOT MATCHES "mc?" "$ARG2$"
176+ GOTO "INSTALL_NONMC_TO_NONMC"
177+ ENDIF
178+
179+ :INSTALL_MC_TO_MC
180+ # Copies where APPINFO.PBT can be found in mc?:/BM/APPS/$SAS$
181+ IF FAIL COPY "$PWD$" "$ARG2$:/BM/APPS/$SAS$"
182+ MESSAGE "Failed installing APPINFO.PBT"
183+ RRM "$ARG2$:/BM/APPS/$SAS$"
184+ RETURN -1
185+ # Copies SAS app folder from root of mc? for SAS support
186+ ELSEIF FAIL COPY "$SRC_DEV$:/$SAS$" "$ARG2$:/$SAS$"
187+ MESSAGE "Failed installing $TITLE$"
188+ RRM "$ARG2$:/$SAS$"
189+ RETURN -1
190+ ELSEIF NOT EXISTS "$ARG2$:/BM/bman.icn"
191+ GOTO "INSTALL_MC_ICON"
192+ ELSEIF NOT EXISTS "$ARG2$:/BM/icon.sys"
193+ GOTO "INSTALL_MC_ICON"
194+ ENDIF
195+ EXIT 0
196+
197+ :INSTALL_MC_TO_NONMC
198+ IF FAIL COPY "$SRC_DEV$:/$SAS$" "$ARG2$:/$SAS_NON_MC$"
199+ MESSAGE "Failed installing $TITLE$"
200+ RRM "$ARG2$:/$SAS_NON_MC$"
201+ RETURN -1
202+ ENDIF
203+ EXIT 0
204+
205+ :INSTALL_NONMC_TO_NONMC
206+ IF FAIL COPY "$PWD$" "$ARG2$:/$SAS_NON_MC$"
207+ MESSAGE "Failed installing $TITLE$"
208+ RRM "$ARG2$:/$SAS_NON_MC$"
209+ RETURN -1
210+ ENDIF
211+ EXIT 0
212+
213+ :INSTALL_NONMC_TO_MC
214+ # Creates folder and copies where APPINFO.PBT can be found in mc?:/BM/APPS/$SAS$
215+ # NOTE: COPY function below fails HOWEVER does create the $SAS$ folder with nothing in it...
216+ # this is why I (R3Z3N) do not use IF FAIL COPY. Trust me, I tried the usual way as found in the BM installer APPINFO.PBT with MKDIR
217+ # Odd. Had to use a bug to create this folder...notice the slash at end of destination
218+ COPY "$PWD$" "$ARG2$:/BM/APPS/$SAS$/"
219+ # Copies where APPINFO.PBT can be found in mc?:/BM/APPS/$SAS$/APPINFO.PBT
220+ IF FAIL COPY "$ARG0$" "$ARG2$:/BM/APPS/$SAS$/APPINFO.PBT"
221+ MESSAGE "Failed installing APPINFO.PBT"
222+ RRM "$ARG2$:/BM/APPS/$SAS$"
223+ RETURN -1
224+ # Copies SAS app folder to root of mc? for SAS support
225+ ELSEIF FAIL COPY "$PWD$" "$ARG2$:/$SAS$"
226+ ECHO "Failed installing $TITLE$"
227+ MESSAGE "Failed installing $TITLE$"
228+ RRM "$ARG2$:/$SAS$"
229+ RETURN -1
230+ # Create icons if needed so OSDSYS does not show corrupt
231+ ELSEIF NOT EXISTS "$ARG2$:/BM/bman.icn"
232+ GOTO "INSTALL_MC_ICON"
233+ ELSEIF NOT EXISTS "$ARG2$:/BM/icon.sys"
234+ GOTO "INSTALL_MC_ICON"
235+ ENDIF
236+ EXIT 0
237+
238+ :INSTALL_MC_ICON
239+ IF FAIL COPY "$BM.BM_PATH$/bman.icn" "$ARG2$:/BM/bman.icn"
240+ MESSAGE "Failed to install $BM.BM_PATH$/bman.icn"
241+ RETURN -1
242+ ELSEIF FAIL COPY "$BM.BM_PATH$/icon.sys" "$ARG2$:/BM/icon.sys"
243+ MESSAGE "Failed to install $BM.BM_PATH$/bman.icn"
244+ RETURN -1
245+ ENDIF
246+ EXIT 0
247+
248+ :REMOVE
249+ PARSEPATH "$PWD$" "SRC_DEV" "SRC_PATH" "SRC_FILE"
250+
251+ IF MATCHES "mc?" "$SRC_DEV$"
252+ GOTO "REMOVE_MC"
253+ ELSEIF NOT MATCHES "mc?" "$SRC_DEV$"
254+ GOTO "REMOVE_PWD"
255+ ENDIF
256+
257+ :REMOVE_MC
258+ IF FAIL RRM "$SRC_DEV$:/$SAS$"
259+ MESSAGE "Failed removing $SRC_DEV$:/$SAS$"
260+ RETURN -1
261+ ENDIF
262+ GOTO "REMOVE_PWD"
263+
264+ :REMOVE_PWD
265+ # Odd bug: needs to loop 2x to remove contents, otherwise first run only APPINFO.PBT is removed
266+ IF FAIL RRM "$PWD$"
267+ GOTO "REMOVE_PWD"
268+ MESSAGE "Failed removing $TITLE$"
269+ RETURN -1
270+ ENDIF
271+ EXIT 0
272+
273+ :RUN
274+ PARSEPATH "$PWD$" "SRC_DEV" "SRC_PATH" "SRC_FILE"
275+
276+ IF MATCHES "mc?" "$SRC_DEV$"
277+ LOADEXEC "PBAT" "$BM.SCRIPTS$/LOADEXEC.PBT" "$SRC_DEV$:/$SAS$/$ELF$"
278+ EXIT 0
279+ ELSEIF MATCHES "host" "$SRC_DEV$"
280+ MESSAGE "Run with PS2Client instead!"
281+ EXIT 0
282+ ELSEIF NOT MATCHES "mc?" "$SRC_DEV$"
283+ IF MATCHES "host" "$SRC_DEV$"
284+ MESSAGE "Run with PS2Client instead on PC!"
285+ EXIT 0
286+ ELSE
287+ LOADEXEC "PBAT" "$BM.SCRIPTS$/LOADEXEC.PBT" "$PWD$/$ELF$"
288+ EXIT 0
289+ ENDIF
290+ ENDIF
291+ EXIT 0
292+ ```
293+
122294
123295## APPINFO.PBT Example
124296
0 commit comments