URL から .exe をダウンロードしようとしていますが、ダウンロード フォルダーではなく、必要なフォルダーに移動します。これは私がこれまでコードで持っていたものです:
Section "file" SEC07
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
push "http://www.URL.com/file.exe"
call InternetExplorerAuto_OpenURL
SectionEnd
この時点で、ダウンロード フォルダが開き、実行するかどうか尋ねられます。デスクトップに作成したフォルダに.exeを保存するようにするにはどうすればよいですか??? 助けてください!!
編集:助けてくれてありがとう、しかし、私が指示したファイル内のexeのショートカットは作成されません。Eというドキュメントを作成し続けます。何か間違ったことをしているのですか、そこにコード行がありません。これは私が持っているものです。
Section "CleanWDF" SEC09
SetOutPath "$INSTDIR\cleanWDF.exe"
SetOverwrite ifnewer
NSISdl::download_quiet "download.File.com/File.exe";
CreateShortCut "$Desktop\NIS Edit\File.exe" "$INSTDIR\File.exe"
SectionEnd
編集2:
これが私が働こうとしているスクリプトです。どこが間違っているのか教えていただければ幸いです。
; Script generated by the HM NIS Edit Script Wizard.
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "Support tool"
!define PRODUCT_VERSION "3.0"
!define PRODUCT_PUBLISHER "Me"
!define PRODUCT_WEB_SITE "https://www.mywebsite.com"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\AppPaths\C:\Users\sgould\Desktop\NIS Edit"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
; MUI 1.67 compatible ------
!include "MUI2.nsh"
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
!insertmacro MUI_PAGE_COMPONENTS
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!define MUI_FINISHPAGE_RUN "$INSTDIR\C:\Users\"user"\Desktop\NIS Edit"
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
!insertmacro MUI_LANGUAGE "English"
; MUI end ------
!define VARIANT_TRUE -1 ;((VARIANT_BOOL)-1)
!define VT_ERROR 10
!define DISP_E_PARAMNOTFOUND 0x80020004
!define CLSCTX_LOCAL_SERVER 0x4
!define CLSID_InternetExplorer {0002DF01-0000-0000-C000-000000000046}
!define IID_IWebBrowserApp {0002DF05-0000-0000-C000-000000000046}
!define IWebBrowserApp.Navigate ->11(i,i,i,i,i)i
!define IWebBrowserApp.put_Visible ->41(&i2)i
Function InternetExplorerAuto_OpenURL
exch $2
push $0
push $1
System::Call "ole32::CoCreateInstance( \
g '${CLSID_InternetExplorer}', i 0, \
i ${CLSCTX_LOCAL_SERVER}, \
g '${IID_IWebBrowserApp}', *i 0 r0)"
System::Call "$0${IWebBrowserApp.put_Visible} (${VARIANT_TRUE}).r1"
System::Call "*(i ${VT_ERROR},i ${DISP_E_PARAMNOTFOUND},i)i.r1" ;VARIANT
System::Call 'Oleaut32::SysAllocString(w "$2")i.r2'
System::Call "$0${IWebBrowserApp.Navigate} ($2,$1,$1,$1,$1)"
System::Free $1
System::Call 'Oleaut32::SysFreeString(ir2)'
System::Call "$0->2()"
pop $1
pop $0
pop $2
FunctionEnd
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "supportTools.exe"
InstallDir "C:\Users\"user"\Desktop\NIS Edit"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show
Section "file" SEC03
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
push "http:"
CreateShortCut "$Desktop\file.lnk" "$Desktop\NSI Edit\file.exe"
call InternetExplorerAuto_OpenURL
SectionEnd
Section -Post
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\C:\Users\sgould\Desktop\NIS Edit\NIS Edit"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\SupportTools.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd
; Section descriptions
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
FunctionEnd
Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
Abort
FunctionEnd
Section Uninstall
Delete "$INSTDIR\${PRODUCT_NAME}.url"
Delete "$INSTDIR\file.exe"
Delete "$INSTDIR\file.exe"
Delete "$INSTDIR\file-2.30-bin.zip"
Delete "$INSTDIR\file.exe"
Delete "$INSTDIR\file.exe"
Delete "$INSTDIR\file.exe"
Delete "$INSTDIR\file.exe"
Delete "$INSTDIR\file.exe"
Delete "$INSTDIR\file.exe"
Delete "$INSTDIR\file.exe"
Delete "$INSTDIR\file.exe"
Delete "$SMPROGRAMS\Support Tools\Uninstall.lnk"
Delete "$SMPROGRAMS\Support Tools\Website.lnk"
RMDir "$INSTDIR"
RMDir ""
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
SetAutoClose true
SectionEnd