Hello,
First of all: my mother tongue (born language) is Spanish. I will try to make this an "understandable" English post.
I'm trying to make my own CIA installer and I have a problem installing the file. The application it's running as a CIA.
My intention it's to make a cool-looking "install and delete" cia installer, so it will look great and also will work like the "Install All CIAs" funtion but also will delete the cia file after the installation.
I used the compiled LPP-3DS elf in your repository (in the "bin" folder) (I striped it, off course). Then I make the CIA file with the cia_workaround.rsf in the repository. It works perfectly, I even made a hello world app.
The problem is creating the CIA installer. The interface works great, the problem is when the software tries to install the file. It shows the cover art (see the code for reference) and after a few seconds (may vary in dependence of the file size) it jumps to the next game and does not installs nothing (see code for reference). I have enough space (16GB SD Card with 10GB of free space, so that's not the deal).
The code it's below this line and also it's attached to thepost (I comment it), if I made any mistake, please, let me know where. Thanks
First of all: my mother tongue (born language) is Spanish. I will try to make this an "understandable" English post.
I'm trying to make my own CIA installer and I have a problem installing the file. The application it's running as a CIA.
My intention it's to make a cool-looking "install and delete" cia installer, so it will look great and also will work like the "Install All CIAs" funtion but also will delete the cia file after the installation.
I used the compiled LPP-3DS elf in your repository (in the "bin" folder) (I striped it, off course). Then I make the CIA file with the cia_workaround.rsf in the repository. It works perfectly, I even made a hello world app.
The problem is creating the CIA installer. The interface works great, the problem is when the software tries to install the file. It shows the cover art (see the code for reference) and after a few seconds (may vary in dependence of the file size) it jumps to the next game and does not installs nothing (see code for reference). I have enough space (16GB SD Card with 10GB of free space, so that's not the deal).
The code it's below this line and also it's attached to thepost (I comment it), if I made any mistake, please, let me know where. Thanks
Code:
--Code START-------------------------------------------------------------------------------
--my mothertongue it's spanish so I made a small variable name translation as a commentary, example in the next line:
--hola = 1+2 --hola means hello
--I also write some "lazy" commentaries in my very bad english.
Screen.refresh()
Screen.clear(TOP_SCREEN)
Screen.clear(BOTTOM_SCREEN)
--load the interface background pictures for the software
LWNOADV = Screen.loadImage("/backgrounds/bottom/LWNOADV.PNG") --normal bottom screen
LOWWADV = Screen.loadImage("/backgrounds/bottom/LOWWADV.PNG") --bottom screen with the "do not shutdown" warning
EXITING = Screen.loadImage("/backgrounds/upper/EXITING.PNG") --the "all done / wave bye bye" screen
LOADING = Screen.loadImage("/backgrounds/upper/LOADING.PNG") --the loading list of games screen
INSTBKG = Screen.loadImage("/backgrounds/upper/INSTBKG.PNG") --the background for the game installation screen (haves a black space for the cover art of the game)
Screen.drawImage(0,0,LOADING,TOP_SCREEN)
Screen.drawImage(0,0,LWNOADV,BOTTOM_SCREEN)
Screen.waitVblankStart()
Screen.flip()
Screen.refresh()
Controls.init()
pad = Controls.read()
white = Color.new(255,255,255)
here="/InstDir/"
for zzz = 1,5 do -- I repeat this to be able of at least read the loading text
Controls.init()
pad = Controls.read()
Screen.waitVblankStart()
Screen.drawImage(0,0,LOADING,TOP_SCREEN)
Screen.drawImage(0,0,LWNOADV,BOTTOM_SCREEN)
Screen.flip()
Screen.refresh()
end
--lets stop here and let me explain something:
--the structure its the same:
-- "SDMC:/InstDir/[GAMENAME]/CTR-P-GAME.CIA" for the CIA file
-- "SDMC:/InstDir/[GAMENAME]/CTR-P-GAME.PNG" for the cover art (must be 186x165)
--example:
-- "SDMC:/InstDir/Mario 3D Land/CTR-P-GAME.CIA"
-- "SDMC:/InstDir/Mario 3D Land/CTR-P-GAME.PNG"
-- "SDMC:/InstDir/Fantasy Life/CTR-P-GAME.CIA"
-- "SDMC:/InstDir/Fantasy Life/CTR-P-GAME.PNG"
-- "SDMC:/InstDir/Power Rangers/CTR-P-GAME.CIA"
-- "SDMC:/InstDir/Power Rangers/CTR-P-GAME.PNG"
--the name for the png and cia files will always be "CTR-P-GAME"
juegos = System.listDirectory("/InstDir/") --juego means game
totaljuegos=#juegos --juego means game
for i = 1,totaljuegos do
nombredeljuego=juegos[i].name
coverart=here..nombredeljuego.."/CTR-P-GAME.PNG" --pic must be 186x165
LITTLEG = Screen.loadImage(coverart)
Controls.init()
pad = Controls.read()
Screen.waitVblankStart()
Screen.drawImage(0,0,INSTBKG,TOP_SCREEN)
Screen.drawImage(192,60,LITTLEG,TOP_SCREEN)
Screen.drawImage(0,0,LOWWADV,BOTTOM_SCREEN)
Screen.flip()
Screen.refresh()
ciainst=here..nombredeljuego.."/CTR-P-GAME.CIA" --"nombredeljuego" means "nameofthegame"
System.installCIA(ciainst)
--dummy repetition start
pad = Controls.read()
Screen.waitVblankStart()
Screen.drawImage(0,0,INSTBKG,TOP_SCREEN)
Screen.drawImage(192,60,LITTLEG,TOP_SCREEN)
Screen.drawImage(0,0,LOWWADV,BOTTOM_SCREEN)
Screen.flip()
Screen.refresh()
--dummy repetition end
System.deleteFile(coverart)
System.deleteFile(ciainst)
System.deleteDirectory(here..nombredeljuego)
end
System.deleteDirectory("/InstDir/")
zzz=0
for zzz = 1,5 do -- I repeat this to be able of at least read the "all done, bye bye" text
Controls.init()
pad = Controls.read()
Screen.waitVblankStart()
Screen.drawImage(0,0,EXITING,TOP_SCREEN)
Screen.drawImage(0,0,LWNOADV,BOTTOM_SCREEN)
Screen.flip()
Screen.refresh()
end
System.exit()
while true do
--bla, bla, bla...tralala
end
--Code END-------------------------------------------------------------------------------