raysmith26 Posted September 16, 2007 Posted September 16, 2007 hii am using inno setup complier to make my setup file. i have two files, one is .exe file and another is .dll file and couple of .jpg files. i want to run the .exe file whenever the user starts his computer, in other words i want to make my program load on startup. but i don't want to make it run from startup folder. i want it to run from registry, which means i want a script inno setup script which will make the program run on startup from the registry. what should i do in inno setup compiler to make my program run on startup from the registry.plz help,thanks in advance,regards,Ray
geezery Posted September 16, 2007 Posted September 16, 2007 You have to put a registry value here:HKLM\Software\Microsoft\Windows\Currentversion\RunAdd REG_SZ i.e "C:\Program Files\MyApp\myapp.exe"
Inferi0r Posted September 16, 2007 Posted September 16, 2007 The fastest start from registry is:[Registry]Root: HKU; Subkey: S-1-5-21-1606980848-1202660629-1801674531-1004\Software\Microsoft\Windows\CurrentVersion\Run; ValueName: Application; ValueType: String; ValueData: {app}\Application.exe; Tasks: start_with_win; Flags: uninsdeletevalueAnd if you want it as task:[Tasks]Name: start_with_win; Description: Start the program at Windows startup; Languages: en
raysmith26 Posted September 20, 2007 Author Posted September 20, 2007 hi allthank you geezery and Inferi0r for ur suggestions and ideas for my query. well i wanted to ask 1 more thing, before that please have a look at the following file structure.Files pattern:A.exe - This file is the main file.b.exe - This is the file which is installed on the target computer if the user opens A.exe file.c.dll - This is the supporting file , which is also installed on the target computer if the user opens A.exe fileNow, i have a file its a "A.exe" file which, when opened installs two files one is "b.exe" and another is "c.dll". so what i wanted was to take the first file "A.exe" into inno setup, make it run as the main executable file, this way it will install "b.exe" and "c.dll" file. And make the file "b.exe" start, at the startup from registry.now my question to you is, does my idiotic genius plan work? regards,
geezery Posted September 20, 2007 Posted September 20, 2007 (edited) Of course it works, but the way you are doing it sounds a bit difficult:)Here is one NSIS script that I make. There is also a regwrite to the Run path.;Sample NSIS silent installation script by Geezery;;Name of the programName "YZShadow" ;Name of the executable fileOutFile "YZShadow_setup.exe";Installation path InstallDir "$PROGRAMFILES\YZShadow\" ;Silent installation / uninstallation by default. You don't need any installation switches for example "/S"SilentInstall silent SilentUnInstall silent ;Name of the Installation sectionSection "Installation" ;Select the files you want to include to your installation (Local path = Where the files are in your hard disk)SetOutPath "$INSTDIR" File /r C:\Add\yz\*.*;We need to add this, if we want to include the uninstaller.WriteUninstaller "uninst.exe" ;Here we add the program to startupWriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "YzShadow" "@ProgFiles\YzShadow\YzShadow.exe";Here we can specify the shortcuts to create;Creates a new group in Start Menu / Programs group called S&MCreateDirectory "$SMPROGRAMS\YZShadow";Then we create shortcuts for uninstall and the program file.CreateShortCut "$SMPROGRAMS\YZShadow\YZShadow.lnk" "$INSTDIR\YZShadow.exe"CreateShortCut "$SMPROGRAMS\YZShadow\Uninstall.lnk" "$INSTDIR\Uninst.exe"SectionEnd ;Uninstallation Section - Here we specify, what we need to removeSection "Uninstall" DeleteRegValue HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" "YzShadow";Deletes all the filesDelete "$INSTDIR\*.*" RMDir "$INSTDIR" ;Remove the linksDelete "$SMPROGRAMS\YZShadow\*.*"RMDir "$SMPROGRAMS\YZShadow"SectionEnd Edited September 20, 2007 by geezery
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