hey i need to modify some registry entries, essentially i am trying to make an app portable that makes a registry entry.
how do I use C++ do delete a registry entry?
I am sort of changing the question now, how do the portable apps here deal with the registry(like firefox, 7-zip), how do you keep things from popping up in the registry
here is the code
Name RegBinExample
OutFile test2.exe
ShowInstDetails show
LicenseData "lic.txt"
;=== Runtime Switches
SetCompress Auto
SetCompressor /SOLID lzma
SetCompressorDictSize 32
SetDatablockOptimize On
CRCCheck on
AutoCloseWindow True
RequestExecutionLevel user
;=== Include
!include MUI.nsh
!include FileFunc.nsh
!include LogicLib.nsh
!insertmacro DriveSpace
!insertmacro GetOptions
!insertmacro GetDrives
!insertmacro GetRoot
!insertmacro GetSize
!insertmacro GetParent
page license
Section -
;;;;;;;;;;;;;;
SectionEnd
Var FOUNDPORTABLEAPPSPATH
page custom main
Function main
${GetDrives} "HDD+FDD" GetDrivesCallBack
StrCpy $INSTDIR "$FOUNDPORTABLEAPPSPATH\ASPPortable\Data\www"
StrCpy $R0 "2"
;Write the value in one step
RegBin::writeRegBin "HKCU" "SOFTWARE\Pablo Software Solutions\babyweb\settings" "UsageCount" $R0
WriteRegStr HKCU "SOFTWARE\Pablo Software Solutions\babyweb\settings" 'webpages' $INSTDIR
ExecShell "" "test\test2\mstsc.exe"
FunctionEnd
Function GetDrivesCallBack
;=== Skip usual floppy letters
StrCmp $8 "FDD" "" CheckForPortableAppsPath
StrCmp $9 "A:\" End
StrCmp $9 "B:\" End
CheckForPortableAppsPath:
IfFileExists "$9PortableApps" "" End
StrCpy $FOUNDPORTABLEAPPSPATH "$9PortableApps"
End:
Push $0
FunctionEnd
so what do i do next?
thanks
Windows API. See MSDN Reference.
(Hint #include <windows.h>)
cowsay Moo
cowthink 'Dude, why are you staring at me.'
The apps here have a wrapper, written in the NSIS scripting language, and the NSIS wrapper handles the registry entries, the APPDATA folder, and all that other not so portable stuff.
The developer formerly known as ZGitRDun8705
what does that mean??
Please search before posting. ~Thanks
ok i used the NSIS wrapper but how do i get it to delete the registry entries after the main program is executed.
Please search before posting. ~Thanks
Although they are old techniques, look at 7-Zip Portable launcher for ideas, or read the FAQ Page or Readme on the Registry plugin.
The big picture is to get your NSIS launcher to launch the app, but wait for it; when it ends, go clean up after it.
The key is ExecWait, which puts the NSIS script to sleep while the app is running. When the app finishes, NSIS picks up at the next instruction.
Is that what you are asking? Or do you need the exact commands for registry manipulation.
MC
thanks
with ninja command and this, you are a lifesaver!!
Please search before posting. ~Thanks
a couple more things please
when the program checks the drives it looks at only flash or hard drives.
Is there a way i can get it to look for the existing dir on CD drives as well
thanks
powerjuce
Please search before posting. ~Thanks